Skip to contentSkip to conversation

mpc8xx watchdog timer (2.4.23-pre7)

PATCH New Andreas Oberritter 1 participant 1 message Oct 10, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc8xx watchdog timer (2.4.23-pre7)

Hi Marcelo,

the attached patch adds support for the internal watchdog of the mpc8xx series of CPUs. It has been tested on the D-Box2 board which requires this patch because the watchdog timer is enabled by its boot loader and can not be disabled after being started. It should work on other 8xx boards as well without modifications. Please apply.

Regards,
Andreas Oberritter

arch/ppc/kernel/Makefile +3 -0
diff -Naur linux-2.4.23-pre7.orig/arch/ppc/kernel/Makefile linux-2.4.23-pre7/arch/ppc/kernel/Makefile
@@ -64,6 +64,9 @@
 obj-$(CONFIG_PPC4xx_DMA)	+= ppc4xx_dma.o
 obj-$(CONFIG_PPC4xx_EDMA)	+= ppc4xx_sgdma.o
 obj-$(CONFIG_8xx)		+= m8xx_setup.o ppc8xx_pic.o
+ifdef CONFIG_8xx_WDT
+obj-y				+= m8xx_wdt.o
+endif
 ifeq ($(CONFIG_8xx),y)
 obj-$(CONFIG_PCI)		+= qspan_pci.o
 ifndef CONFIG_MATH_EMULATION
arch/ppc/kernel/m8xx_setup.c +8 -0
diff -Naur linux-2.4.23-pre7.orig/arch/ppc/kernel/m8xx_setup.c linux-2.4.23-pre7/arch/ppc/kernel/m8xx_setup.c
@@ -58,6 +58,7 @@
 
 extern unsigned long find_available_memory(void);
 extern void m8xx_cpm_reset(uint);
+extern void m8xx_wdt_handler_install(bd_t *bp);
 
 void __init
 m8xx_setup_arch(void)
@@ -184,6 +185,13 @@
 	if (request_irq(DEC_INTERRUPT, timebase_interrupt, 0, "tbint",
 				NULL) != 0)
 		panic("Could not allocate timer IRQ!");
+
+#ifdef CONFIG_8xx_WDT
+	/* Install watchdog timer handler early because it might be
+	 * already enabled by the bootloader
+	 */
+	m8xx_wdt_handler_install(binfo);
+#endif
 }
 
 /* The RTC on the MPC8xx is an internal register.
arch/ppc/kernel/m8xx_wdt.c +103 -0

103 lines not on this page · raw message

arch/ppc/kernel/ppc_ksyms.c +6 -0
diff -Naur linux-2.4.23-pre7.orig/arch/ppc/kernel/ppc_ksyms.c linux-2.4.23-pre7/arch/ppc/kernel/ppc_ksyms.c
@@ -357,6 +357,12 @@
 EXPORT_SYMBOL(cpm_free_handler);
 EXPORT_SYMBOL(m8xx_cpm_hostalloc);
 EXPORT_SYMBOL(m8xx_cpm_dpalloc);
+#ifdef CONFIG_8xx_WDT
+extern int m8xx_wdt_get_timeout(void);
+extern void m8xx_wdt_reset(void);
+EXPORT_SYMBOL(m8xx_wdt_get_timeout);
+EXPORT_SYMBOL(m8xx_wdt_reset);
+#endif /* CONFIG_8xx_WDT */
 #endif /* CONFIG_8xx */
 
 /* Those should really be inline */
drivers/char/Config.in +3 -0
diff -Naur linux-2.4.23-pre7.orig/drivers/char/Config.in linux-2.4.23-pre7/drivers/char/Config.in
@@ -257,6 +257,9 @@
    fi
    tristate '  ZF MachZ Watchdog' CONFIG_MACHZ_WDT
    dep_tristate '  AMD 766/768 TCO Timer/Watchdog' CONFIG_AMD7XX_TCO $CONFIG_EXPERIMENTAL
+   if [ "$CONFIG_8xx" = "y" ]; then
+      tristate '  MPC8xx Watchdog Timer' CONFIG_8xx_WDT
+   fi
 fi
 endmenu
 
drivers/char/Makefile +1 -0
diff -Naur linux-2.4.23-pre7.orig/drivers/char/Makefile linux-2.4.23-pre7/drivers/char/Makefile
@@ -305,6 +305,7 @@
 obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
 obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o
+obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
 
 subdir-$(CONFIG_MWAVE) += mwave
 ifeq ($(CONFIG_MWAVE),y)
drivers/char/mpc8xx_wdt.c +183 -0

183 lines not on this page · raw message