brcm47xx: change board detection for some Asus devices

This closes #13316

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 37680
This commit is contained in:
Hauke Mehrtens 2013-08-04 12:36:13 +00:00
parent 1d3067892b
commit 2fcaba306e
3 changed files with 34 additions and 22 deletions

View file

@ -1201,15 +1201,6 @@ static struct platform_t __init *platform_detect_legacy(void)
return &platforms[TM2300V2]; /* Dell TrueMobile 2300 v2 */ return &platforms[TM2300V2]; /* Dell TrueMobile 2300 v2 */
} }
if (!strcmp(boardnum, "45")) { /* ASUS */
if (!strcmp(boardtype,"0x0472"))
return &platforms[WL500W];
else if (!strcmp(boardtype,"0x467"))
return &platforms[WL320GE];
else
return &platforms[WL500GD];
}
if (!strcmp(boardnum, "10496")) if (!strcmp(boardnum, "10496"))
return &platforms[USR5461]; return &platforms[USR5461];
@ -1249,15 +1240,6 @@ static struct platform_t __init *platform_detect_legacy(void)
else else
return &platforms[WL500G]; return &platforms[WL500G];
} }
if (startswith(getvar("hardware_version"), "WL300-")) {
/* Either WL-300g or WL-HDD, do more extensive checks */
if ((simple_strtoul(getvar("et0phyaddr"), NULL, 0) == 0) &&
(simple_strtoul(getvar("et1phyaddr"), NULL, 0) == 1))
return &platforms[WLHDD];
if ((simple_strtoul(getvar("et0phyaddr"), NULL, 0) == 0) &&
(simple_strtoul(getvar("et1phyaddr"), NULL, 0) == 10))
return &platforms[WL300G];
}
/* Sitecom WL-105b */ /* Sitecom WL-105b */
if (startswith(boardnum, "2") && simple_strtoul(getvar("GemtekPmonVer"), NULL, 0) == 1) if (startswith(boardnum, "2") && simple_strtoul(getvar("GemtekPmonVer"), NULL, 0) == 1)
return &platforms[WL105B]; return &platforms[WL105B];
@ -1329,18 +1311,28 @@ static struct platform_t __init *platform_detect(void)
return &platforms[RTN16]; return &platforms[RTN16];
case BCM47XX_BOARD_ASUS_RTN66U: case BCM47XX_BOARD_ASUS_RTN66U:
return &platforms[RTN66U]; return &platforms[RTN66U];
case BCM47XX_BOARD_ASUS_WL300G:
return &platforms[WL300G];
case BCM47XX_BOARD_ASUS_WL320GE:
return &platforms[WL320GE];
case BCM47XX_BOARD_ASUS_WL330GE: case BCM47XX_BOARD_ASUS_WL330GE:
return &platforms[WL330GE]; return &platforms[WL330GE];
case BCM47XX_BOARD_ASUS_WL500GD:
return &platforms[WL500GD];
case BCM47XX_BOARD_ASUS_WL500GPV1: case BCM47XX_BOARD_ASUS_WL500GPV1:
return &platforms[WL500GP]; return &platforms[WL500GP];
case BCM47XX_BOARD_ASUS_WL500GPV2: case BCM47XX_BOARD_ASUS_WL500GPV2:
return &platforms[WL500GPV2]; return &platforms[WL500GPV2];
case BCM47XX_BOARD_ASUS_WL500W:
return &platforms[WL500W];
case BCM47XX_BOARD_ASUS_WL520GC: case BCM47XX_BOARD_ASUS_WL520GC:
return &platforms[WL520GC]; return &platforms[WL520GC];
case BCM47XX_BOARD_ASUS_WL520GU: case BCM47XX_BOARD_ASUS_WL520GU:
return &platforms[WL520GU]; return &platforms[WL520GU];
case BCM47XX_BOARD_ASUS_WL700GE: case BCM47XX_BOARD_ASUS_WL700GE:
return &platforms[WL700GE]; return &platforms[WL700GE];
case BCM47XX_BOARD_ASUS_WLHDD:
return &platforms[WLHDD];
case BCM47XX_BOARD_BELKIN_F7D4301: case BCM47XX_BOARD_BELKIN_F7D4301:
return &platforms[BELKIN_F7D4301]; return &platforms[BELKIN_F7D4301];
case BCM47XX_BOARD_BUFFALO_WBR2_G54: case BCM47XX_BOARD_BUFFALO_WBR2_G54:

View file

@ -8,7 +8,7 @@
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
--- /dev/null --- /dev/null
+++ b/arch/mips/bcm47xx/board.c +++ b/arch/mips/bcm47xx/board.c
@@ -0,0 +1,235 @@ @@ -0,0 +1,240 @@
+#include <linux/export.h> +#include <linux/export.h>
+#include <linux/string.h> +#include <linux/string.h>
+#include <bcm47xx_board.h> +#include <bcm47xx_board.h>
@ -45,9 +45,12 @@
+ +
+static const struct bcm47xx_board_type_list bcm47xx_board_list_hardware_version[] = { +static const struct bcm47xx_board_type_list bcm47xx_board_list_hardware_version[] = {
+ {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-",}, + {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-",},
+ {{BCM47XX_BOARD_ASUS_WL320GE, "Asus WL320GE"}, "WL320G-",},
+ {{BCM47XX_BOARD_ASUS_WL330GE, "Asus WL330GE"}, "WL330GE-",}, + {{BCM47XX_BOARD_ASUS_WL330GE, "Asus WL330GE"}, "WL330GE-",},
+ {{BCM47XX_BOARD_ASUS_WL500GD, "Asus WL500GD"}, "WL500gd-",},
+ {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GP V1"}, "WL500gp-",}, + {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GP V1"}, "WL500gp-",},
+ {{BCM47XX_BOARD_ASUS_WL500GPV2, "Asus WL500GP V2"}, "WL500GPV2-",}, + {{BCM47XX_BOARD_ASUS_WL500GPV2, "Asus WL500GP V2"}, "WL500GPV2-",},
+ {{BCM47XX_BOARD_ASUS_WL500W, "Asus WL500W"}, "WL500gW-",},
+ {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-",}, + {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-",},
+ {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-",}, + {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-",},
+ {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301",}, + {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301",},
@ -67,6 +70,8 @@
+ {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16",}, + {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16",},
+ {{BCM47XX_BOARD_ASUS_RTN53, "Asus RT-N53"}, "RT-N53",}, + {{BCM47XX_BOARD_ASUS_RTN53, "Asus RT-N53"}, "RT-N53",},
+ {{BCM47XX_BOARD_ASUS_RTN66U, "Asus RT-N66U"}, "RT-N66U",}, + {{BCM47XX_BOARD_ASUS_RTN66U, "Asus RT-N66U"}, "RT-N66U",},
+ {{BCM47XX_BOARD_ASUS_WL300G, "Asus WL300G"}, "WL300g",},
+ {{BCM47XX_BOARD_ASUS_WLHDD, "Asus WLHDD"}, "WLHDD",},
+ { {0}, 0}, + { {0}, 0},
+}; +};
+ +
@ -246,7 +251,7 @@
+EXPORT_SYMBOL(bcm47xx_board_get_name); +EXPORT_SYMBOL(bcm47xx_board_get_name);
--- /dev/null --- /dev/null
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
@@ -0,0 +1,92 @@ @@ -0,0 +1,97 @@
+#ifndef __BCM47XX_BOARD_H +#ifndef __BCM47XX_BOARD_H
+#define __BCM47XX_BOARD_H +#define __BCM47XX_BOARD_H
+ +
@ -263,12 +268,17 @@
+ BCM47XX_BOARD_ASUS_RTN16, + BCM47XX_BOARD_ASUS_RTN16,
+ BCM47XX_BOARD_ASUS_RTN53, + BCM47XX_BOARD_ASUS_RTN53,
+ BCM47XX_BOARD_ASUS_RTN66U, + BCM47XX_BOARD_ASUS_RTN66U,
+ BCM47XX_BOARD_ASUS_WL300G,
+ BCM47XX_BOARD_ASUS_WL320GE,
+ BCM47XX_BOARD_ASUS_WL330GE, + BCM47XX_BOARD_ASUS_WL330GE,
+ BCM47XX_BOARD_ASUS_WL500GD,
+ BCM47XX_BOARD_ASUS_WL500GPV1, + BCM47XX_BOARD_ASUS_WL500GPV1,
+ BCM47XX_BOARD_ASUS_WL500GPV2, + BCM47XX_BOARD_ASUS_WL500GPV2,
+ BCM47XX_BOARD_ASUS_WL500W,
+ BCM47XX_BOARD_ASUS_WL520GC, + BCM47XX_BOARD_ASUS_WL520GC,
+ BCM47XX_BOARD_ASUS_WL520GU, + BCM47XX_BOARD_ASUS_WL520GU,
+ BCM47XX_BOARD_ASUS_WL700GE, + BCM47XX_BOARD_ASUS_WL700GE,
+ BCM47XX_BOARD_ASUS_WLHDD,
+ +
+ BCM47XX_BOARD_BELKIN_F7D4301, + BCM47XX_BOARD_BELKIN_F7D4301,
+ +

View file

@ -8,7 +8,7 @@
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
--- /dev/null --- /dev/null
+++ b/arch/mips/bcm47xx/board.c +++ b/arch/mips/bcm47xx/board.c
@@ -0,0 +1,235 @@ @@ -0,0 +1,240 @@
+#include <linux/export.h> +#include <linux/export.h>
+#include <linux/string.h> +#include <linux/string.h>
+#include <bcm47xx_board.h> +#include <bcm47xx_board.h>
@ -45,9 +45,12 @@
+ +
+static const struct bcm47xx_board_type_list bcm47xx_board_list_hardware_version[] = { +static const struct bcm47xx_board_type_list bcm47xx_board_list_hardware_version[] = {
+ {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-",}, + {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-",},
+ {{BCM47XX_BOARD_ASUS_WL320GE, "Asus WL320GE"}, "WL320G-",},
+ {{BCM47XX_BOARD_ASUS_WL330GE, "Asus WL330GE"}, "WL330GE-",}, + {{BCM47XX_BOARD_ASUS_WL330GE, "Asus WL330GE"}, "WL330GE-",},
+ {{BCM47XX_BOARD_ASUS_WL500GD, "Asus WL500GD"}, "WL500gd-",},
+ {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GP V1"}, "WL500gp-",}, + {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GP V1"}, "WL500gp-",},
+ {{BCM47XX_BOARD_ASUS_WL500GPV2, "Asus WL500GP V2"}, "WL500GPV2-",}, + {{BCM47XX_BOARD_ASUS_WL500GPV2, "Asus WL500GP V2"}, "WL500GPV2-",},
+ {{BCM47XX_BOARD_ASUS_WL500W, "Asus WL500W"}, "WL500gW-",},
+ {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-",}, + {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-",},
+ {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-",}, + {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-",},
+ {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301",}, + {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301",},
@ -67,6 +70,8 @@
+ {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16",}, + {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16",},
+ {{BCM47XX_BOARD_ASUS_RTN53, "Asus RT-N53"}, "RT-N53",}, + {{BCM47XX_BOARD_ASUS_RTN53, "Asus RT-N53"}, "RT-N53",},
+ {{BCM47XX_BOARD_ASUS_RTN66U, "Asus RT-N66U"}, "RT-N66U",}, + {{BCM47XX_BOARD_ASUS_RTN66U, "Asus RT-N66U"}, "RT-N66U",},
+ {{BCM47XX_BOARD_ASUS_WL300G, "Asus WL300G"}, "WL300g",},
+ {{BCM47XX_BOARD_ASUS_WLHDD, "Asus WLHDD"}, "WLHDD",},
+ { {0}, 0}, + { {0}, 0},
+}; +};
+ +
@ -246,7 +251,7 @@
+EXPORT_SYMBOL(bcm47xx_board_get_name); +EXPORT_SYMBOL(bcm47xx_board_get_name);
--- /dev/null --- /dev/null
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
@@ -0,0 +1,92 @@ @@ -0,0 +1,97 @@
+#ifndef __BCM47XX_BOARD_H +#ifndef __BCM47XX_BOARD_H
+#define __BCM47XX_BOARD_H +#define __BCM47XX_BOARD_H
+ +
@ -263,12 +268,17 @@
+ BCM47XX_BOARD_ASUS_RTN16, + BCM47XX_BOARD_ASUS_RTN16,
+ BCM47XX_BOARD_ASUS_RTN53, + BCM47XX_BOARD_ASUS_RTN53,
+ BCM47XX_BOARD_ASUS_RTN66U, + BCM47XX_BOARD_ASUS_RTN66U,
+ BCM47XX_BOARD_ASUS_WL300G,
+ BCM47XX_BOARD_ASUS_WL320GE,
+ BCM47XX_BOARD_ASUS_WL330GE, + BCM47XX_BOARD_ASUS_WL330GE,
+ BCM47XX_BOARD_ASUS_WL500GD,
+ BCM47XX_BOARD_ASUS_WL500GPV1, + BCM47XX_BOARD_ASUS_WL500GPV1,
+ BCM47XX_BOARD_ASUS_WL500GPV2, + BCM47XX_BOARD_ASUS_WL500GPV2,
+ BCM47XX_BOARD_ASUS_WL500W,
+ BCM47XX_BOARD_ASUS_WL520GC, + BCM47XX_BOARD_ASUS_WL520GC,
+ BCM47XX_BOARD_ASUS_WL520GU, + BCM47XX_BOARD_ASUS_WL520GU,
+ BCM47XX_BOARD_ASUS_WL700GE, + BCM47XX_BOARD_ASUS_WL700GE,
+ BCM47XX_BOARD_ASUS_WLHDD,
+ +
+ BCM47XX_BOARD_BELKIN_F7D4301, + BCM47XX_BOARD_BELKIN_F7D4301,
+ +