mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Fix register offsets and width for the WDT on i.MX27
Date: Fri, 30 Jul 2010 13:57:52 +0200	[thread overview]
Message-ID: <201007301357.52645.jbe@pengutronix.de> (raw)

If one uses the WDT in a correct manner like in a fixed reset_cpu() function
the system will end up in an endless data abort:

barebox:/ reset
data abort
pc : [<a7f1edec>]    lr : [<a7f13d04>]
sp : a6effe9c  ip : 00000005  fp : 00000000
r10: a6f5c3b0  r9 : 00000000  r8 : 00000000
r7 : 00000000  r6 : 00000001  r5 : a7f2a6e8  r4 : a6f5c490
r3 : 00005555  r2 : 10002000  r1 : 00000001  r0 : 00000000
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

data abort
pc : [<a7f1edec>]    lr : [<a7f13d04>]
sp : a6effe9c  ip : 00000005  fp : 00000000
r10: a6f5c3b0  r9 : 00000000  r8 : 00000000
r7 : 00000000  r6 : 00000001  r5 : a7f2a6e8  r4 : a6f5c490
r3 : 00005555  r2 : 10002000  r1 : 00000001  r0 : 00000000
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...
[...]

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

---
diff --git a/arch/arm/mach-imx/include/mach/imx27-regs.h b/arch/arm/mach-imx/include/mach/imx27-regs.h
index 8d0bcda..f4354ba 100644
--- a/arch/arm/mach-imx/include/mach/imx27-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx27-regs.h
@@ -83,9 +83,9 @@
 #include "esdctl.h"
 
 /* Watchdog Registers*/
-#define WCR  __REG(IMX_WDT_BASE + 0x00) /* Watchdog Control Register */
-#define WSR  __REG(IMX_WDT_BASE + 0x04) /* Watchdog Service Register */
-#define WSTR __REG(IMX_WDT_BASE + 0x08) /* Watchdog Status Register  */
+#define WCR  __REG16(IMX_WDT_BASE + 0x00) /* Watchdog Control Register */
+#define WSR  __REG16(IMX_WDT_BASE + 0x02) /* Watchdog Service Register */
+#define WSTR __REG16(IMX_WDT_BASE + 0x04) /* Watchdog Status Register  */
 
 /* important definition of some bits of WCR */
 #define WCR_WDE 0x04

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2010-07-30 11:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201007301357.52645.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox