diff options
author | Dmitry Kasatkin <dmitry.kasatkin@nokia.com> | 2010-08-20 09:44:46 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-27 13:15:25 -0400 |
commit | 82a0c149b5beb4b91036b9687644db8a913e8fd1 (patch) | |
tree | ea483d5dac69a33ee2e8143815933df2b783b6d3 /arch | |
parent | afc28bc0ec5ebe1b71108735e27283a19feb2e24 (diff) |
omap: crypto: updates to enable omap aes
Updates to enable omap aes
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
[tony@atomide.com: updated to use CONFIG_ARCH_OMAP2/3 instead of old 24XX/34XX]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/clock2420_data.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock2430_data.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock3xxx_data.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 71 |
4 files changed, 74 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index 37d65d62ed8f..5f2066a6ba74 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
@@ -1838,7 +1838,7 @@ static struct omap_clk omap2420_clks[] = { | |||
1838 | CLK(NULL, "des_ick", &des_ick, CK_242X), | 1838 | CLK(NULL, "des_ick", &des_ick, CK_242X), |
1839 | CLK("omap-sham", "ick", &sha_ick, CK_242X), | 1839 | CLK("omap-sham", "ick", &sha_ick, CK_242X), |
1840 | CLK("omap_rng", "ick", &rng_ick, CK_242X), | 1840 | CLK("omap_rng", "ick", &rng_ick, CK_242X), |
1841 | CLK(NULL, "aes_ick", &aes_ick, CK_242X), | 1841 | CLK("omap-aes", "ick", &aes_ick, CK_242X), |
1842 | CLK(NULL, "pka_ick", &pka_ick, CK_242X), | 1842 | CLK(NULL, "pka_ick", &pka_ick, CK_242X), |
1843 | CLK(NULL, "usb_fck", &usb_fck, CK_242X), | 1843 | CLK(NULL, "usb_fck", &usb_fck, CK_242X), |
1844 | CLK("musb_hdrc", "fck", &osc_ck, CK_242X), | 1844 | CLK("musb_hdrc", "fck", &osc_ck, CK_242X), |
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index b33118fb6a87..701a1716019e 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c | |||
@@ -1926,7 +1926,7 @@ static struct omap_clk omap2430_clks[] = { | |||
1926 | CLK(NULL, "des_ick", &des_ick, CK_243X), | 1926 | CLK(NULL, "des_ick", &des_ick, CK_243X), |
1927 | CLK("omap-sham", "ick", &sha_ick, CK_243X), | 1927 | CLK("omap-sham", "ick", &sha_ick, CK_243X), |
1928 | CLK("omap_rng", "ick", &rng_ick, CK_243X), | 1928 | CLK("omap_rng", "ick", &rng_ick, CK_243X), |
1929 | CLK(NULL, "aes_ick", &aes_ick, CK_243X), | 1929 | CLK("omap-aes", "ick", &aes_ick, CK_243X), |
1930 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), | 1930 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), |
1931 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), | 1931 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), |
1932 | CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X), | 1932 | CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X), |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index dfdce2d82779..c73906d17458 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -3288,7 +3288,7 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3288 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX), | 3288 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX), |
3289 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), | 3289 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), |
3290 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), | 3290 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), |
3291 | CLK(NULL, "aes2_ick", &aes2_ick, CK_343X), | 3291 | CLK("omap-aes", "ick", &aes2_ick, CK_343X), |
3292 | CLK("omap-sham", "ick", &sha12_ick, CK_343X), | 3292 | CLK("omap-sham", "ick", &sha12_ick, CK_343X), |
3293 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), | 3293 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), |
3294 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), | 3294 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2dbb265bedd4..dc49c07dc161 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -498,6 +498,76 @@ static void omap_init_sham(void) | |||
498 | static inline void omap_init_sham(void) { } | 498 | static inline void omap_init_sham(void) { } |
499 | #endif | 499 | #endif |
500 | 500 | ||
501 | #if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE) | ||
502 | |||
503 | #ifdef CONFIG_ARCH_OMAP2 | ||
504 | static struct resource omap2_aes_resources[] = { | ||
505 | { | ||
506 | .start = OMAP24XX_SEC_AES_BASE, | ||
507 | .end = OMAP24XX_SEC_AES_BASE + 0x4C, | ||
508 | .flags = IORESOURCE_MEM, | ||
509 | }, | ||
510 | { | ||
511 | .start = OMAP24XX_DMA_AES_TX, | ||
512 | .flags = IORESOURCE_DMA, | ||
513 | }, | ||
514 | { | ||
515 | .start = OMAP24XX_DMA_AES_RX, | ||
516 | .flags = IORESOURCE_DMA, | ||
517 | } | ||
518 | }; | ||
519 | static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources); | ||
520 | #else | ||
521 | #define omap2_aes_resources NULL | ||
522 | #define omap2_aes_resources_sz 0 | ||
523 | #endif | ||
524 | |||
525 | #ifdef CONFIG_ARCH_OMAP3 | ||
526 | static struct resource omap3_aes_resources[] = { | ||
527 | { | ||
528 | .start = OMAP34XX_SEC_AES_BASE, | ||
529 | .end = OMAP34XX_SEC_AES_BASE + 0x4C, | ||
530 | .flags = IORESOURCE_MEM, | ||
531 | }, | ||
532 | { | ||
533 | .start = OMAP34XX_DMA_AES2_TX, | ||
534 | .flags = IORESOURCE_DMA, | ||
535 | }, | ||
536 | { | ||
537 | .start = OMAP34XX_DMA_AES2_RX, | ||
538 | .flags = IORESOURCE_DMA, | ||
539 | } | ||
540 | }; | ||
541 | static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources); | ||
542 | #else | ||
543 | #define omap3_aes_resources NULL | ||
544 | #define omap3_aes_resources_sz 0 | ||
545 | #endif | ||
546 | |||
547 | static struct platform_device aes_device = { | ||
548 | .name = "omap-aes", | ||
549 | .id = -1, | ||
550 | }; | ||
551 | |||
552 | static void omap_init_aes(void) | ||
553 | { | ||
554 | if (cpu_is_omap24xx()) { | ||
555 | aes_device.resource = omap2_aes_resources; | ||
556 | aes_device.num_resources = omap2_aes_resources_sz; | ||
557 | } else if (cpu_is_omap34xx()) { | ||
558 | aes_device.resource = omap3_aes_resources; | ||
559 | aes_device.num_resources = omap3_aes_resources_sz; | ||
560 | } else { | ||
561 | pr_err("%s: platform not supported\n", __func__); | ||
562 | return; | ||
563 | } | ||
564 | platform_device_register(&aes_device); | ||
565 | } | ||
566 | |||
567 | #else | ||
568 | static inline void omap_init_aes(void) { } | ||
569 | #endif | ||
570 | |||
501 | /*-------------------------------------------------------------------------*/ | 571 | /*-------------------------------------------------------------------------*/ |
502 | 572 | ||
503 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 573 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
@@ -854,6 +924,7 @@ static int __init omap2_init_devices(void) | |||
854 | omap_hdq_init(); | 924 | omap_hdq_init(); |
855 | omap_init_sti(); | 925 | omap_init_sti(); |
856 | omap_init_sham(); | 926 | omap_init_sham(); |
927 | omap_init_aes(); | ||
857 | omap_init_vout(); | 928 | omap_init_vout(); |
858 | 929 | ||
859 | return 0; | 930 | return 0; |