From 8c0f7553e75774849463f90b0135874754650386 Mon Sep 17 00:00:00 2001 From: Greg Turner Date: Thu, 17 May 2012 14:45:05 -0500 Subject: [PATCH 2/8] am33x: Add crypto device and resource structures * Add platform device and resource structures to devices.c * Structures are for the AES and SHA/MD5 crypto modules * Used in the OMAP4 crypto driver Signed-off-by: Greg Turner --- arch/arm/mach-omap2/devices.c | 67 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) mode change 100644 => 100755 arch/arm/mach-omap2/devices.c diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c old mode 100644 new mode 100755 index 9e029da..5c6e3e2 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -702,6 +703,41 @@ static void omap_init_sham(void) } platform_device_register(&sham_device); } + +#elif defined(CONFIG_CRYPTO_DEV_OMAP4_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP4_SHAM_MODULE) + +static struct resource omap4_sham_resources[] = { + { + .start = AM33XX_SHA1MD5_P_BASE, + .end = AM33XX_SHA1MD5_P_BASE + 0x120, + .flags = IORESOURCE_MEM, + }, + { + .start = AM33XX_IRQ_SHAEIP57t0_P, + .flags = IORESOURCE_IRQ, + }, + { + .start = AM33XX_DMA_SHAEIP57T0_DIN, + .flags = IORESOURCE_DMA, + } +}; + +static int omap4_sham_resources_sz = ARRAY_SIZE(omap4_sham_resources); + + +static struct platform_device sham_device = { + .name = "omap4-sham", + .id = -1, +}; + +static void omap_init_sham(void) +{ + sham_device.resource = omap4_sham_resources; + sham_device.num_resources = omap4_sham_resources_sz; + + platform_device_register(&sham_device); +} + #else static inline void omap_init_sham(void) { } #endif @@ -772,6 +808,37 @@ static void omap_init_aes(void) platform_device_register(&aes_device); } +#elif defined(CONFIG_CRYPTO_DEV_OMAP4_AES) || defined(CONFIG_CRYPTO_DEV_OMAP4_AES_MODULE) + +static struct resource omap4_aes_resources[] = { + { + .start = AM33XX_AES0_P_BASE, + .end = AM33XX_AES0_P_BASE + 0x4C, + .flags = IORESOURCE_MEM, + }, + { + .start = AM33XX_DMA_AESEIP36T0_DOUT, + .flags = IORESOURCE_DMA, + }, + { + .start = AM33XX_DMA_AESEIP36T0_DIN, + .flags = IORESOURCE_DMA, + } +}; +static int omap4_aes_resources_sz = ARRAY_SIZE(omap4_aes_resources); + +static struct platform_device aes_device = { + .name = "omap4-aes", + .id = -1, +}; + +static void omap_init_aes(void) +{ + aes_device.resource = omap4_aes_resources; + aes_device.num_resources = omap4_aes_resources_sz; + platform_device_register(&aes_device); +} + #else static inline void omap_init_aes(void) { } #endif -- 1.7.0.4