Hi!
This mail includes a patch for diag.c (broadcom-diag) to spin-up the
harddisk of a WD NetCenter.
I've already sent this patch in January[1] this year and got some
improvement tips from Florian Fainelli, but accidentally sent the
corrected patch to Florian directly and not this list. Here is another try.
It would be nice if this patch would be accepted.
Regards Christoph
[1]
http://lists.openwrt.org/pipermail/openwrt-devel/2008-January/001566.html
Signed-off-by: Christoph Müllner <[EMAIL PROTECTED]>
Index: package/broadcom-diag/src/diag.c
===================================================================
--- package/broadcom-diag/src/diag.c (Revision 10931)
+++ package/broadcom-diag/src/diag.c (Arbeitskopie)
@@ -122,6 +122,9 @@
/* Sitecom */
WL105B,
+
+ /* Western Digital */
+ NETCENTER,
};
static void __init bcm4780_init(void) {
@@ -138,6 +141,21 @@
schedule_timeout(HZ * 5);
}
+static void __init netcenter_init(void) {
+ /* unset GPIO 6 (+12V) */
+ int pin = 1 << 6;
+ gpio_outen(pin, pin);
+ gpio_control(pin, 0);
+ gpio_out(pin, pin);
+ /* unset GPIO 1 (turn off red led, blue led will light when +5V comes up */
+ pin = 1 << 1;
+ gpio_outen(pin, pin);
+ gpio_control(pin, 0);
+ gpio_out(pin, pin);
+ /* unset GPIO 3 (+5V) and wait 5 seconds (harddisk spin up) */
+ bcm4780_init();
+}
+
static void __init bcm57xx_init(void) {
int pin = 1 << 2;
@@ -658,6 +676,14 @@
{ .name = "power", .gpio = 1 << 3},
},
},
+ [NETCENTER] = {
+ .name = "Western Digital NetCenter",
+ .buttons = {
+ { .name = "power", .gpio = 1 << 0},
+ { .name = "reset", .gpio = 1 << 7},
+ },
+ .platform_init = netcenter_init,
+ },
};
static struct platform_t __init *platform_detect(void)
@@ -756,6 +782,11 @@
if (!strcmp(boardnum, "10496"))
return &platforms[USR5461];
+ if (!strncmp(boardnum, "TH", 2)) {
+ if (!strcmp(boardtype, "0x042f"))
+ return &platforms[NETCENTER];
+ }
+
} else { /* PMON based - old stuff */
if ((simple_strtoul(getvar("GemtekPmonVer"), NULL, 0) == 9) &&
(simple_strtoul(getvar("et0phyaddr"), NULL, 0) == 30)) {
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel