Skip to contentSkip to conversation

mx27: 16-bit wide watchdog registers

PATCH New Leonid Iziumtsev 3 participants 3 messages Mar 20, 2016 – Mar 25, 2016

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

PATCH 1/1 mx27: 16-bit wide watchdog registers

From: Leonid Iziumtsev <[email protected]>

Make the watchdog registers 16-bit wide, as they are according to TRM.

---
 arch/arm/cpu/arm926ejs/mx27/reset.c       | 8 ++++----
 arch/arm/include/asm/arch-mx27/imx-regs.h | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/cpu/arm926ejs/mx27/reset.c +4 -4
index f7b4a1c..e764986 100644
@@ -27,14 +27,14 @@ void reset_cpu(ulong ignored)
 {
 	struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
 	/* Disable watchdog and set Time-Out field to 0 */
-	writel(0x00000000, &regs->wcr);
+	writew(0x0000, &regs->wcr);
 
 	/* Write Service Sequence */
-	writel(0x00005555, &regs->wsr);
-	writel(0x0000AAAA, &regs->wsr);
+	writew(0x5555, &regs->wsr);
+	writew(0xAAAA, &regs->wsr);
 
 	/* Enable watchdog */
-	writel(WCR_WDE, &regs->wcr);
+	writew(WCR_WDE, &regs->wcr);
 
 	while (1);
 	/*NOTREACHED*/
arch/arm/include/asm/arch-mx27/imx-regs.h +3 -3
index baf1d29..40b76d2 100644
@@ -106,9 +106,9 @@ struct esdramc_regs {
 
 /* Watchdog Registers*/
 struct wdog_regs {
-	u32 wcr;
-	u32 wsr;
-	u32 wstr;
+	u16 wcr;
+	u16 wsr;
+	u16 wstr;
 };
 
 /* PLL registers */
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/1 mx27: 16-bit wide watchdog registers

In reply to Leonid Iziumtsev
Quoted 41 lines · Leonid Iziumtsev

From: Leonid Iziumtsev <[email protected]>

Make the watchdog registers 16-bit wide, as they are according to TRM.

---
 arch/arm/cpu/arm926ejs/mx27/reset.c       | 8 ++++----
 arch/arm/include/asm/arch-mx27/imx-regs.h | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/cpu/arm926ejs/mx27/reset.c +4 -4
index f7b4a1c..e764986 100644
@@ -27,14 +27,14 @@ void reset_cpu(ulong ignored)
 {
 	struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
 	/* Disable watchdog and set Time-Out field to 0 */
-	writel(0x00000000, &regs->wcr);
+	writew(0x0000, &regs->wcr);
 
 	/* Write Service Sequence */
-	writel(0x00005555, &regs->wsr);
-	writel(0x0000AAAA, &regs->wsr);
+	writew(0x5555, &regs->wsr);
+	writew(0xAAAA, &regs->wsr);
 
 	/* Enable watchdog */
-	writel(WCR_WDE, &regs->wcr);
+	writew(WCR_WDE, &regs->wcr);
 
 	while (1);
 	/*NOTREACHED*/
arch/arm/include/asm/arch-mx27/imx-regs.h +0 -0
index baf1d29..40b76d2 100644
@@ -106,9 +106,9 @@ struct esdramc_regs {
 
 /* Watchdog Registers*/

arch/arm/include/asm/arch-mx27/imx-regs.h struct esdramc_regs { · line 114

Quoted 10 lines
arch/arm/include/asm/arch-mx27/imx-regs.h +3 -3
 struct wdog_regs {
-	u32 wcr;
-	u32 wsr;
-	u32 wstr;
+	u16 wcr;
+	u16 wsr;
+	u16 wstr;
 };
 
 /* PLL registers */

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================