aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorDmitry Kasatkin <dmitry.kasatkin@nokia.com>2010-09-03 07:13:55 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2010-09-03 07:13:55 -0400
commitb744c679f62b368cb94c21c1dcd4618e42d88d63 (patch)
tree4482675717275993b41c21dd1206a8259215f511 /arch/arm/mach-omap2/devices.c
parent57a2ce5f54f3120467be760662c6ef3bea3f9579 (diff)
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>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 03e6c9ed82a4..072893a7d136 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -552,6 +552,76 @@ static void omap_init_sham(void)
552static inline void omap_init_sham(void) { } 552static inline void omap_init_sham(void) { }
553#endif 553#endif
554 554
555#if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)
556
557#ifdef CONFIG_ARCH_OMAP24XX
558static struct resource omap2_aes_resources[] = {
559 {
560 .start = OMAP24XX_SEC_AES_BASE,
561 .end = OMAP24XX_SEC_AES_BASE + 0x4C,
562 .flags = IORESOURCE_MEM,
563 },
564 {
565 .start = OMAP24XX_DMA_AES_TX,
566 .flags = IORESOURCE_DMA,
567 },
568 {
569 .start = OMAP24XX_DMA_AES_RX,
570 .flags = IORESOURCE_DMA,
571 }
572};
573static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
574#else
575#define omap2_aes_resources NULL
576#define omap2_aes_resources_sz 0
577#endif
578
579#ifdef CONFIG_ARCH_OMAP34XX
580static struct resource omap3_aes_resources[] = {
581 {
582 .start = OMAP34XX_SEC_AES_BASE,
583 .end = OMAP34XX_SEC_AES_BASE + 0x4C,
584 .flags = IORESOURCE_MEM,
585 },
586 {
587 .start = OMAP34XX_DMA_AES2_TX,
588 .flags = IORESOURCE_DMA,
589 },
590 {
591 .start = OMAP34XX_DMA_AES2_RX,
592 .flags = IORESOURCE_DMA,
593 }
594};
595static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources);
596#else
597#define omap3_aes_resources NULL
598#define omap3_aes_resources_sz 0
599#endif
600
601static struct platform_device aes_device = {
602 .name = "omap-aes",
603 .id = -1,
604};
605
606static void omap_init_aes(void)
607{
608 if (cpu_is_omap24xx()) {
609 aes_device.resource = omap2_aes_resources;
610 aes_device.num_resources = omap2_aes_resources_sz;
611 } else if (cpu_is_omap34xx()) {
612 aes_device.resource = omap3_aes_resources;
613 aes_device.num_resources = omap3_aes_resources_sz;
614 } else {
615 pr_err("%s: platform not supported\n", __func__);
616 return;
617 }
618 platform_device_register(&aes_device);
619}
620
621#else
622static inline void omap_init_aes(void) { }
623#endif
624
555/*-------------------------------------------------------------------------*/ 625/*-------------------------------------------------------------------------*/
556 626
557#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 627#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
@@ -908,6 +978,7 @@ static int __init omap2_init_devices(void)
908 omap_hdq_init(); 978 omap_hdq_init();
909 omap_init_sti(); 979 omap_init_sti();
910 omap_init_sham(); 980 omap_init_sham();
981 omap_init_aes();
911 omap_init_vout(); 982 omap_init_vout();
912 983
913 return 0; 984 return 0;