On Fri, 19 Oct 2012, Mark A. Greer wrote: > From: "Mark A. Greer" <mgreer@xxxxxxxxxxxxxxx> > > Convert the device data for the OMAP3 SHAM2 (SHA1/MD5) crypto IP > from explicit platform_data to hwmod. When bit 27 (OMAP3430_ST_SHA12_MASK) > of the CM_IDLEST1_CORE register is 0, the SHA2 IP is present. > > CC: Paul Walmsley <paul@xxxxxxxxx> > Signed-off-by: Mark A. Greer <mgreer@xxxxxxxxxxxxxxx> ... > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > index 5b613fa..40211de 100644 > --- a/arch/arm/mach-omap2/devices.c > +++ b/arch/arm/mach-omap2/devices.c > @@ -36,6 +36,7 @@ > #include "devices.h" > #include "cm2xxx_3xxx.h" > #include "cm-regbits-24xx.h" > +#include "cm-regbits-34xx.h" > > #define L3_MODULES_MAX_LEN 12 > #define L3_MODULES 3 > @@ -453,40 +454,14 @@ static void omap_init_rng(void) > WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n"); > } > > -#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE) > - > -#ifdef CONFIG_ARCH_OMAP3 > -static struct resource omap3_sham_resources[] = { > - { > - .start = OMAP34XX_SEC_SHA1MD5_BASE, > - .end = OMAP34XX_SEC_SHA1MD5_BASE + 0x64, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = 49 + OMAP_INTC_START, > - .flags = IORESOURCE_IRQ, > - }, > - { > - .start = OMAP34XX_DMA_SHA1MD5_RX, > - .flags = IORESOURCE_DMA, > - } > -}; > -static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources); > -#else > -#define omap3_sham_resources NULL > -#define omap3_sham_resources_sz 0 > -#endif > - > -static struct platform_device sham_device = { > - .name = "omap-sham", > - .id = -1, > -}; > - > -static void omap_init_sham(void) > +static void __init omap_init_sham(void) > { > - if (cpu_is_omap24xx() && > - (omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_IDLEST4) & > - OMAP24XX_ST_SHA_MASK)) { > + if ((cpu_is_omap24xx() && > + (omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_IDLEST4) & > + OMAP24XX_ST_SHA_MASK)) || > + (cpu_is_omap34xx() && > + (!(omap2_cm_read_mod_reg(CORE_MOD, CM_IDLEST1) & > + OMAP3430_ST_SHA12_MASK)))) { Same comment here as on the CM read on the 2xxx patch. - Paul -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html