Skip to contentSkip to conversation

armv8: ls1028a: configure PMU's PCTBENR to enable WDT

PATCH New Qiang Zhao 1 participant 2 messages Aug 8, 2019

Subsystems (2)
lore
Share & tools
lore

Qiang Zhao

author
#0 lore raw

PATCH 1/2 armv8: ls1028a: configure PMU's PCTBENR to enable WDT

From: Thomas Schaefer <[email protected]>

The SP805-WDT module on LS1028A requires configuration of PMU's PCTBENR register to enable watchdog counter decrement and reset signal generation. The watchdog clock needs to be enabled first.

---
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +4 -2
index b8fa736..3e2a24f 100644
@@ -1147,7 +1147,8 @@ int timer_init(void)
 #ifdef CONFIG_FSL_LSCH3
 	u32 __iomem *cltbenr = (u32 *)CONFIG_SYS_FSL_PMU_CLTBENR;
 #endif
-#if defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
+#if defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A) || \
+	defined(CONFIG_ARCH_LS1028A)
 	u32 __iomem *pctbenr = (u32 *)FSL_PMU_PCTBENR_OFFSET;
 	u32 svr_dev_id;
 #endif
@@ -1166,7 +1167,8 @@ int timer_init(void)
 	out_le32(cltbenr, 0xf);
 #endif
 
-#if defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
+#if defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A) || \
+	defined(CONFIG_ARCH_LS1028A)
 	/*
 	 * In certain Layerscape SoCs, the clock for each core's
 	 * has an enable bit in the PMU Physical Core Time Base Enable
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 watchdog: sp805_wdt: add expire_now method

From: Thomas Schaefer <[email protected]>

expire_now method is required by U_BOOT_DRIVER. Add sp805_wdt_expire_now function.

---
 drivers/watchdog/sp805_wdt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/watchdog/sp805_wdt.c +9 -1
index 9661282..f1e781e 100644
@@ -87,9 +87,16 @@ static int sp805_wdt_stop(struct udevice *dev)
 	return 0;
 }
 
+static int sp805_wdt_expire_now(struct udevice *dev, ulong flags)
+{
+	sp805_wdt_start(dev, 0, flags);
+
+	return 0;
+}
+
 static int sp805_wdt_probe(struct udevice *dev)
 {
-	debug("%s: Probing wdt%u\n", __func__, dev->seq);
+	debug("%s: Probing wdt%u (sp805-wdt)\n", __func__, dev->seq);
 
 	return 0;
 }
@@ -109,6 +116,7 @@ static const struct wdt_ops sp805_wdt_ops = {
 	.start = sp805_wdt_start,
 	.reset = sp805_wdt_reset,
 	.stop = sp805_wdt_stop,
+	.expire_now = sp805_wdt_expire_now,
 };
 
 static const struct udevice_id sp805_wdt_ids[] = {
Signature · 1 line
2.7.4