crypto: updates to enable omap aes
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Родитель
57a2ce5f54
Коммит
b744c679f6
|
@ -1838,7 +1838,7 @@ static struct omap_clk omap2420_clks[] = {
|
||||||
CLK(NULL, "des_ick", &des_ick, CK_242X),
|
CLK(NULL, "des_ick", &des_ick, CK_242X),
|
||||||
CLK("omap-sham", "ick", &sha_ick, CK_242X),
|
CLK("omap-sham", "ick", &sha_ick, CK_242X),
|
||||||
CLK("omap_rng", "ick", &rng_ick, CK_242X),
|
CLK("omap_rng", "ick", &rng_ick, CK_242X),
|
||||||
CLK(NULL, "aes_ick", &aes_ick, CK_242X),
|
CLK("omap-aes", "ick", &aes_ick, CK_242X),
|
||||||
CLK(NULL, "pka_ick", &pka_ick, CK_242X),
|
CLK(NULL, "pka_ick", &pka_ick, CK_242X),
|
||||||
CLK(NULL, "usb_fck", &usb_fck, CK_242X),
|
CLK(NULL, "usb_fck", &usb_fck, CK_242X),
|
||||||
CLK("musb_hdrc", "fck", &osc_ck, CK_242X),
|
CLK("musb_hdrc", "fck", &osc_ck, CK_242X),
|
||||||
|
|
|
@ -1926,7 +1926,7 @@ static struct omap_clk omap2430_clks[] = {
|
||||||
CLK(NULL, "des_ick", &des_ick, CK_243X),
|
CLK(NULL, "des_ick", &des_ick, CK_243X),
|
||||||
CLK("omap-sham", "ick", &sha_ick, CK_243X),
|
CLK("omap-sham", "ick", &sha_ick, CK_243X),
|
||||||
CLK("omap_rng", "ick", &rng_ick, CK_243X),
|
CLK("omap_rng", "ick", &rng_ick, CK_243X),
|
||||||
CLK(NULL, "aes_ick", &aes_ick, CK_243X),
|
CLK("omap-aes", "ick", &aes_ick, CK_243X),
|
||||||
CLK(NULL, "pka_ick", &pka_ick, CK_243X),
|
CLK(NULL, "pka_ick", &pka_ick, CK_243X),
|
||||||
CLK(NULL, "usb_fck", &usb_fck, CK_243X),
|
CLK(NULL, "usb_fck", &usb_fck, CK_243X),
|
||||||
CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X),
|
CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X),
|
||||||
|
|
|
@ -3288,7 +3288,7 @@ static struct omap_clk omap3xxx_clks[] = {
|
||||||
CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX),
|
CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX),
|
||||||
CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX),
|
CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX),
|
||||||
CLK(NULL, "icr_ick", &icr_ick, CK_343X),
|
CLK(NULL, "icr_ick", &icr_ick, CK_343X),
|
||||||
CLK(NULL, "aes2_ick", &aes2_ick, CK_343X),
|
CLK("omap-aes", "ick", &aes2_ick, CK_343X),
|
||||||
CLK("omap-sham", "ick", &sha12_ick, CK_343X),
|
CLK("omap-sham", "ick", &sha12_ick, CK_343X),
|
||||||
CLK(NULL, "des2_ick", &des2_ick, CK_343X),
|
CLK(NULL, "des2_ick", &des2_ick, CK_343X),
|
||||||
CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX),
|
CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX),
|
||||||
|
|
|
@ -552,6 +552,76 @@ static void omap_init_sham(void)
|
||||||
static inline void omap_init_sham(void) { }
|
static inline void omap_init_sham(void) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_OMAP24XX
|
||||||
|
static struct resource omap2_aes_resources[] = {
|
||||||
|
{
|
||||||
|
.start = OMAP24XX_SEC_AES_BASE,
|
||||||
|
.end = OMAP24XX_SEC_AES_BASE + 0x4C,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.start = OMAP24XX_DMA_AES_TX,
|
||||||
|
.flags = IORESOURCE_DMA,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.start = OMAP24XX_DMA_AES_RX,
|
||||||
|
.flags = IORESOURCE_DMA,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
|
||||||
|
#else
|
||||||
|
#define omap2_aes_resources NULL
|
||||||
|
#define omap2_aes_resources_sz 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_OMAP34XX
|
||||||
|
static struct resource omap3_aes_resources[] = {
|
||||||
|
{
|
||||||
|
.start = OMAP34XX_SEC_AES_BASE,
|
||||||
|
.end = OMAP34XX_SEC_AES_BASE + 0x4C,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.start = OMAP34XX_DMA_AES2_TX,
|
||||||
|
.flags = IORESOURCE_DMA,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.start = OMAP34XX_DMA_AES2_RX,
|
||||||
|
.flags = IORESOURCE_DMA,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources);
|
||||||
|
#else
|
||||||
|
#define omap3_aes_resources NULL
|
||||||
|
#define omap3_aes_resources_sz 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static struct platform_device aes_device = {
|
||||||
|
.name = "omap-aes",
|
||||||
|
.id = -1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void omap_init_aes(void)
|
||||||
|
{
|
||||||
|
if (cpu_is_omap24xx()) {
|
||||||
|
aes_device.resource = omap2_aes_resources;
|
||||||
|
aes_device.num_resources = omap2_aes_resources_sz;
|
||||||
|
} else if (cpu_is_omap34xx()) {
|
||||||
|
aes_device.resource = omap3_aes_resources;
|
||||||
|
aes_device.num_resources = omap3_aes_resources_sz;
|
||||||
|
} else {
|
||||||
|
pr_err("%s: platform not supported\n", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
platform_device_register(&aes_device);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
static inline void omap_init_aes(void) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
|
#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
|
||||||
|
@ -908,6 +978,7 @@ static int __init omap2_init_devices(void)
|
||||||
omap_hdq_init();
|
omap_hdq_init();
|
||||||
omap_init_sti();
|
omap_init_sti();
|
||||||
omap_init_sham();
|
omap_init_sham();
|
||||||
|
omap_init_aes();
|
||||||
omap_init_vout();
|
omap_init_vout();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче