public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mx27: 16-bit wide watchdog registers
@ 2016-03-20 13:10 Leonid Iziumtsev
  2016-03-20 23:28 ` Fabio Estevam
  2016-03-25 13:03 ` Stefano Babic
  0 siblings, 2 replies; 3+ messages in thread
From: Leonid Iziumtsev @ 2016-03-20 13:10 UTC (permalink / raw)
  To: u-boot

From: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>

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

Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>
---
 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(-)

diff --git a/arch/arm/cpu/arm926ejs/mx27/reset.c b/arch/arm/cpu/arm926ejs/mx27/reset.c
index f7b4a1c..e764986 100644
--- a/arch/arm/cpu/arm926ejs/mx27/reset.c
+++ b/arch/arm/cpu/arm926ejs/mx27/reset.c
@@ -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*/
diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h b/arch/arm/include/asm/arch-mx27/imx-regs.h
index baf1d29..40b76d2 100644
--- a/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -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 */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] mx27: 16-bit wide watchdog registers
  2016-03-20 13:10 [U-Boot] [PATCH] mx27: 16-bit wide watchdog registers Leonid Iziumtsev
@ 2016-03-20 23:28 ` Fabio Estevam
  2016-03-25 13:03 ` Stefano Babic
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2016-03-20 23:28 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 20, 2016 at 10:10 AM, Leonid Iziumtsev
<leonid.iziumtsev@gmail.com> wrote:
> From: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>
>
> Make the watchdog registers 16-bit wide, as they are according to TRM.
>
> Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] mx27: 16-bit wide watchdog registers
  2016-03-20 13:10 [U-Boot] [PATCH] mx27: 16-bit wide watchdog registers Leonid Iziumtsev
  2016-03-20 23:28 ` Fabio Estevam
@ 2016-03-25 13:03 ` Stefano Babic
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2016-03-25 13:03 UTC (permalink / raw)
  To: u-boot

On 20/03/2016 14:10, Leonid Iziumtsev wrote:
> From: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>
> 
> Make the watchdog registers 16-bit wide, as they are according to TRM.
> 
> Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>
> ---
>  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(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx27/reset.c b/arch/arm/cpu/arm926ejs/mx27/reset.c
> index f7b4a1c..e764986 100644
> --- a/arch/arm/cpu/arm926ejs/mx27/reset.c
> +++ b/arch/arm/cpu/arm926ejs/mx27/reset.c
> @@ -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*/
> diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h b/arch/arm/include/asm/arch-mx27/imx-regs.h
> index baf1d29..40b76d2 100644
> --- a/arch/arm/include/asm/arch-mx27/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
> @@ -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 */
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-25 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-20 13:10 [U-Boot] [PATCH] mx27: 16-bit wide watchdog registers Leonid Iziumtsev
2016-03-20 23:28 ` Fabio Estevam
2016-03-25 13:03 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox