]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix omap_wdt driver failure on 2420 when running multi-omap config
authorJarkko Nikula <jarkko.nikula@nokia.com>
Thu, 21 Aug 2008 09:32:38 +0000 (12:32 +0300)
committerTony Lindgren <tony@atomide.com>
Sat, 23 Aug 2008 23:18:32 +0000 (16:18 -0700)
omap_wdt driver will do unhandled fault on 2420 if support for 2430 is
compiled in since wrong base address is defined in that case. Assign
omap_wdt base address runtime depending on cpu type.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/devices.c

index f22ccbb280cf37541e637c29526c6a9e84874df7..3bd1da287119277176bfd5865eabf201f269a20f 100644 (file)
@@ -454,25 +454,8 @@ static inline void omap_init_uwire(void) {}
 
 #if    defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
 
-#if defined(CONFIG_ARCH_OMAP34XX)
-#define        OMAP_WDT_BASE           0x48314000
-#elif defined(CONFIG_ARCH_OMAP24XX)
-
-#ifdef CONFIG_ARCH_OMAP2430
-/* WDT2 */
-#define        OMAP_WDT_BASE           0x49016000
-#else
-#define        OMAP_WDT_BASE           0x48022000
-#endif
-
-#else
-#define        OMAP_WDT_BASE           0xfffeb000
-#endif
-
 static struct resource wdt_resources[] = {
        {
-               .start          = OMAP_WDT_BASE,
-               .end            = OMAP_WDT_BASE + 0x4f,
                .flags          = IORESOURCE_MEM,
        },
 };
@@ -486,6 +469,19 @@ static struct platform_device omap_wdt_device = {
 
 static void omap_init_wdt(void)
 {
+       if (cpu_is_omap16xx())
+               wdt_resources[0].start = 0xfffeb000;
+       else if (cpu_is_omap2420())
+               wdt_resources[0].start = 0x48022000; /* WDT2 */
+       else if (cpu_is_omap2430())
+               wdt_resources[0].start = 0x49016000; /* WDT2 */
+       else if (cpu_is_omap343x())
+               wdt_resources[0].start = 0x48314000; /* WDT2 */
+       else
+               return;
+
+       wdt_resources[0].end = wdt_resources[0].start + 0x4f;
+
        (void) platform_device_register(&omap_wdt_device);
 }
 #else