Skip to contentSkip to conversation

x530: Enable watchdog

PATCH Superseded Chris Packham 1 participant 3 messages Feb 15, 2019

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover x530: Enable watchdog

We've seen some issues with the x530 under extreme conditions where the DDR gets into a bad state. Generally this results in an application crash followed by a lock-up in u-boot.

Enabling the watchdog prevents the lock up and will let the DDR training have another go. Sometimes this recovers but even a reboot loop is better than a complete lockup.

Changes in v2:
- update commit message

Chris Packham (2):
watchdog: orion_wdt: support SPL usage
arm: mvebu: x530: Enable watchdog in SPL and U-Boot

 arch/arm/dts/armada-385-atl-x530-u-boot.dtsi |  4 ++
 board/alliedtelesis/x530/x530.c              | 48 ++++++++++++++++++++
 configs/x530_defconfig                       |  5 ++
 drivers/watchdog/orion_wdt.c                 |  4 +-
 4 files changed, 58 insertions(+), 3 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/2 watchdog: orion_wdt: support SPL usage

When run from the SPL the mvebu targets are using the hardware default offset for the SoC peripherals. devfdt_get_addr_size_index() understands how to deal with this via dm_get_translation_offset() so use this instead of fdtdec_get_addr_size_auto_noparent().

---

Changes in v2: None

 drivers/watchdog/orion_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/orion_wdt.c +1 -3
index a0df02d10382..c1add3e7c121 100644
@@ -114,9 +114,7 @@ static inline bool save_reg_from_ofdata(struct udevice *dev, int index,
 	fdt_addr_t addr;
 	fdt_size_t off;
 
-	addr = fdtdec_get_addr_size_auto_noparent(
-		gd->fdt_blob, dev_of_offset(dev), "reg", index, &off, true);
-
+	addr = devfdt_get_addr_size_index(dev, index, &off);
 	if (addr == FDT_ADDR_T_NONE)
 		return false;
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 2/2 arm: mvebu: x530: Enable watchdog in SPL and U-Boot

In reply to Chris Packham

Enable the hardware watchdog to guard against system lock ups when running in the SPL or U-Boot. Stop the watchdog just before booting so that the OS can re-enable it if needed.

---

Changes in v2:
- update commit message

 arch/arm/dts/armada-385-atl-x530-u-boot.dtsi |  4 ++
 board/alliedtelesis/x530/x530.c              | 48 ++++++++++++++++++++
 configs/x530_defconfig                       |  5 ++
 3 files changed, 57 insertions(+)
arch/arm/dts/armada-385-atl-x530-u-boot.dtsi +4 -0
index 7074a73537fa..79b694cb84bc 100644
@@ -11,3 +11,7 @@
 &uart0 {
 	u-boot,dm-pre-reloc;
 };
+
+&watchdog {
+	u-boot,dm-pre-reloc;
+};
board/alliedtelesis/x530/x530.c +48 -0

81 lines not on this page · raw message

configs/x530_defconfig +5 -0
index 25b9e885d8e6..3bc37b9bee11 100644
@@ -19,6 +19,8 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SILENT_U_BOOT_ONLY=y
 CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC=y
 CONFIG_MISC_INIT_R=y
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -70,3 +72,6 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_ASIX88179=y
+CONFIG_WATCHDOG=y
+CONFIG_WDT=y
+CONFIG_WDT_ORION=y
Signature · 1 line
2.20.1