diff options
author | Dmitry Kasatkin <dmitry.kasatkin@nokia.com> | 2010-05-02 23:10:03 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-05-02 23:10:03 -0400 |
commit | ee5500c45c4860a84bba502c6d9ef5af6395dad6 (patch) | |
tree | f83297e838f8fea3cc02ba2583850ddf219abb95 /arch/arm | |
parent | c614e109c184edd7900d9ff4d6de9ef94bc4d85b (diff) |
crypto: omap - Updates omap sham device related platform code
- registration with multi OMAP kernels support
- clocks
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm')
-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 | 58 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap34xx.h | 5 |
5 files changed, 56 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index f12af95ead45..fc55ab4c32e3 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
@@ -1836,7 +1836,7 @@ static struct omap_clk omap2420_clks[] = { | |||
1836 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), | 1836 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), |
1837 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), | 1837 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), |
1838 | CLK(NULL, "des_ick", &des_ick, CK_242X), | 1838 | CLK(NULL, "des_ick", &des_ick, CK_242X), |
1839 | CLK(NULL, "sha_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(NULL, "aes_ick", &aes_ick, CK_242X), |
1842 | CLK(NULL, "pka_ick", &pka_ick, CK_242X), | 1842 | CLK(NULL, "pka_ick", &pka_ick, CK_242X), |
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index 0438b6e4f51a..5884ac681c4a 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c | |||
@@ -1924,7 +1924,7 @@ static struct omap_clk omap2430_clks[] = { | |||
1924 | CLK(NULL, "sdma_ick", &sdma_ick, CK_243X), | 1924 | CLK(NULL, "sdma_ick", &sdma_ick, CK_243X), |
1925 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X), | 1925 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X), |
1926 | CLK(NULL, "des_ick", &des_ick, CK_243X), | 1926 | CLK(NULL, "des_ick", &des_ick, CK_243X), |
1927 | CLK(NULL, "sha_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(NULL, "aes_ick", &aes_ick, CK_243X), |
1930 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), | 1930 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index d5153b6bd6cb..5a974dcbcecc 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -3360,7 +3360,7 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3360 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), | 3360 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), |
3361 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), | 3361 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), |
3362 | CLK(NULL, "aes2_ick", &aes2_ick, CK_343X), | 3362 | CLK(NULL, "aes2_ick", &aes2_ick, CK_343X), |
3363 | CLK(NULL, "sha12_ick", &sha12_ick, CK_343X), | 3363 | CLK("omap-sham", "ick", &sha12_ick, CK_343X), |
3364 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), | 3364 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), |
3365 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), | 3365 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), |
3366 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), | 3366 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 23e4d7733610..7e7acc19bed0 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <plat/mux.h> | 26 | #include <plat/mux.h> |
27 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
28 | #include <plat/mmc.h> | 28 | #include <plat/mmc.h> |
29 | #include <plat/dma.h> | ||
29 | 30 | ||
30 | #include "mux.h" | 31 | #include "mux.h" |
31 | 32 | ||
@@ -453,8 +454,10 @@ static void omap_init_mcspi(void) | |||
453 | static inline void omap_init_mcspi(void) {} | 454 | static inline void omap_init_mcspi(void) {} |
454 | #endif | 455 | #endif |
455 | 456 | ||
456 | #ifdef CONFIG_OMAP_SHA1_MD5 | 457 | #if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE) |
457 | static struct resource sha1_md5_resources[] = { | 458 | |
459 | #ifdef CONFIG_ARCH_OMAP24XX | ||
460 | static struct resource omap2_sham_resources[] = { | ||
458 | { | 461 | { |
459 | .start = OMAP24XX_SEC_SHA1MD5_BASE, | 462 | .start = OMAP24XX_SEC_SHA1MD5_BASE, |
460 | .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64, | 463 | .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64, |
@@ -465,20 +468,55 @@ static struct resource sha1_md5_resources[] = { | |||
465 | .flags = IORESOURCE_IRQ, | 468 | .flags = IORESOURCE_IRQ, |
466 | } | 469 | } |
467 | }; | 470 | }; |
471 | static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources); | ||
472 | #else | ||
473 | #define omap2_sham_resources NULL | ||
474 | #define omap2_sham_resources_sz 0 | ||
475 | #endif | ||
468 | 476 | ||
469 | static struct platform_device sha1_md5_device = { | 477 | #ifdef CONFIG_ARCH_OMAP34XX |
470 | .name = "OMAP SHA1/MD5", | 478 | static struct resource omap3_sham_resources[] = { |
479 | { | ||
480 | .start = OMAP34XX_SEC_SHA1MD5_BASE, | ||
481 | .end = OMAP34XX_SEC_SHA1MD5_BASE + 0x64, | ||
482 | .flags = IORESOURCE_MEM, | ||
483 | }, | ||
484 | { | ||
485 | .start = INT_34XX_SHA1MD52_IRQ, | ||
486 | .flags = IORESOURCE_IRQ, | ||
487 | }, | ||
488 | { | ||
489 | .start = OMAP34XX_DMA_SHA1MD5_RX, | ||
490 | .flags = IORESOURCE_DMA, | ||
491 | } | ||
492 | }; | ||
493 | static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources); | ||
494 | #else | ||
495 | #define omap3_sham_resources NULL | ||
496 | #define omap3_sham_resources_sz 0 | ||
497 | #endif | ||
498 | |||
499 | static struct platform_device sham_device = { | ||
500 | .name = "omap-sham", | ||
471 | .id = -1, | 501 | .id = -1, |
472 | .num_resources = ARRAY_SIZE(sha1_md5_resources), | ||
473 | .resource = sha1_md5_resources, | ||
474 | }; | 502 | }; |
475 | 503 | ||
476 | static void omap_init_sha1_md5(void) | 504 | static void omap_init_sham(void) |
477 | { | 505 | { |
478 | platform_device_register(&sha1_md5_device); | 506 | if (cpu_is_omap24xx()) { |
507 | sham_device.resource = omap2_sham_resources; | ||
508 | sham_device.num_resources = omap2_sham_resources_sz; | ||
509 | } else if (cpu_is_omap34xx()) { | ||
510 | sham_device.resource = omap3_sham_resources; | ||
511 | sham_device.num_resources = omap3_sham_resources_sz; | ||
512 | } else { | ||
513 | pr_err("%s: platform not supported\n", __func__); | ||
514 | return; | ||
515 | } | ||
516 | platform_device_register(&sham_device); | ||
479 | } | 517 | } |
480 | #else | 518 | #else |
481 | static inline void omap_init_sha1_md5(void) { } | 519 | static inline void omap_init_sham(void) { } |
482 | #endif | 520 | #endif |
483 | 521 | ||
484 | /*-------------------------------------------------------------------------*/ | 522 | /*-------------------------------------------------------------------------*/ |
@@ -799,7 +837,7 @@ static int __init omap2_init_devices(void) | |||
799 | omap_init_mcspi(); | 837 | omap_init_mcspi(); |
800 | omap_hdq_init(); | 838 | omap_hdq_init(); |
801 | omap_init_sti(); | 839 | omap_init_sti(); |
802 | omap_init_sha1_md5(); | 840 | omap_init_sham(); |
803 | 841 | ||
804 | return 0; | 842 | return 0; |
805 | } | 843 | } |
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h index 2845fdc658b0..98fc8b4a4cc4 100644 --- a/arch/arm/plat-omap/include/plat/omap34xx.h +++ b/arch/arm/plat-omap/include/plat/omap34xx.h | |||
@@ -82,5 +82,10 @@ | |||
82 | 82 | ||
83 | #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) | 83 | #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) |
84 | 84 | ||
85 | /* Security */ | ||
86 | #define OMAP34XX_SEC_BASE (L4_34XX_BASE + 0xA0000) | ||
87 | #define OMAP34XX_SEC_SHA1MD5_BASE (OMAP34XX_SEC_BASE + 0x23000) | ||
88 | #define OMAP34XX_SEC_AES_BASE (OMAP34XX_SEC_BASE + 0x25000) | ||
89 | |||
85 | #endif /* __ASM_ARCH_OMAP3_H */ | 90 | #endif /* __ASM_ARCH_OMAP3_H */ |
86 | 91 | ||