Skip to contentSkip to conversation

mpc83xx watchdog

U-Boot-Users David Updegraff 3 participants 4 messages Nov 9, 2006

lore
Share & tools
lore
#1 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

Watchdog could work with this.

Maybe. But I have to reject the patch because of coding style problems. Please indent by TABs.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Accident: A condition in which presence of mind is good, but  absence
of body is better.
#2 lore raw
In reply to David Updegraff
Quoted 3 lines · David Updegraff

Hi.

Watchdog could work with this.

A patch that does something similar is already in Freescale's 83xx tree that is waiting for Wolfgang to pull.

Here's the relevant bit:

@@ -150,9 +213,21 @@ unsigned long get_tbclk(void)
#if defined(CONFIG_WATCHDOG)
void watchdog_reset (void)
{
- hang(); /* FIXME: implement watchdog_reset()? */
+#ifdef CONFIG_MPC834X
+ int re_enable = disable_interrupts();
+
+ /* Reset the 83xx watchdog */
+ volatile immap_t *immr = (immap_t *) CFG_IMMRBAR;
+ immr->wdt.swsrr = 0x556c;
+ immr->wdt.swsrr = 0xaa39;
+
+ if (re_enable)
+ enable_interrupts ();
+#else
+ hang();
+#endif
}
-#endif /* CONFIG_WATCHDOG */
+#endif

We don't have any changes for start.S, though. Also, our tree renames CFG_IMMRBAR to CFG_IMMR.

I'm going to NACK your patch, simply because it's incompatible with ours. I'm willing to work with you to fix that, though, if you like.

Signature · 2 lines
Timur Tabi
Linux Kernel Developer @ Freescale
#3 lore raw

Timur

Good to hear you already have one; fine by me.

But.. I dont know how it can work w/o the tweek to start.S, since by my reading of the PPC 603 asm.ref., the existing instruction there will not accept full 16bit value. Did you have another workaround for it?

Quoted 39 lines
Quoted 3 lines · David Updegraff

Hi.

Watchdog could work with this.

A patch that does something similar is already in Freescale's 83xx tree that is waiting for Wolfgang to pull.

Here's the relevant bit:

(quoted diff) +14 -2
@@ -150,9 +213,21 @@ unsigned long get_tbclk(void)
 #if defined(CONFIG_WATCHDOG)
 void watchdog_reset (void)
 {
-    hang();        /* FIXME: implement watchdog_reset()? */
+#ifdef CONFIG_MPC834X
+    int re_enable = disable_interrupts();
+
+    /* Reset the 83xx watchdog */
+    volatile immap_t *immr = (immap_t *) CFG_IMMRBAR;
+    immr->wdt.swsrr = 0x556c;
+    immr->wdt.swsrr = 0xaa39;
+
+    if (re_enable)
+        enable_interrupts ();
+#else
+    hang();
+#endif
 }
-#endif /* CONFIG_WATCHDOG */
+#endif
 
 

We don't have any changes for start.S, though. Also, our tree renames CFG_IMMRBAR to CFG_IMMR.

I'm going to NACK your patch, simply because it's incompatible with ours. I'm willing to work with you to fix that, though, if you like.