Skip to contentSkip to conversation

ARM: ep93xx: Disable TS-72xx watchdog before uncompressing

PATCH RESEND Applied Florian Fainelli 5 participants 5 messages Feb 2, 2017 – Feb 13, 2017

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

PATCH RESEND 1/1 ARM: ep93xx: Disable TS-72xx watchdog before uncompressing

The TS-72xx/73xx boards have a CPLD watchdog which is configured to reset the board after 8 seconds, if the kernel is large enough that this takes about this time to decompress the kernel, we will encounter a spurious reboot.

Do not pull ts72xx.h, but instead locally define what we need to disable the watchdog.

---
Arnd, this is a recent, so you can queue this up, thanks!

 arch/arm/mach-ep93xx/include/mach/uncompress.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/mach-ep93xx/include/mach/uncompress.h +12 -0
index 03c42e5400d2..b0cf2de77f81 100644
@@ -10,6 +10,7 @@
  */
 
 #include <mach/ep93xx-regs.h>
+#include <asm/mach-types.h>
 
 static unsigned char __raw_readb(unsigned int ptr)
 {
@@ -75,8 +76,19 @@ static void ethernet_reset(void)
 		;
 }
 
+#define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
+#define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
+#define TS72XX_WDT_FEED_VAL		0x05
+
+static void __maybe_unused ts72xx_watchdog_disable(void)
+{
+	__raw_writeb(TS72XX_WDT_FEED_VAL, TS72XX_WDT_FEED_PHYS_BASE);
+	__raw_writeb(0, TS72XX_WDT_CONTROL_PHYS_BASE);
+}
 
 static void arch_decomp_setup(void)
 {
+	if (machine_is_ts72xx())
+		ts72xx_watchdog_disable();
 	ethernet_reset();
 }
Signature · 1 line
2.9.3
Reviewed-by H Hartley Sweeten on v1 1/1
#1 lore raw
Quoted 11 lines · Florian Fainelli

The TS-72xx/73xx boards have a CPLD watchdog which is configured to reset the board after 8 seconds, if the kernel is large enough that this takes about this time to decompress the kernel, we will encounter a spurious reboot.

Do not pull ts72xx.h, but instead locally define what we need to disable the watchdog.

---
Arnd, this is a recent, so you can queue this up, thanks!

or Tested-by/Acked-by as appropriate...

Hartley

#2 lore raw
Quoted 9 lines · CET Hartley Sweeten
Quoted 8 lines · Florian Fainelli

The TS-72xx/73xx boards have a CPLD watchdog which is configured to reset the board after 8 seconds, if the kernel is large enough that this takes about this time to decompress the kernel, we will encounter a spurious reboot.

Do not pull ts72xx.h, but instead locally define what we need to disable the watchdog.

Quoted 8 lines
Quoted 3 lines

---
Arnd, this is a recent, so you can queue this up, thanks!

or Tested-by/Acked-by as appropriate...

Too bad, this really gets in the way of a future multiplatform ep93xx configuration as that doesn't easily allow us to have board specific hacks in the decompressor.

Applied to next/soc with Hartley's reviewed-by tag.

It's not clear from your description if this is needed for stable backports. If it is, please write to stable at vger.kernel.org once it is merged upstream.

Arnd

#3 lore raw
In reply to Florian Fainelli

Hi,

Quoted 4 lines · Florian Fainelli

The TS-72xx/73xx boards have a CPLD watchdog which is configured to reset the board after 8 seconds, if the kernel is large enough that this takes about this time to decompress the kernel, we will encounter a spurious reboot.

so once it reaches Kernel proper, that dog is being killed, right ?

iirc, TI AM335x's & AM43x's ROM code too leaves the on-chip watchdog enabled & the bootloader disables it (else once it boots to prompt, it reboots always unless watchdog driver [if present] takes care of it), Lokesh, right ?

But yes, that brings a bootloader dependency.

Regards
afzal

#4 lore raw
Quoted 8 lines · Afzal Mohammed

Hi,

Quoted 4 lines · Florian Fainelli

The TS-72xx/73xx boards have a CPLD watchdog which is configured to reset the board after 8 seconds, if the kernel is large enough that this takes about this time to decompress the kernel, we will encounter a spurious reboot.

Quoted 6 lines

so once it reaches Kernel proper, that dog is being killed, right ?

iirc, TI AM335x's & AM43x's ROM code too leaves the on-chip watchdog enabled & the bootloader disables it (else once it boots to prompt, it reboots always unless watchdog driver [if present] takes care of it), Lokesh, right ?

Yes, that's right. Watchdog is disabled in U-Boot.

Thanks and regards,
Lokesh