]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Add RNG platform device
authorDeepak Saxena <dsaxena@plexity.net>
Wed, 19 Oct 2005 16:22:10 +0000 (19:22 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 19 Oct 2005 16:22:10 +0000 (19:22 +0300)
The following patch adds a platform device for the OMAP RNG. I have
added support for using this to the RNG driver as part of a generic
RNG codebase I'm writing and will submit that for testing once
it is compiling.

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/devices.c

index f819f5148e27876e1506cec49440c2506efbaea2..e6e4713993733bd4a79053ac26c6af6cd3a58c19 100644 (file)
@@ -305,6 +305,41 @@ static void omap_init_wdt(void)
 static inline void omap_init_wdt(void) {}
 #endif
 
+/*-------------------------------------------------------------------------*/
+
+#if    defined(CONFIG_OMAP_RNG) || defined(CONFIG_OMAP_RNG_MODULE)
+
+#ifdef CONFIG_ARCH_OMAP24XX
+#define        OMAP_RNG_BASE           0x480A0000
+#else
+#define        OMAP_RNG_BASE           0xfffe5000
+#endif
+
+static struct resource rng_resources[] = {
+       {
+               .start          = OMAP_RNG_BASE,
+               .end            = OMAP_RNG_BASE + 0x4f,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device omap_rng_device = {
+       .name      = "omap_rng",
+       .id          = -1,
+       .dev = {
+               .release        = omap_nop_release,
+       },
+       .num_resources  = ARRAY_SIZE(rng_resources),
+       .resource       = rng_resources,
+};
+
+static void omap_init_rng(void)
+{
+       (void) platform_device_register(&omap_rng_device);
+}
+#else
+static inline void omap_init_rng(void) {}
+#endif
 
 /*
  * This gets called after board-specific INIT_MACHINE, and initializes most
@@ -334,6 +369,7 @@ static int __init omap_init_devices(void)
        omap_init_i2c();
        omap_init_mmc();
        omap_init_wdt();
+       omap_init_rng();
 
        return 0;
 }