Commit 72838a17 authored by Florian Fainelli's avatar Florian Fainelli Committed by Ralf Baechle

MIPS: AR7: register watchdog device only if enabled in hw configuration

This patch checks if the watchdog enable bit is set in the DCL register
meaning that the hardware watchdog actually works and if so, register the
ar7_wdt platform_device.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 2cfac7f7
...@@ -503,6 +503,7 @@ static int __init ar7_register_devices(void) ...@@ -503,6 +503,7 @@ static int __init ar7_register_devices(void)
{ {
u16 chip_id; u16 chip_id;
int res; int res;
u32 *bootcr, val;
#ifdef CONFIG_SERIAL_8250 #ifdef CONFIG_SERIAL_8250
static struct uart_port uart_port[2]; static struct uart_port uart_port[2];
...@@ -595,6 +596,12 @@ static int __init ar7_register_devices(void) ...@@ -595,6 +596,12 @@ static int __init ar7_register_devices(void)
ar7_wdt_res.end = ar7_wdt_res.start + 0x20; ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
val = *bootcr;
iounmap(bootcr);
/* Register watchdog only if enabled in hardware */
if (val & AR7_WDT_HW_ENA)
res = platform_device_register(&ar7_wdt); res = platform_device_register(&ar7_wdt);
return res; return res;
......
...@@ -78,6 +78,9 @@ ...@@ -78,6 +78,9 @@
#define AR7_REF_CLOCK 25000000 #define AR7_REF_CLOCK 25000000
#define AR7_XTAL_CLOCK 24000000 #define AR7_XTAL_CLOCK 24000000
/* DCL */
#define AR7_WDT_HW_ENA 0x10
struct plat_cpmac_data { struct plat_cpmac_data {
int reset_bit; int reset_bit;
int power_bit; int power_bit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment