diff mbox

[v3,05/16] Davinci: watchdog reset separation across socs

Message ID 1271270702-28307-6-git-send-email-cyril@ti.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Cyril Chemparathy April 14, 2010, 6:44 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index ce26015..448a0a9 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -119,8 +119,6 @@  int davinci_clk_init(struct clk_lookup *clocks);
 int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
 				unsigned int mult, unsigned int postdiv);
 
-extern struct platform_device davinci_wdt_device;
-
 #endif
 
 #endif
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 0a96791..67a6fbc 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -326,7 +326,7 @@  static struct resource da8xx_watchdog_resources[] = {
 	},
 };
 
-struct platform_device davinci_wdt_device = {
+struct platform_device da8xx_wdt_device = {
 	.name		= "watchdog",
 	.id		= -1,
 	.num_resources	= ARRAY_SIZE(da8xx_watchdog_resources),
@@ -335,7 +335,7 @@  struct platform_device davinci_wdt_device = {
 
 int __init da8xx_register_watchdog(void)
 {
-	return platform_device_register(&davinci_wdt_device);
+	return platform_device_register(&da8xx_wdt_device);
 }
 
 static struct resource da8xx_emac_resources[] = {
diff --git a/arch/arm/mach-davinci/include/mach/system.h b/arch/arm/mach-davinci/include/mach/system.h
index 5a7d758..90be3f6 100644
--- a/arch/arm/mach-davinci/include/mach/system.h
+++ b/arch/arm/mach-davinci/include/mach/system.h
@@ -11,7 +11,13 @@ 
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-extern void davinci_watchdog_reset(void);
+#include <linux/platform_device.h>
+#include <mach/cputype.h>
+
+extern struct platform_device davinci_wdt_device;
+extern struct platform_device da8xx_wdt_device;
+
+extern void davinci_watchdog_reset(struct platform_device *);
 
 static inline void arch_idle(void)
 {
@@ -20,7 +26,11 @@  static inline void arch_idle(void)
 
 static inline void arch_reset(char mode, const char *cmd)
 {
-	davinci_watchdog_reset();
+	if (cpu_class_is_dmx())
+		davinci_watchdog_reset(&davinci_wdt_device);
+
+	if (cpu_class_is_da8xx())
+		davinci_watchdog_reset(&da8xx_wdt_device);
 }
 
 #endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index b21f763..6a762be 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -399,10 +399,9 @@  struct sys_timer davinci_timer = {
 
 
 /* reset board using watchdog timer */
-void davinci_watchdog_reset(void)
+void davinci_watchdog_reset(struct platform_device *pdev)
 {
 	u32 tgcr, wdtcr;
-	struct platform_device *pdev = &davinci_wdt_device;
 	void __iomem *base = IO_ADDRESS(pdev->resource[0].start);
 	struct clk *wd_clk;