diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-02-12 15:43:14 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-02-12 15:43:14 +0000 |
commit | fd74a50df75b6f1288f217e45046032a379e4221 (patch) | |
tree | 771237c2d0ed60e5179e55a6899910551a9d48fd | |
parent | a287c60a61bbad21af22523ca50281850dd1e2c1 (diff) | |
download | mtk-20170518-fd74a50df75b6f1288f217e45046032a379e4221.zip mtk-20170518-fd74a50df75b6f1288f217e45046032a379e4221.tar.gz mtk-20170518-fd74a50df75b6f1288f217e45046032a379e4221.tar.bz2 |
broadcom-diag: fix WRT150N/WRT160N detection (patch from #10836)
SVN-Revision: 30477
-rw-r--r-- | package/broadcom-diag/src/diag.c | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c index e60b66c..4ac271e 100644 --- a/package/broadcom-diag/src/diag.c +++ b/package/broadcom-diag/src/diag.c @@ -53,7 +53,10 @@ enum { WRTSL54GS, WRT54G3G, WRT54G3GV2_VF, - WRT160N, + WRT150NV1, + WRT150NV11, + WRT160NV1, + WRT160NV3, WRT300NV11, WRT350N, WRT600N, @@ -283,8 +286,32 @@ static struct platform_t __initdata platforms[] = { { .name = "3g_blue", .gpio = 1 << 3, .polarity = NORMAL }, }, }, - [WRT160N] = { - .name = "Linksys WRT160N", + [WRT150NV1] = { + .name = "Linksys WRT150N V1", + .buttons = { + { .name = "reset", .gpio = 1 << 6 }, + { .name = "ses", .gpio = 1 << 4 }, + }, + .leds = { + { .name = "power", .gpio = 1 << 1, .polarity = NORMAL }, + { .name = "ses_green", .gpio = 1 << 5, .polarity = REVERSE }, + { .name = "ses_amber", .gpio = 1 << 3, .polarity = REVERSE }, + }, + }, + [WRT150NV11] = { + .name = "Linksys WRT150N V1.1", + .buttons = { + { .name = "reset", .gpio = 1 << 6 }, + { .name = "ses", .gpio = 1 << 4 }, + }, + .leds = { + { .name = "power", .gpio = 1 << 1, .polarity = NORMAL }, + { .name = "ses_green", .gpio = 1 << 5, .polarity = REVERSE }, + { .name = "ses_amber", .gpio = 1 << 3, .polarity = REVERSE }, + }, + }, + [WRT160NV1] = { + .name = "Linksys WRT160N v1.x", .buttons = { { .name = "reset", .gpio = 1 << 6 }, { .name = "ses", .gpio = 1 << 4 }, @@ -295,6 +322,18 @@ static struct platform_t __initdata platforms[] = { { .name = "ses_orange", .gpio = 1 << 3, .polarity = REVERSE }, }, }, + [WRT160NV3] = { + .name = "Linksys WRT160N V3", + .buttons = { + { .name = "reset", .gpio = 1 << 6 }, + { .name = "ses", .gpio = 1 << 5 }, + }, + .leds = { + { .name = "power", .gpio = 1 << 1, .polarity = NORMAL }, + { .name = "ses_blue", .gpio = 1 << 4, .polarity = REVERSE }, + { .name = "ses_orange", .gpio = 1 << 2, .polarity = REVERSE }, + }, + }, [WRT300NV11] = { .name = "Linksys WRT300N V1.1", .buttons = { @@ -1102,8 +1141,18 @@ static struct platform_t __init *platform_detect(void) if (!strcmp(getvar("et1phyaddr"),"5") && !strcmp(getvar("et1mdcport"), "1")) return &platforms[WRTSL54GS]; - if (!strcmp(boardtype, "0x0472")) - return &platforms[WRT160N]; + if (!strcmp(boardtype, "0x0472")) { + if(!strcmp(getvar("boot_hw_model"), "WRT150N")) + if(!strcmp(getvar("boot_hw_ver"), "1")) + return &platforms[WRT150NV1]; + else if(!strcmp(getvar("boot_hw_ver"), "1.1")) + return &platforms[WRT150NV11]; + else if(!strcmp(getvar("boot_hw_model"), "WRT160N")) + if(!strcmp(getvar("boot_hw_ver"), "1.0")) + return &platforms[WRT160NV1]; + else if(!strcmp(getvar("boot_hw_ver"), "3.0")) + return &platforms[WRT160NV3]; + } /* default to WRT54G */ return &platforms[WRT54G]; |