Skip to contentSkip to conversation

ep93xx: Convert the watchdog driver into a platform device.

PATCH New H Hartley Sweeten 2 participants 3 messages Jan 20, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ep93xx: Convert the watchdog driver into a platform device.

Convert the ep93xx watchdog driver into a platform device and remove it's dependency on <mach/hardware.h>.

Cc Ryan Mallon <[email protected]>
Cc Wim Van Sebroeck <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Mika Westerberg <[email protected]>

---

arch/arm/mach-ep93xx/core.c +15 -0
index 24203f9..8fd387e 100644
@@ -890,6 +890,20 @@ void __init ep93xx_register_ac97(void)
 	platform_device_register(&ep93xx_pcm_device);
 }
 
+/*************************************************************************
+ * EP93xx Watchdog
+ *************************************************************************/
+static struct resource ep93xx_wdt_resources[] = {
+	DEFINE_RES_MEM(EP93XX_WATCHDOG_PHYS_BASE, 0x08),
+};
+
+static struct platform_device ep93xx_wdt_device = {
+	.name		= "ep93xx-wdt",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_wdt_resources),
+	.resource	= ep93xx_wdt_resources,
+};
+
 void __init ep93xx_init_devices(void)
 {
 	/* Disallow access to MaverickCrunch initially */
@@ -905,6 +919,7 @@ void __init ep93xx_init_devices(void)
 	platform_device_register(&ep93xx_rtc_device);
 	platform_device_register(&ep93xx_ohci_device);
 	platform_device_register(&ep93xx_leds);
+	platform_device_register(&ep93xx_wdt_device);
 }
 
 void ep93xx_restart(char mode, const char *cmd)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +1 -0
index c4a7b84..e9271a7 100644
@@ -224,6 +224,7 @@
 #define EP93XX_SYSCON_SYSCFG_LCSN1	(1<<0)
 #define EP93XX_SYSCON_SWLOCK		EP93XX_SYSCON_REG(0xc0)
 
+#define EP93XX_WATCHDOG_PHYS_BASE	EP93XX_APB_PHYS(0x00140000)
 #define EP93XX_WATCHDOG_BASE		EP93XX_APB_IOMEM(0x00140000)
 
 
drivers/watchdog/ep93xx_wdt.c +36 -14

113 lines not on this page · raw message

#1 lore raw

PATCH 1/1 ep93xx: Convert the watchdog driver into a platform device.

Hi,

...

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h line 228

Quoted 11 lines

void ep93xx_restart(char mode, const char *cmd)

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +1 -0
index c4a7b84..e9271a7 100644
@@ -224,6 +224,7 @@
 #define EP93XX_SYSCON_SYSCFG_LCSN1	(1<<0)
 #define EP93XX_SYSCON_SWLOCK		EP93XX_SYSCON_REG(0xc0)
 
+#define EP93XX_WATCHDOG_PHYS_BASE	EP93XX_APB_PHYS(0x00140000)
 #define EP93XX_WATCHDOG_BASE		EP93XX_APB_IOMEM(0x00140000)

Shouldn't this last define be removed after you added the new PHYS_BASE ?

Kind regards,
Wim.

#2 lore raw

PATCH 1/1 ep93xx: Convert the watchdog driver into a platform device.

Quoted 10 lines · Wim Van Sebroeck
Quoted 10 lines

void ep93xx_restart(char mode, const char *cmd) diff --git
a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index c4a7b84..e9271a7 100644

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -0
@@ -224,6 +224,7 @@
 #define EP93XX_SYSCON_SYSCFG_LCSN1	(1<<0)
 #define EP93XX_SYSCON_SWLOCK		EP93XX_SYSCON_REG(0xc0)
 
Quoted 4 lines

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h line 228

Quoted 2 lines
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +1 -0
+#define EP93XX_WATCHDOG_PHYS_BASE	EP93XX_APB_PHYS(0x00140000)
 #define EP93XX_WATCHDOG_BASE		EP93XX_APB_IOMEM(0x00140000)

Shouldn't this last define be removed after you added the new PHYS_BASE ?

To make it easier on Ryan's other patches I left it for now.

After this patch and Ryan's others are applied I will go through the defines in the soc.h header and figure out which ones can be removed.

Thanks,
Hartley