diff options
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 58 |
1 files changed, 48 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 705a7a30a87f..03e6c9ed82a4 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <plat/mux.h> | 28 | #include <plat/mux.h> |
29 | #include <mach/gpio.h> | 29 | #include <mach/gpio.h> |
30 | #include <plat/mmc.h> | 30 | #include <plat/mmc.h> |
31 | #include <plat/dma.h> | ||
31 | 32 | ||
32 | #include "mux.h" | 33 | #include "mux.h" |
33 | 34 | ||
@@ -486,8 +487,10 @@ static void omap_init_pmu(void) | |||
486 | } | 487 | } |
487 | 488 | ||
488 | 489 | ||
489 | #ifdef CONFIG_OMAP_SHA1_MD5 | 490 | #if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE) |
490 | static struct resource sha1_md5_resources[] = { | 491 | |
492 | #ifdef CONFIG_ARCH_OMAP2 | ||
493 | static struct resource omap2_sham_resources[] = { | ||
491 | { | 494 | { |
492 | .start = OMAP24XX_SEC_SHA1MD5_BASE, | 495 | .start = OMAP24XX_SEC_SHA1MD5_BASE, |
493 | .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64, | 496 | .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64, |
@@ -498,20 +501,55 @@ static struct resource sha1_md5_resources[] = { | |||
498 | .flags = IORESOURCE_IRQ, | 501 | .flags = IORESOURCE_IRQ, |
499 | } | 502 | } |
500 | }; | 503 | }; |
504 | static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources); | ||
505 | #else | ||
506 | #define omap2_sham_resources NULL | ||
507 | #define omap2_sham_resources_sz 0 | ||
508 | #endif | ||
501 | 509 | ||
502 | static struct platform_device sha1_md5_device = { | 510 | #ifdef CONFIG_ARCH_OMAP3 |
503 | .name = "OMAP SHA1/MD5", | 511 | static struct resource omap3_sham_resources[] = { |
512 | { | ||
513 | .start = OMAP34XX_SEC_SHA1MD5_BASE, | ||
514 | .end = OMAP34XX_SEC_SHA1MD5_BASE + 0x64, | ||
515 | .flags = IORESOURCE_MEM, | ||
516 | }, | ||
517 | { | ||
518 | .start = INT_34XX_SHA1MD52_IRQ, | ||
519 | .flags = IORESOURCE_IRQ, | ||
520 | }, | ||
521 | { | ||
522 | .start = OMAP34XX_DMA_SHA1MD5_RX, | ||
523 | .flags = IORESOURCE_DMA, | ||
524 | } | ||
525 | }; | ||
526 | static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources); | ||
527 | #else | ||
528 | #define omap3_sham_resources NULL | ||
529 | #define omap3_sham_resources_sz 0 | ||
530 | #endif | ||
531 | |||
532 | static struct platform_device sham_device = { | ||
533 | .name = "omap-sham", | ||
504 | .id = -1, | 534 | .id = -1, |
505 | .num_resources = ARRAY_SIZE(sha1_md5_resources), | ||
506 | .resource = sha1_md5_resources, | ||
507 | }; | 535 | }; |
508 | 536 | ||
509 | static void omap_init_sha1_md5(void) | 537 | static void omap_init_sham(void) |
510 | { | 538 | { |
511 | platform_device_register(&sha1_md5_device); | 539 | if (cpu_is_omap24xx()) { |
540 | sham_device.resource = omap2_sham_resources; | ||
541 | sham_device.num_resources = omap2_sham_resources_sz; | ||
542 | } else if (cpu_is_omap34xx()) { | ||
543 | sham_device.resource = omap3_sham_resources; | ||
544 | sham_device.num_resources = omap3_sham_resources_sz; | ||
545 | } else { | ||
546 | pr_err("%s: platform not supported\n", __func__); | ||
547 | return; | ||
548 | } | ||
549 | platform_device_register(&sham_device); | ||
512 | } | 550 | } |
513 | #else | 551 | #else |
514 | static inline void omap_init_sha1_md5(void) { } | 552 | static inline void omap_init_sham(void) { } |
515 | #endif | 553 | #endif |
516 | 554 | ||
517 | /*-------------------------------------------------------------------------*/ | 555 | /*-------------------------------------------------------------------------*/ |
@@ -869,7 +907,7 @@ static int __init omap2_init_devices(void) | |||
869 | omap_init_pmu(); | 907 | omap_init_pmu(); |
870 | omap_hdq_init(); | 908 | omap_hdq_init(); |
871 | omap_init_sti(); | 909 | omap_init_sti(); |
872 | omap_init_sha1_md5(); | 910 | omap_init_sham(); |
873 | omap_init_vout(); | 911 | omap_init_vout(); |
874 | 912 | ||
875 | return 0; | 913 | return 0; |