From dade0a6a89cfcaf7b0bbe991b3194f2e4913c51c Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Wed, 15 Jul 2009 12:09:34 +0200 Subject: [PATCH] --- yaml --- r: 162837 b: refs/heads/master c: d47fbb5996269f3081deb7a1b4ba717557256555 h: refs/heads/master i: 162835: da7d5bdb696f80475848f6dd90fd44fb7a0e03b5 v: v3 --- [refs] | 2 +- trunk/arch/mips/ar7/platform.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 56a169448a68..1f354d63fed4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6f4c7b32e156ac67ae170554cfba0929272c7adf +refs/heads/master: d47fbb5996269f3081deb7a1b4ba717557256555 diff --git a/trunk/arch/mips/ar7/platform.c b/trunk/arch/mips/ar7/platform.c index cf50fa29b198..e2278c04459d 100644 --- a/trunk/arch/mips/ar7/platform.c +++ b/trunk/arch/mips/ar7/platform.c @@ -417,6 +417,20 @@ static struct platform_device ar7_udc = { .num_resources = ARRAY_SIZE(usb_res), }; +static struct resource ar7_wdt_res = { + .name = "regs", + .start = -1, /* Filled at runtime */ + .end = -1, /* Filled at runtime */ + .flags = IORESOURCE_MEM, +}; + +static struct platform_device ar7_wdt = { + .id = -1, + .name = "ar7_wdt", + .resource = &ar7_wdt_res, + .num_resources = 1, +}; + static inline unsigned char char2hex(char h) { switch (h) { @@ -487,6 +501,7 @@ static void __init detect_leds(void) static int __init ar7_register_devices(void) { + u16 chip_id; int res; #ifdef CONFIG_SERIAL_8250 static struct uart_port uart_port[2]; @@ -565,6 +580,23 @@ static int __init ar7_register_devices(void) res = platform_device_register(&ar7_udc); + chip_id = ar7_chip_id(); + switch (chip_id) { + case AR7_CHIP_7100: + case AR7_CHIP_7200: + ar7_wdt_res.start = AR7_REGS_WDT; + break; + case AR7_CHIP_7300: + ar7_wdt_res.start = UR8_REGS_WDT; + break; + default: + break; + } + + ar7_wdt_res.end = ar7_wdt_res.start + 0x20; + + res = platform_device_register(&ar7_wdt); + return res; } arch_initcall(ar7_register_devices);