mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 11:55:53 +00:00
2789c08fff
This adds a driver for the ST-Ericsson ux500 crypto hardware module. It supports AES, DES and 3DES, the driver implements support for AES-ECB,CBC and CTR. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andreas Westin <andreas.westin@stericsson.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
/**
|
|
* Copyright (C) ST-Ericsson SA 2010
|
|
* Author: Shujuan Chen <shujuan.chen@stericsson.com> for ST-Ericsson.
|
|
* Author: Jonas Linde <jonas.linde@stericsson.com> for ST-Ericsson.
|
|
* Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson.
|
|
* Author: Berne Hebark <berne.herbark@stericsson.com> for ST-Ericsson.
|
|
* Author: Niklas Hernaeus <niklas.hernaeus@stericsson.com> for ST-Ericsson.
|
|
* License terms: GNU General Public License (GPL) version 2.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/bitmap.h>
|
|
#include <linux/device.h>
|
|
|
|
#include "cryp.h"
|
|
#include "cryp_p.h"
|
|
#include "cryp_irq.h"
|
|
#include "cryp_irqp.h"
|
|
|
|
void cryp_enable_irq_src(struct cryp_device_data *device_data, u32 irq_src)
|
|
{
|
|
u32 i;
|
|
|
|
dev_dbg(device_data->dev, "[%s]", __func__);
|
|
|
|
i = readl_relaxed(&device_data->base->imsc);
|
|
i = i | irq_src;
|
|
writel_relaxed(i, &device_data->base->imsc);
|
|
}
|
|
|
|
void cryp_disable_irq_src(struct cryp_device_data *device_data, u32 irq_src)
|
|
{
|
|
u32 i;
|
|
|
|
dev_dbg(device_data->dev, "[%s]", __func__);
|
|
|
|
i = readl_relaxed(&device_data->base->imsc);
|
|
i = i & ~irq_src;
|
|
writel_relaxed(i, &device_data->base->imsc);
|
|
}
|
|
|
|
bool cryp_pending_irq_src(struct cryp_device_data *device_data, u32 irq_src)
|
|
{
|
|
return (readl_relaxed(&device_data->base->mis) & irq_src) > 0;
|
|
}
|