Skip to contentSkip to conversation

aspeed: clear all asserting watchdog conditions

PATCH In review Christopher Bostic 2 participants 2 messages Sep 27, 2017 – Sep 28, 2017

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

PATCH 1/1 aspeed: clear all asserting watchdog conditions

Clear out all flagged watchdog conditions to allow the following kernel load to complete successfully. This will allow the kernel to determine the next boot side instead of leaving it to u-boot. This method of side switching has been suggested by Milton Miller and Adirana Kobylak.

---
 arch/arm/mach-aspeed/reset.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-aspeed/reset.c +6 -0
index 1a44b3a..7d88d99 100644
@@ -9,6 +9,12 @@
 
 void reset_cpu(ulong addr)
 {
+	/* Clear out all flagged watchdog events */
+	__raw_writel(0x1, AST_WDT1_BASE+0x14);
+	__raw_writel(0x1, AST_WDT2_BASE+0x14);
+	__raw_writel(0x1, AST_WDT3_BASE+0x14);
+	__raw_writel(__raw_readl(AST_SCU_BASE+0x3C) & 0x03, AST_SCU_BASE+0x3C);
+
 	__raw_writel(0x10 , AST_WDT1_BASE+0x04);
 	__raw_writel(0x4755, AST_WDT1_BASE+0x08);
 	__raw_writel(0x3, AST_WDT1_BASE+0x0c);
Signature · 1 line
1.8.2.2
#1 lore raw
Quoted 5 lines · Christopher Bostic

Clear out all flagged watchdog conditions to allow the following kernel load to complete successfully. This will allow the kernel to determine the next boot side instead of leaving it to u-boot. This method of side switching has been suggested by Milton Miller and Adirana Kobylak.

I'm not immediately sure what the SCU3C write is about, but we can't do the others in u-boot as we need to continue to access the secondary flash during u-boot.

I was suggesting we clear the watchdog alt-boot overrides when we start the linux kernel so that the kernel chip selects match the hardware, while allowing the alternate u-boot to continue to read from the chip its started out of.

I'll work more urgently on drafting a more detailed proposal.

Quoted 29 lines

---
arch/arm/mach-aspeed/reset.c | 6 ++++++

1 file changed, 6 insertions(+)
arch/arm/mach-aspeed/reset.c +6 -0
index 1a44b3a..7d88d99 100644
@@ -9,6 +9,12 @@
 
 void reset_cpu(ulong addr)
 {
+	/* Clear out all flagged watchdog events */
+	__raw_writel(0x1, AST_WDT1_BASE+0x14);
+	__raw_writel(0x1, AST_WDT2_BASE+0x14);
+	__raw_writel(0x1, AST_WDT3_BASE+0x14);
+	__raw_writel(__raw_readl(AST_SCU_BASE+0x3C) & 0x03,
 AST_SCU_BASE+0x3C);
+
 	__raw_writel(0x10 , AST_WDT1_BASE+0x04);
 	__raw_writel(0x4755, AST_WDT1_BASE+0x08);
	__raw_writel(0x3, AST_WDT1_BASE+0x0c);
Signature · 1 line
1.8.2.2