diff options
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r-- | arch/mips/bcm47xx/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/bcm47xx/bcm47xx_private.h | 3 | ||||
-rw-r--r-- | arch/mips/bcm47xx/board.c | 25 | ||||
-rw-r--r-- | arch/mips/bcm47xx/buttons.c | 31 | ||||
-rw-r--r-- | arch/mips/bcm47xx/leds.c | 49 | ||||
-rw-r--r-- | arch/mips/bcm47xx/setup.c | 3 | ||||
-rw-r--r-- | arch/mips/bcm47xx/workarounds.c | 31 |
7 files changed, 141 insertions, 3 deletions
diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile index 4688b6a6211b..d58c51b5e501 100644 --- a/arch/mips/bcm47xx/Makefile +++ b/arch/mips/bcm47xx/Makefile @@ -4,4 +4,4 @@ # obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o -obj-y += board.o buttons.o leds.o +obj-y += board.o buttons.o leds.o workarounds.o diff --git a/arch/mips/bcm47xx/bcm47xx_private.h b/arch/mips/bcm47xx/bcm47xx_private.h index 5c94acebf76a..0194c3b9a729 100644 --- a/arch/mips/bcm47xx/bcm47xx_private.h +++ b/arch/mips/bcm47xx/bcm47xx_private.h @@ -9,4 +9,7 @@ int __init bcm47xx_buttons_register(void); /* leds.c */ void __init bcm47xx_leds_register(void); +/* workarounds.c */ +void __init bcm47xx_workarounds(void); + #endif diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c index cdd8246f92b3..44ab1be68c3c 100644 --- a/arch/mips/bcm47xx/board.c +++ b/arch/mips/bcm47xx/board.c @@ -72,7 +72,11 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] __initcons {{BCM47XX_BOARD_ASUS_WL500W, "Asus WL500W"}, "WL500gW-"}, {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-"}, {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-"}, + {{BCM47XX_BOARD_BELKIN_F7D3301, "Belkin F7D3301"}, "F7D3301"}, + {{BCM47XX_BOARD_BELKIN_F7D3302, "Belkin F7D3302"}, "F7D3302"}, {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301"}, + {{BCM47XX_BOARD_BELKIN_F7D4302, "Belkin F7D4302"}, "F7D4302"}, + {{BCM47XX_BOARD_BELKIN_F7D4401, "Belkin F7D4401"}, "F7D4401"}, { {0}, NULL}, }; @@ -176,7 +180,16 @@ struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = { {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"}, {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "0x04CF", "3500", "02"}, - {{BCM47XX_BOARD_LINKSYS_WRT54GSV1, "Linksys WRT54GS V1"}, "0x0101", "42", "0x10"}, + {{BCM47XX_BOARD_LINKSYS_WRT54G, "Linksys WRT54G/GS/GL"}, "0x0101", "42", "0x10"}, + {{BCM47XX_BOARD_LINKSYS_WRT54G, "Linksys WRT54G/GS/GL"}, "0x0467", "42", "0x10"}, + {{BCM47XX_BOARD_LINKSYS_WRT54G, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"}, + { {0}, NULL}, +}; + +/* boardtype, boardrev */ +static const +struct bcm47xx_board_type_list2 bcm47xx_board_list_board_type_rev[] __initconst = { + {{BCM47XX_BOARD_SIEMENS_SE505V2, "Siemens SE505 V2"}, "0x0101", "0x10"}, { {0}, NULL}, }; @@ -273,6 +286,16 @@ static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) return &e3->board; } } + + if (bcm47xx_nvram_getenv("boardtype", buf1, sizeof(buf1)) >= 0 && + bcm47xx_nvram_getenv("boardrev", buf2, sizeof(buf2)) >= 0 && + bcm47xx_nvram_getenv("boardnum", buf3, sizeof(buf3)) == -ENOENT) { + for (e2 = bcm47xx_board_list_board_type_rev; e2->value1; e2++) { + if (!strcmp(buf1, e2->value1) && + !strcmp(buf2, e2->value2)) + return &e2->board; + } + } return bcm47xx_board_unknown; } diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c index 872c62e93e0e..49a1ce06844b 100644 --- a/arch/mips/bcm47xx/buttons.c +++ b/arch/mips/bcm47xx/buttons.c @@ -259,6 +259,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __initconst = { }; static const struct gpio_keys_button +bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = { + BCM47XX_GPIO_KEY(5, KEY_WIMAX), + BCM47XX_GPIO_KEY(6, KEY_RESTART), +}; + +static const struct gpio_keys_button +bcm47xx_buttons_linksys_wrt54gsv1[] __initconst = { + BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), + BCM47XX_GPIO_KEY(6, KEY_RESTART), +}; + +static const struct gpio_keys_button bcm47xx_buttons_linksys_wrt610nv1[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), @@ -270,6 +282,12 @@ bcm47xx_buttons_linksys_wrt610nv2[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; +static const struct gpio_keys_button +bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = { + BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), + BCM47XX_GPIO_KEY(6, KEY_RESTART), +}; + /* Motorola */ static const struct gpio_keys_button @@ -402,7 +420,11 @@ int __init bcm47xx_buttons_register(void) err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd); break; + case BCM47XX_BOARD_BELKIN_F7D3301: + case BCM47XX_BOARD_BELKIN_F7D3302: case BCM47XX_BOARD_BELKIN_F7D4301: + case BCM47XX_BOARD_BELKIN_F7D4302: + case BCM47XX_BOARD_BELKIN_F7D4401: err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301); break; @@ -479,12 +501,21 @@ int __init bcm47xx_buttons_register(void) case BCM47XX_BOARD_LINKSYS_WRT310NV1: err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); break; + case BCM47XX_BOARD_LINKSYS_WRT54G: + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54gsv1); + break; + case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2); + break; case BCM47XX_BOARD_LINKSYS_WRT610NV1: err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1); break; case BCM47XX_BOARD_LINKSYS_WRT610NV2: err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2); break; + case BCM47XX_BOARD_LINKSYS_WRTSL54GS: + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs); + break; case BCM47XX_BOARD_MOTOROLA_WE800G: err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g); diff --git a/arch/mips/bcm47xx/leds.c b/arch/mips/bcm47xx/leds.c index 647d15527066..adcb547a91c3 100644 --- a/arch/mips/bcm47xx/leds.c +++ b/arch/mips/bcm47xx/leds.c @@ -292,6 +292,21 @@ bcm47xx_leds_linksys_wrt310nv1[] __initconst = { }; static const struct gpio_led +bcm47xx_leds_linksys_wrt54gsv1[] __initconst = { + BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), + BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), +}; + +static const struct gpio_led +bcm47xx_leds_linksys_wrt54g3gv2[] __initconst = { + BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), + BCM47XX_GPIO_LED(2, "green", "3g", 0, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(3, "blue", "3g", 0, LEDS_GPIO_DEFSTATE_OFF), +}; + +static const struct gpio_led bcm47xx_leds_linksys_wrt610nv1[] __initconst = { BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF), @@ -308,6 +323,15 @@ bcm47xx_leds_linksys_wrt610nv2[] __initconst = { BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), }; +static const struct gpio_led +bcm47xx_leds_linksys_wrtsl54gs[] __initconst = { + BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), + BCM47XX_GPIO_LED(2, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(3, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(7, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), +}; + /* Motorola */ static const struct gpio_led @@ -359,6 +383,14 @@ bcm47xx_leds_netgear_wnr834bv2[] __initconst = { BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF), }; +/* Siemens */ +static const struct gpio_led +bcm47xx_leds_siemens_se505v2[] __initconst = { + BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(3, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), + BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), +}; + /* SimpleTech */ static const struct gpio_led @@ -425,7 +457,11 @@ void __init bcm47xx_leds_register(void) bcm47xx_set_pdata(bcm47xx_leds_asus_wlhdd); break; + case BCM47XX_BOARD_BELKIN_F7D3301: + case BCM47XX_BOARD_BELKIN_F7D3302: case BCM47XX_BOARD_BELKIN_F7D4301: + case BCM47XX_BOARD_BELKIN_F7D4302: + case BCM47XX_BOARD_BELKIN_F7D4401: bcm47xx_set_pdata(bcm47xx_leds_belkin_f7d4301); break; @@ -502,12 +538,21 @@ void __init bcm47xx_leds_register(void) case BCM47XX_BOARD_LINKSYS_WRT310NV1: bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1); break; + case BCM47XX_BOARD_LINKSYS_WRT54G: + bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54gsv1); + break; + case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: + bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2); + break; case BCM47XX_BOARD_LINKSYS_WRT610NV1: bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1); break; case BCM47XX_BOARD_LINKSYS_WRT610NV2: bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2); break; + case BCM47XX_BOARD_LINKSYS_WRTSL54GS: + bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs); + break; case BCM47XX_BOARD_MOTOROLA_WE800G: bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g); @@ -529,6 +574,10 @@ void __init bcm47xx_leds_register(void) bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2); break; + case BCM47XX_BOARD_SIEMENS_SE505V2: + bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2); + break; + case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE: bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare); break; diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index 025be218ea15..63a4b0e915dc 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c @@ -212,7 +212,7 @@ void __init plat_mem_setup(void) { struct cpuinfo_mips *c = ¤t_cpu_data; - if (c->cputype == CPU_74K) { + if ((c->cputype == CPU_74K) || (c->cputype == CPU_1074K)) { printk(KERN_INFO "bcm47xx: using bcma bus\n"); #ifdef CONFIG_BCM47XX_BCMA bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA; @@ -282,6 +282,7 @@ static int __init bcm47xx_register_bus_complete(void) } bcm47xx_buttons_register(); bcm47xx_leds_register(); + bcm47xx_workarounds(); fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status); return 0; diff --git a/arch/mips/bcm47xx/workarounds.c b/arch/mips/bcm47xx/workarounds.c new file mode 100644 index 000000000000..e81ce4623070 --- /dev/null +++ b/arch/mips/bcm47xx/workarounds.c @@ -0,0 +1,31 @@ +#include "bcm47xx_private.h" + +#include <linux/gpio.h> +#include <bcm47xx_board.h> +#include <bcm47xx.h> + +static void __init bcm47xx_workarounds_netgear_wnr3500l(void) +{ + const int usb_power = 12; + int err; + + err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power"); + if (err) + pr_err("Failed to request USB power gpio: %d\n", err); + else + gpio_free(usb_power); +} + +void __init bcm47xx_workarounds(void) +{ + enum bcm47xx_board board = bcm47xx_board_get(); + + switch (board) { + case BCM47XX_BOARD_NETGEAR_WNR3500L: + bcm47xx_workarounds_netgear_wnr3500l(); + break; + default: + /* No workaround(s) needed */ + break; + } +} |