Skip to contentSkip to conversation

PPC 44x Watchdog timer

PATCH In review Glenn Burkhardt 3 participants 15 messages Apr 19, 2005 – May 17, 2005 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

Is there a patch for the built in watchdog timer in the 440GP available anywhere for the 2.4 kernel (viz., ELDK kernels)?

I found a driver for the 2.6 kernel in the mailing list submitted by Takeharu KATO last February, and, if nothing else is available, plan to back fit it to the 2.4 kernel.

Thanks!

#1 lore raw

Hi

IIRC, MontaVistaLinux has this feature.
As far as I know, I found it in Monta Vista Linux 3 years ago at least. I've not checked resent kernel of Monta Vista Linux, so I am sorry if it is wrong now.

Quoted 3 lines · Glenn Burkhardt

Is there a patch for the built in watchdog timer in the 440GP available anywhere for the 2.4 kernel (viz., ELDK kernels)?

By the way, BOOKE_WDT patch has not been commited to up-stream kernel. Matt(or Kumar?), please apply the patch.

Regards,

#2 lore raw

After looking at the current BitKeeper 2.4 development tree on source.mvista.com, it looks like the use of the hardware watchdog timer was discontinued at some point in favor of using the general purpose timer. The watchdog exception interrupt isn't used, and it's only configurable for PPC405 (although I think that the technique would work for the whole 4xx family).

Or am I misreading the code?

It would also be nice if your patch were applied to the 2.6 kernel tree.

Quoted 15 lines · Takeharu KATO

Hi

IIRC, MontaVistaLinux has this feature.
As far as I know, I found it in Monta Vista Linux 3 years ago at least. I've not checked resent kernel of Monta Vista Linux, so I am sorry if it is wrong now.

Quoted 2 lines · Glenn Burkhardt

Is there a patch for the built in watchdog timer in the 440GP available anywhere for the 2.4 kernel (viz., ELDK kernels)?

By the way, BOOKE_WDT patch has not been commited to up-stream kernel. Matt(or Kumar?), please apply the patch.

Regards,

#3 lore raw

Hi

Quoted 4 lines · Glenn Burkhardt

watchdog exception interrupt isn't used, and it's only configurable for PPC405 (although I think that the technique would work for the whole 4xx family).

Or am I misreading the code?

No, the kernel which I mentioned before is MontaVistaLinux. IIRC, I look the WDT relevant codes in MontaVistaLinux2.X few years ago. Of course, It was prepared for PowerPC40X...

Quoted 2 lines

It would also be nice if your patch were applied to the 2.6 kernel tree.

Sorry, It's not my jurisdiction.
Matt(Porter) or Kumar(Gala) may be responsible for this work. #Finally, the patch should be approved by akpm and linus, of course...

Matt or Kumar, would you merge BOOKE_WDT patch to 2.6 kernel tree? IIRC, This patch has been left under review state about two month. Is there something to be needed for the patch?

#4 lore raw
Quoted 19 lines · Takeharu KATO

Hi

Quoted 1 line · Glenn Burkhardt

watchdog exception interrupt isn't used, and it's only configurable

for

Quoted 1 line

PPC405 (although I think that the technique would work for the whole

4xx

Quoted 4 lines

family).

Or am I misreading the code?

No, the kernel which I mentioned before is MontaVistaLinux. IIRC, I look the WDT relevant codes in MontaVistaLinux2.X few years ago. Of course, It was prepared for PowerPC40X...

Quoted 1 line

It would also be nice if your patch were applied to the 2.6 kernel

tree.

Quoted 1 line
Quoted 7 lines

Sorry, It's not my jurisdiction.
Matt(Porter) or Kumar(Gala) may be responsible for this work.
#Finally, the patch should be approved by akpm and linus, of course...

Matt or Kumar, would you merge BOOKE_WDT patch to 2.6 kernel tree?
IIRC, This patch has been left under review state about two month. Is there something to be needed for the patch?

Sorry, I think Matt and I have been busy with normal "work". I'll take a look at this in the next week. If you can update the patches to something current that would help (but is not critical).

thanks
- kumar

#5 lore raw

Hi Kumar:

Quoted 4 lines

Sorry, I think Matt and I have been busy with normal "work". I'll take a look at this in the next week. If you can update the patches to something current that would help (but is not critical).

Thank you for your response.
OK,I'll tweaks minor changes for current kernel in linus's git kernel.

#6 lore raw

PATCH 1/1 BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

In reply to Kumar Gala

Hi Kumar:

Quoted 3 lines

Sorry, I think Matt and I have been busy with normal "work". I'll take a look at this in the next week. If you can update the patches to something current that would help (but is not critical).

I updated the patch to current linus-git kernel(pulled in 2005/05/05 JST). Please use this for your testing.

This is architecture dependent part.
I'll re-test this patch in the next week.

Signed-off-by [email protected]
arch/ppc/kernel/head_44x.S +4 -1
diff -Nupr linux-2.6.orig/arch/ppc/kernel/head_44x.S linux-2.6/arch/ppc/kernel/head_44x.S
@@ -448,8 +448,11 @@ interrupt_base:
 	EXCEPTION(0x1010, FixedIntervalTimer, UnknownException, EXC_XFER_EE)
 
 	/* Watchdog Timer Interrupt */
-	/* TODO: Add watchdog support */
+#if defined(CONFIG_BOOKE_WDT)
+	CRITICAL_EXCEPTION(0x1020, WatchdogTimer, booke_wdt_exception)
+#else
 	CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException)
+#endif  /*  CONFIG_BOOKE_WDT  */
 
 	/* Data TLB Error Interrupt */
 	START_EXCEPTION(DataTLBError)
arch/ppc/kernel/head_4xx.S +27 -10
diff -Nupr linux-2.6.orig/arch/ppc/kernel/head_4xx.S linux-2.6/arch/ppc/kernel/head_4xx.S
@@ -430,27 +430,24 @@ label:
 
 /* 0x1000 - Programmable Interval Timer (PIT) Exception */
 	START_EXCEPTION(0x1000, Decrementer)
-	NORMAL_EXCEPTION_PROLOG
-	lis	r0,TSR_PIS@h
-	mtspr	SPRN_TSR,r0		/* Clear the PIT exception */
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_LITE(0x1000, timer_interrupt)
+	b    DecrementerHandler
 
 #if 0
 /* NOTE:
- * FIT and WDT handlers are not implemented yet.
+ * FIT handler is not implemented yet.
  */
 
 /* 0x1010 - Fixed Interval Timer (FIT) Exception
 */
 	STND_EXCEPTION(0x1010,	FITException,		UnknownException)
 
-/* 0x1020 - Watchdog Timer (WDT) Exception
-*/
-
-	CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException)
 #endif
 
+/* 0x1020 - Watchdog Timer (WDT) Exception
+ */
+	START_EXCEPTION(0x1020, WDTException)
+	b    WatchDogHandler
+
 /* 0x1100 - Data TLB Miss Exception
  * As the name implies, translation is not in the MMU, so search the
  * page tables and fix it.  The only purpose of this function is to
@@ -732,6 +729,13 @@ label:
 		(MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
 		NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
 
+DecrementerHandler:
+	NORMAL_EXCEPTION_PROLOG
+	lis    r0,TSR_PIS@h
+	mtspr    SPRN_TSR,r0        /* Clear the PIT exception */
+	addi    r3,r1,STACK_FRAME_OVERHEAD
+	EXC_XFER_LITE(0x1000, timer_interrupt)
+
 /*
  * The other Data TLB exceptions bail out to this point
  * if they can't resolve the lightweight TLB fault.
@@ -804,6 +808,19 @@ finish_tlb_load:
 	PPC405_ERR77_SYNC
 	rfi			/* Should sync shadow TLBs */
 	b	.		/* prevent prefetch past rfi */
+/*
+ * WatchDog Exception
+ */
+WatchDogHandler:
+	CRITICAL_EXCEPTION_PROLOG;
+	addi    r3,r1,STACK_FRAME_OVERHEAD;
+#if defined(CONFIG_BOOKE_WDT)
+	EXC_XFER_TEMPLATE(booke_wdt_exception, 0x1022, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)),NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
+
+#else
+	EXC_XFER_TEMPLATE(UnknownException, 0x1022, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)),NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
+#endif  /*  CONFIG_BOOKE_WDT  */
+
 
 /* extern void giveup_fpu(struct task_struct *prev)
  *
arch/ppc/kernel/head_fsl_booke.S +5 -2
diff -Nupr linux-2.6.orig/arch/ppc/kernel/head_fsl_booke.S linux-2.6/arch/ppc/kernel/head_fsl_booke.S
@@ -526,8 +526,11 @@ interrupt_base:
 	EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE)
 
 	/* Watchdog Timer Interrupt */
-	/* TODO: Add watchdog support */
-	CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException)
+#if defined(CONFIG_BOOKE_WDT)
+	CRITICAL_EXCEPTION(0x3200, WatchdogTimer, booke_wdt_exception)
+#else
+ 	CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException)
+#endif  /*  CONFIG_BOOKE_WDT  */
 
 	/* Data TLB Error Interrupt */
 	START_EXCEPTION(DataTLBError)
arch/ppc/platforms/85xx/mpc8540_ads.c +8 -0
diff -Nupr linux-2.6.orig/arch/ppc/platforms/85xx/mpc8540_ads.c linux-2.6/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -187,6 +187,14 @@ platform_init(unsigned long r3, unsigned
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
 
+#ifdef CONFIG_BOOKE_WDT
+	{
+	  extern void booke_wdt_setup_options(char *cmd_line);
+
+	  booke_wdt_setup_options(cmd_line);
+	}
+#endif  /*  CONFIG_BOOKE_WDT  */
+
 	identify_ppc_sys_by_id(mfspr(SPRN_SVR));
 
 	/* setup the PowerPC module struct */
arch/ppc/platforms/85xx/mpc8560_ads.c +8 -0
diff -Nupr linux-2.6.orig/arch/ppc/platforms/85xx/mpc8560_ads.c linux-2.6/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -183,6 +183,14 @@ platform_init(unsigned long r3, unsigned
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
 
+#ifdef CONFIG_BOOKE_WDT
+      {
+        extern void booke_wdt_setup_options(char *cmd_line);
+
+        booke_wdt_setup_options(cmd_line);
+      }
+#endif  /*  CONFIG_BOOKE_WDT  */
+
 	identify_ppc_sys_by_id(mfspr(SPRN_SVR));
 
 	/* setup the PowerPC module struct */
arch/ppc/platforms/85xx/mpc85xx_cds_common.c renamed from arch/ppc/platforms/85xx/mpc85xx_cds_common.c 2005-05-06 05:03:57.000000000 +0900 +8 -0
diff -Nupr linux-2.6.orig/arch/ppc/platforms/85xx/mpc85xx_cds_common.c linux-2.6/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -432,6 +432,14 @@ platform_init(unsigned long r3, unsigned
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
 
+#ifdef CONFIG_BOOKE_WDT
+      {
+        extern void booke_wdt_setup_options(char *cmd_line);
+
+        booke_wdt_setup_options(cmd_line);
+      }
+#endif  /*  CONFIG_BOOKE_WDT  */
+
 	identify_ppc_sys_by_id(mfspr(SPRN_SVR));
 
 	/* setup the PowerPC module struct */
arch/ppc/platforms/85xx/sbc8560.c +8 -0
diff -Nupr linux-2.6.orig/arch/ppc/platforms/85xx/sbc8560.c linux-2.6/arch/ppc/platforms/85xx/sbc8560.c
@@ -198,6 +198,14 @@ platform_init(unsigned long r3, unsigned
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
 
+#ifdef CONFIG_BOOKE_WDT
+     {
+       extern void booke_wdt_setup_options(char *cmd_line);
+
+       booke_wdt_setup_options(cmd_line);
+     }
+#endif  /*  CONFIG_BOOKE_WDT  */
+
 	identify_ppc_sys_by_id(mfspr(SPRN_SVR));
 
 	/* setup the PowerPC module struct */
arch/ppc/platforms/85xx/stx_gp3.c +8 -0
diff -Nupr linux-2.6.orig/arch/ppc/platforms/85xx/stx_gp3.c linux-2.6/arch/ppc/platforms/85xx/stx_gp3.c
@@ -331,6 +331,14 @@ platform_init(unsigned long r3, unsigned
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
 
+#ifdef CONFIG_BOOKE_WDT
+      {
+        extern void booke_wdt_setup_options(char *cmd_line);
+
+        booke_wdt_setup_options(cmd_line);
+      }
+#endif  /*  CONFIG_BOOKE_WDT  */
+
 	identify_ppc_sys_by_id(mfspr(SPRN_SVR));
 
 	/* setup the PowerPC module struct */
arch/ppc/syslib/ppc4xx_setup.c +8 -20
diff -Nupr linux-2.6.orig/arch/ppc/syslib/ppc4xx_setup.c linux-2.6/arch/ppc/syslib/ppc4xx_setup.c
@@ -48,10 +48,6 @@
 extern void abort(void);
 extern void ppc4xx_find_bridges(void);
 
-extern void ppc4xx_wdt_heartbeat(void);
-extern int wdt_enable;
-extern unsigned long wdt_period;
-
 /* Global Variables */
 bd_t __res;
 
@@ -257,22 +253,14 @@ ppc4xx_init(unsigned long r3, unsigned l
 		*(char *) (r7 + KERNELBASE) = 0;
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
-#if defined(CONFIG_PPC405_WDT)
-/* Look for wdt= option on command line */
-	if (strstr(cmd_line, "wdt=")) {
-		int valid_wdt = 0;
-		char *p, *q;
-		for (q = cmd_line; (p = strstr(q, "wdt=")) != 0;) {
-			q = p + 4;
-			if (p > cmd_line && p[-1] != ' ')
-				continue;
-			wdt_period = simple_strtoul(q, &q, 0);
-			valid_wdt = 1;
-			++q;
-		}
-		wdt_enable = valid_wdt;
-	}
-#endif
+
+#ifdef CONFIG_BOOKE_WDT
+     {
+       extern void booke_wdt_setup_options(char *cmd_line);
+
+       booke_wdt_setup_options(cmd_line);
+     }
+#endif  /*  CONFIG_BOOKE_WDT  */
 
 	/* Initialize machine-dependent vectors */
#7 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Quoted 5 lines

diff -Nupr linux-2.6.orig/arch/ppc/kernel/head_4xx.S
linux-2.6/arch/ppc/kernel/head_4xx.S
--- linux-2.6.orig/arch/ppc/kernel/head_4xx.S=A0=A0 2005-05-06 05:03:55.000000000 +0900
+++ linux-2.6/arch/ppc/kernel/head_4xx.S=A0=A0=A0=A0=A0=A0=A0 =

2005-05-07=20

Quoted 3 lines

05:03:24.000000000 +0900
@@ -430,27 +430,24 @@ label:

Any reason you moved this code into DecrementerHandler?

Quoted 5 lines

=A0 /* 0x1000 - Programmable Interval Timer (PIT) Exception */
=A0 =A0=A0=A0=A0=A0 START_EXCEPTION(0x1000, Decrementer) -=A0=A0=A0=A0=A0=A0 NORMAL_EXCEPTION_PROLOG
-=A0=A0=A0=A0=A0=A0 lis=A0=A0=A0=A0 r0,TSR_PIS@h -=A0=A0=A0=A0=A0=A0 mtspr=A0=A0 SPRN_TSR,r0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 /* Clear the PIT exception */

Quoted 10 lines

-=A0=A0=A0=A0=A0=A0 addi=A0=A0=A0 r3,r1,STACK_FRAME_OVERHEAD
-=A0=A0=A0=A0=A0=A0 EXC_XFER_LITE(0x1000, timer_interrupt) +=A0=A0=A0=A0=A0=A0 b=A0=A0=A0 DecrementerHandler

=A0 #if 0
=A0 /* NOTE:
- * FIT and WDT handlers are not implemented yet.
+ * FIT handler is not implemented yet. =A0=A0 */

Quoted 3 lines

=A0 /* 0x1010 - Fixed Interval Timer (FIT) Exception
=A0 */
=A0 =A0=A0=A0=A0=A0 STND_EXCEPTION(0x1010,=A0 FITException,=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0=20

Quoted 6 lines

UnknownException)

-/* 0x1020 - Watchdog Timer (WDT) Exception
-*/
-
-=A0=A0=A0=A0=A0=A0 CRITICAL_EXCEPTION(0x1020, WDTException, =

UnknownException)

Review

Quoted 9 lines

=A0 #endif

(quoted diff) +3 -0
+/* 0x1020 - Watchdog Timer (WDT) Exception
 + */
 +=A0=A0=A0=A0=A0=A0 START_EXCEPTION(0x1020, WDTException)
+=A0=A0=A0=A0=A0=A0 b=A0=A0=A0 WatchDogHandler
+
 =A0 /* 0x1100 - Data TLB Miss Exception
 =A0=A0 * As the name implies, translation is not in the MMU, so =

search the

Quoted 1 line

=A0=A0 * page tables and fix it.=A0 The only purpose of this function =

is to

Quoted 2 lines

@@ -732,6 +729,13 @@ label:
=A0 =A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 (MSR_KERNEL & =

~(MSR_ME|MSR_DE|MSR_CE)), \

Quoted 1 line

=A0 =A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 NOCOPY, =

crit_transfer_to_handler, ret_from_crit_exc)

Quoted 5 lines

+DecrementerHandler:

+=A0=A0=A0=A0=A0=A0 NORMAL_EXCEPTION_PROLOG
+=A0=A0=A0=A0=A0=A0 lis=A0=A0=A0 r0,TSR_PIS@h
+=A0=A0=A0=A0=A0=A0 mtspr=A0=A0=A0 SPRN_TSR,r0=A0=A0=A0=A0=A0=A0=A0 /* =

Clear the PIT exception */

Quoted 9 lines
 +=A0=A0=A0=A0=A0=A0 addi=A0=A0=A0 r3,r1,STACK_FRAME_OVERHEAD
+=A0=A0=A0=A0=A0=A0 EXC_XFER_LITE(0x1000, timer_interrupt)

+
=A0 /*
=A0=A0 * The other Data TLB exceptions bail out to this point =A0=A0 * if they can't resolve the lightweight TLB fault.
@@ -804,6 +808,19 @@ finish_tlb_load:
=A0 =A0=A0=A0=A0=A0 PPC405_ERR77_SYNC
=A0 =A0=A0=A0=A0=A0 rfi=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 /* Should sync shadow TLBs */

Quoted 1 line

=A0 =A0=A0=A0=A0=A0 b=A0=A0=A0=A0=A0=A0 .=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=

=A0=A0=A0 /* prevent prefetch past rfi */

Quoted 8 lines

+/*
+ * WatchDog Exception
+ */
+WatchDogHandler:

+=A0=A0=A0=A0=A0=A0 CRITICAL_EXCEPTION_PROLOG;
+=A0=A0=A0=A0=A0=A0 addi=A0=A0=A0 r3,r1,STACK_FRAME_OVERHEAD;

+#if defined(CONFIG_BOOKE_WDT)
+=A0=A0=A0=A0=A0=A0 EXC_XFER_TEMPLATE(booke_wdt_exception, 0x1022, =

(MSR_KERNEL &

Quoted 5 lines

~(MSR_ME|MSR_DE|MSR_CE)),NOCOPY, crit_transfer_to_handler,
ret_from_crit_exc)
+
+#else
+=A0=A0=A0=A0=A0=A0 EXC_XFER_TEMPLATE(UnknownException, 0x1022, =

(MSR_KERNEL &

Quoted 7 lines

~(MSR_ME|MSR_DE|MSR_CE)),NOCOPY, crit_transfer_to_handler,
ret_from_crit_exc)
+#endif=A0 /*=A0 CONFIG_BOOKE_WDT=A0 */
+

=A0 /* extern void giveup_fpu(struct task_struct *prev)
=A0=A0 *

#8 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Hi Kumar:

I'm sorry that the reply becomes slow.

Quoted 13 lines · Kumar Gala
Quoted 1 line

Any reason you moved this code into DecrementerHandler?

Quoted 9 lines

/* 0x1000 - Programmable Interval Timer (PIT) Exception */

         START_EXCEPTION(0x1000, Decrementer)

- NORMAL_EXCEPTION_PROLOG

arch/ppc/kernel/head_4xx.S +1 -3
-       lis     r0,TSR_PIS@h
-       mtspr   SPRN_TSR,r0             /* Clear the PIT exception */
 -       addi    r3,r1,STACK_FRAME_OVERHEAD
-       EXC_XFER_LITE(0x1000, timer_interrupt)
+       b    DecrementerHandler

Current PIT exception handler is too big.
If it is not moved, compilation is failed with relocation error.
Because current PIT handler overwrites WDT handler's codes, the compiler can not relocate PIT and WDT handler correctly.

#9 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

No problem, can you replace all the cmd line parsing with early_param()=20=

code in arch/ppc/kernel/setup.c. Take a look at=20 arch/ppc64/kernel/setup.c for an example. We still need to add a call=20=

to parse_early_param() in setup_arch().

Matt & I need to talk about the driver patch. Once I have more=20 feedback on that I'll let you know. The major issue I have is having=20 the interrupt handler in drivers/char/watchdog/.. instead of=20 arch/ppc/kernel/traps.c. However, I dont have a good idea how to=20 structure the changes.

- kumar

Quoted 14 lines · Takeharu KATO

Hi Kumar:

I'm sorry that the reply becomes slow.

Quoted 9 lines · Kumar Gala
Quoted 1 line

Any reason you moved this code into DecrementerHandler?

Quoted 5 lines

=A0=A0 /* 0x1000 - Programmable Interval Timer (PIT) Exception */ =A0=A0=A0=A0=A0=A0=A0=A0=A0 START_EXCEPTION(0x1000, Decrementer) =A0 -=A0=A0=A0=A0=A0=A0 NORMAL_EXCEPTION_PROLOG -=A0=A0=A0=A0=A0=A0 lis=A0=A0=A0=A0 r0,TSR_PIS@h -=A0=A0=A0=A0=A0=A0 mtspr=A0=A0 SPRN_TSR,r0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0 /* Clear the PIT exception=20

Quoted 10 lines

*/

Quoted 4 lines
Quoted 4 lines

=A0 -=A0=A0=A0=A0=A0=A0 addi=A0=A0=A0 r3,r1,STACK_FRAME_OVERHEAD -=A0=A0=A0=A0=A0=A0 EXC_XFER_LITE(0x1000, timer_interrupt) +=A0=A0=A0=A0=A0=A0 b=A0=A0=A0 DecrementerHandler

Current PIT exception handler is too big.
If it is not moved, compilation is failed with relocation error. Because current PIT handler overwrites WDT handler's codes, the=20
compiler
can not relocate PIT and WDT handler correctly.

#10 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Hi Kumar:

Quoted 2 lines · Kumar Gala

No problem, can you replace all the cmd line parsing with early_param() code in arch/ppc/kernel/setup.c. Take a look at arch/ppc64/kernel/setup.c for an example. We still need to add a call to parse_early_param() in setup_arch().

Sorry, I can not figure out what you want.
As far as I look the source tree,arch/ppc/kernel/setup.c does not have the function called early_param. Would you give me a more precise explanation?

Quoted 2 lines

Matt & I need to talk about the driver patch. Once I have more feedback on that I'll let you know. The major issue I have is having the interrupt handler in drivers/char/watchdog/.. instead of arch/ppc/kernel/traps.c. However, I dont have a good idea how to structure the changes.

Certainly, moving the interrupt handler from drivers/char/watchdog/booke_wdt.c to arch/ppc/kernel/traps.c is easy, but I can not tell whether it is good or not.

But the handler is not used by the core kernel. From this point of view, the handler should not be placed in arch/ppc/kernel/traps.c. This is the reason why I locate the exception handler in the driver part.

Anyway, I'll try to move this handler into arch/ppc/kernel/traps.c for the moment.

#11 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Hi Kumar:

Quoted 6 lines
Quoted 2 lines

No problem, can you replace all the cmd line parsing with early_param() code in arch/ppc/kernel/setup.c. Take a look at arch/ppc64/kernel/setup.c for an example. We still need to add a call to parse_early_param() in setup_arch().

Sorry, I can not figure out what you want.
As far as I look the source tree,arch/ppc/kernel/setup.c does not have the function called early_param. Would you give me a more precise explanation?

On second thought, I make sense what you said.
You asked me that I make some kind of cleanups, didn't you? If it is true, I'll try to clean up these setups, but it may be take the time.

#12 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Quoted 11 lines · Takeharu KATO

Hi Kumar:

Quoted 3 lines
Quoted 3 lines

No problem, can you replace all the cmd line parsing with early_param() code in arch/ppc/kernel/setup.c.=A0 Take a look at arch/ppc64/kernel/setup.c for an example.=A0 We still need to add a=20=

call

Quoted 4 lines
Quoted 2 lines

to parse_early_param() in setup_arch().

Sorry, I can not figure out what you want.
As far as I look the source tree,arch/ppc/kernel/setup.c does not=20

Quoted 8 lines

have

Quoted 3 lines

the function called early_param.
Would you give me a more precise explanation?

On second thought, I make sense what you said.
You asked me that I make some kind of cleanups, didn't you?
If it is true, I'll try to clean up these setups, but it may be take the time.

Yes, I think with these changes to us early_param() for command line=20 parsing in a single place will make the first patch look good.

I'm still not sure what suggestions I have for the second patch, I was=20=

more just letting you know my thinking about the fact that it concerned=20=

me that the exception handler code was not in arch/ppc/kernel. Not to=20=

say this is wrong, it just doesn't feel write.

- kumar

#13 lore raw

Re: [PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Hi Kumar:

Quoted 3 lines

Yes, I think with these changes to us early_param() for command line parsing in a single place will make the first patch look good.

OK, I'll perform this fix in this week.

Quoted 2 lines

I'm still not sure what suggestions I have for the second patch, I was more just letting you know my thinking about the fact that it concerned me that the exception handler code was not in arch/ppc/kernel. Not to say this is wrong, it just doesn't feel write.

Hum, I agree this thing, I'll move the WDT exception handler to arch/ppc/kernel for the moment. If someone disagree with this decision in the future, I'll move this into driver code again.

#14 lore raw

PATCH 1/1 BOOKE_WDT Part 2/2 (Re: PPC 44x Watchdog timer)

In reply to Kumar Gala

Hi Kumar:

Quoted 5 lines

Sorry, I think Matt and I have been busy with normal "work". I'll take a look at this in the next week. If you can update the patches to something current that would help (but is not critical).

This is device driver part.

Signed-off-by [email protected]
drivers/char/watchdog/Kconfig +7 -0
diff -Nupr linux-2.6.orig/drivers/char/watchdog/Kconfig linux-2.6/drivers/char/watchdog/Kconfig
@@ -346,6 +346,13 @@ config 8xx_WDT
 	tristate "MPC8xx Watchdog Timer"
 	depends on WATCHDOG && 8xx
 
+config BOOKE_WDT
+    bool "Book E(PowerPC 4xx/e500) Watchdog Timer"
+    depends on WATCHDOG && ( 4xx || E500 )
+    ---help---
+      This is the driver for the watchdog timers on
+      PowerPC 4xx and PowerPC e500.
+
 # MIPS Architecture
 
 config INDYDOG
drivers/char/watchdog/Makefile +1 -0
diff -Nupr linux-2.6.orig/drivers/char/watchdog/Makefile linux-2.6/drivers/char/watchdog/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.
 obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
 obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
 
 # Only one watchdog can succeed. We probe the hardware watchdog
 # drivers first, then the softdog driver.  This means if your hardware
drivers/char/watchdog/booke_wdt.c +629 -0

629 lines not on this page · raw message

drivers/char/watchdog/booke_wdt.h +110 -0

110 lines not on this page · raw message