summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.24/ts72xx/ts72xx-use-cpld-reset.patch
blob: 9744a67653fbc19d11a811002fde79ce67e0bb73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

Use CPLD watchdog to reset the machine instead of buggy ep93xx one, which
sometimes get stuck...

Signed-off-by: Petr Stetiar <ynezz@true.cz>

Index: linux-2.6.22/include/asm-arm/arch-ep93xx/system.h
===================================================================
--- linux-2.6.22.orig/include/asm-arm/arch-ep93xx/system.h	2007-08-30 00:53:47.000000000 +0200
+++ linux-2.6.22/include/asm-arm/arch-ep93xx/system.h	2007-08-30 00:54:28.000000000 +0200
@@ -3,6 +3,7 @@
  */
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 
 static inline void arch_idle(void)
 {
@@ -15,11 +16,17 @@
 
 	local_irq_disable();
 
-	devicecfg = __raw_readl(EP93XX_SYSCON_DEVICE_CONFIG);
-	__raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
-	__raw_writel(devicecfg | 0x80000000, EP93XX_SYSCON_DEVICE_CONFIG);
-	__raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
-	__raw_writel(devicecfg & ~0x80000000, EP93XX_SYSCON_DEVICE_CONFIG);
+	if (machine_is_ts72xx()) {
+		__raw_writeb(0x5, TS72XX_WATCHDOG_FEED_PHYS_BASE);
+		__raw_writeb(0x1, TS72XX_WATCHDOG_CONTROL_PHYS_BASE);
+	} else {
+		devicecfg = __raw_readl(EP93XX_SYSCON_DEVICE_CONFIG);
+		__raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
+		__raw_writel(devicecfg | 0x80000000, EP93XX_SYSCON_DEVICE_CONFIG);
+		__raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
+		__raw_writel(devicecfg & ~0x80000000, EP93XX_SYSCON_DEVICE_CONFIG);
+	}
+
 
 	while (1)
 		;