aboutsummaryrefslogtreecommitdiffstats
path: root/package/broadcom-diag/src
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-01-02 16:22:20 +0000
committerFlorian Fainelli <florian@openwrt.org>2010-01-02 16:22:20 +0000
commit36ba2a3a37c6c3b12b8ab59b631eb563639c477b (patch)
tree04ef0f2ad1bac1f423460fea6d2742e858af0144 /package/broadcom-diag/src
parent44b5f493e2c66f5569cb1cc45bdde858ceaa19fe (diff)
downloadupstream-36ba2a3a37c6c3b12b8ab59b631eb563639c477b.tar.gz
upstream-36ba2a3a37c6c3b12b8ab59b631eb563639c477b.tar.bz2
upstream-36ba2a3a37c6c3b12b8ab59b631eb563639c477b.zip
[package] add western digital netcenter support to broadcom-diag (#6124)
original patch from Christoph Muellner git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19008 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-diag/src')
-rw-r--r--package/broadcom-diag/src/diag.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c
index ec1870f83d..fefd036c72 100644
--- a/package/broadcom-diag/src/diag.c
+++ b/package/broadcom-diag/src/diag.c
@@ -133,6 +133,9 @@ enum {
/* Sitecom */
WL105B,
+ /* Western Digital */
+ WDNetCenter,
+
/* Askey */
RT210W,
};
@@ -151,6 +154,21 @@ static void __init bcm4780_init(void) {
schedule_timeout(HZ * 5);
}
+static void __init NetCenter_init(void) {
+ /* unset pin 6 (+12V) */
+ int pin = 1 << 6;
+ gpio_outen(pin, pin);
+ gpio_control(pin, 0);
+ gpio_out(pin, pin);
+ /* unset pin 1 (turn off red led, blue will light alone if +5V comes up) */
+ pin = 1 << 1;
+ gpio_outen(pin, pin);
+ gpio_control(pin, 0);
+ gpio_out(pin, pin);
+ /* unset pin 3 (+5V) and wait 5 seconds (harddisk spin up) */
+ bcm4780_init();
+}
+
static void __init bcm57xx_init(void) {
int pin = 1 << 2;
@@ -810,6 +828,15 @@ static struct platform_t __initdata platforms[] = {
{ .name = "power", .gpio = 1 << 3},
},
},
+ /* Western Digital Net Center */
+ [WDNetCenter] = {
+ .name = "Western Digital NetCenter",
+ .buttons = {
+ { .name = "power", .gpio = 1 << 0},
+ { .name = "reset", .gpio = 1 << 7},
+ },
+ .platform_init = NetCenter_init,
+ },
/* Askey (and clones) */
[RT210W] = {
.name = "Askey RT210W",
@@ -965,6 +992,10 @@ static struct platform_t __init *platform_detect(void)
!strcmp(getvar("boardflags"), "0x750")) /* D-Link DIR-320 */
return &platforms[DIR320];
+ if (!strncmp(boardnum, "TH",2) && !strcmp(boardtype,"0x042f")) {
+ return &platforms[WDNetCenter];
+ }
+
} else { /* PMON based - old stuff */
if ((simple_strtoul(getvar("GemtekPmonVer"), NULL, 0) == 9) &&
(simple_strtoul(getvar("et0phyaddr"), NULL, 0) == 30)) {