From: Hauke Mehrtens Date: Sun, 6 Oct 2013 23:51:24 +0000 (+0000) Subject: brcm47xx: update board detection patches X-Git-Tag: reboot~9020 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ebf07787210deee29e3ad4f2308433866a853c20;p=openwrt%2Fstaging%2Fchunkeey.git brcm47xx: update board detection patches Add patches like they are currently in the mainline mips tree and add some more pending patches for board detection. * Now the board name is shown under machine in /proc/cpuinfo. Signed-off-by: Hauke Mehrtens SVN-Revision: 38308 --- diff --git a/target/linux/brcm47xx/patches-3.10/070-MIPS-BCM47XX-add-board-detection.patch b/target/linux/brcm47xx/patches-3.10/070-MIPS-BCM47XX-add-board-detection.patch new file mode 100644 index 0000000000..ae519b69d6 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/070-MIPS-BCM47XX-add-board-detection.patch @@ -0,0 +1,469 @@ +commit 74370cf83baefceb83f5f4b7ff5c8e19e7056632 +Author: Hauke Mehrtens +Date: Wed Sep 18 13:29:57 2013 +0200 + + MIPS: BCM47XX: Add board detection + + Detect on which board this code is running based on some nvram + settings. This is needed to start board specific workarounds and + configure the leds and buttons which are on different gpios on every board. + + This patches add some boards we have seen, but there are many more. + + Signed-off-by: Hauke Mehrtens + Cc: linux-mips@linux-mips.org + Patchwork: https://patchwork.linux-mips.org/patch/5840 + Patchwork: https://patchwork.linux-mips.org/patch/5855/ + Signed-off-by: Ralf Baechle + +--- a/arch/mips/bcm47xx/Makefile ++++ b/arch/mips/bcm47xx/Makefile +@@ -4,4 +4,5 @@ + # + + obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o ++obj-y += board.o + obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o +--- /dev/null ++++ b/arch/mips/bcm47xx/board.c +@@ -0,0 +1,309 @@ ++#include ++#include ++#include ++#include ++ ++struct bcm47xx_board_type { ++ const enum bcm47xx_board board; ++ const char *name; ++}; ++ ++struct bcm47xx_board_type_list1 { ++ struct bcm47xx_board_type board; ++ const char *value1; ++}; ++ ++struct bcm47xx_board_type_list2 { ++ struct bcm47xx_board_type board; ++ const char *value1; ++ const char *value2; ++}; ++ ++struct bcm47xx_board_type_list3 { ++ struct bcm47xx_board_type board; ++ const char *value1; ++ const char *value2; ++ const char *value3; ++}; ++ ++struct bcm47xx_board_store { ++ enum bcm47xx_board board; ++ char name[BCM47XX_BOARD_MAX_NAME]; ++}; ++ ++/* model_name */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] __initconst = { ++ {{BCM47XX_BOARD_DLINK_DIR130, "D-Link DIR-130"}, "DIR-130"}, ++ {{BCM47XX_BOARD_DLINK_DIR330, "D-Link DIR-330"}, "DIR-330"}, ++ { {0}, 0}, ++}; ++ ++/* model_no */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] __initconst = { ++ {{BCM47XX_BOARD_ASUS_WL700GE, "Asus WL700"}, "WL700"}, ++ { {0}, 0}, ++}; ++ ++/* machine_name */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] __initconst = { ++ {{BCM47XX_BOARD_LINKSYS_WRTSL54GS, "Linksys WRTSL54GS"}, "WRTSL54GS"}, ++ { {0}, 0}, ++}; ++ ++/* hardware_version */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] __initconst = { ++ {{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_WL500GD, "Asus WL500GD"}, "WL500gd-"}, ++ {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GP V1"}, "WL500gp-"}, ++ {{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_WL520GU, "Asus WL520GU"}, "WL520GU-"}, ++ {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301"}, ++ { {0}, 0}, ++}; ++ ++/* productid */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_productid[] __initconst = { ++ {{BCM47XX_BOARD_ASUS_RTAC66U, "Asus RT-AC66U"}, "RT-AC66U"}, ++ {{BCM47XX_BOARD_ASUS_RTN10, "Asus RT-N10"}, "RT-N10"}, ++ {{BCM47XX_BOARD_ASUS_RTN10D, "Asus RT-N10D"}, "RT-N10D"}, ++ {{BCM47XX_BOARD_ASUS_RTN10U, "Asus RT-N10U"}, "RT-N10U"}, ++ {{BCM47XX_BOARD_ASUS_RTN12, "Asus RT-N12"}, "RT-N12"}, ++ {{BCM47XX_BOARD_ASUS_RTN12B1, "Asus RT-N12B1"}, "RT-N12B1"}, ++ {{BCM47XX_BOARD_ASUS_RTN12C1, "Asus RT-N12C1"}, "RT-N12C1"}, ++ {{BCM47XX_BOARD_ASUS_RTN12D1, "Asus RT-N12D1"}, "RT-N12D1"}, ++ {{BCM47XX_BOARD_ASUS_RTN12HP, "Asus RT-N12HP"}, "RT-N12HP"}, ++ {{BCM47XX_BOARD_ASUS_RTN15U, "Asus RT-N15U"}, "RT-N15U"}, ++ {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16"}, ++ {{BCM47XX_BOARD_ASUS_RTN53, "Asus RT-N53"}, "RT-N53"}, ++ {{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}, ++}; ++ ++/* ModelId */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_ModelId[] __initconst = { ++ {{BCM47XX_BOARD_DELL_TM2300, "Dell WX-5565"}, "WX-5565"}, ++ {{BCM47XX_BOARD_MOTOROLA_WE800G, "Motorola WE800G"}, "WE800G"}, ++ {{BCM47XX_BOARD_MOTOROLA_WR850GP, "Motorola WR850GP"}, "WR850GP"}, ++ {{BCM47XX_BOARD_MOTOROLA_WR850GV2V3, "Motorola WR850G"}, "WR850G"}, ++ { {0}, 0}, ++}; ++ ++/* melco_id or buf1falo_id */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_melco_id[] __initconst = { ++ {{BCM47XX_BOARD_BUFFALO_WBR2_G54, "Buffalo WBR2-G54"}, "29bb0332"}, ++ {{BCM47XX_BOARD_BUFFALO_WHR2_A54G54, "Buffalo WHR2-A54G54"}, "290441dd"}, ++ {{BCM47XX_BOARD_BUFFALO_WHR_G125, "Buffalo WHR-G125"}, "32093"}, ++ {{BCM47XX_BOARD_BUFFALO_WHR_G54S, "Buffalo WHR-G54S"}, "30182"}, ++ {{BCM47XX_BOARD_BUFFALO_WHR_HP_G54, "Buffalo WHR-HP-G54"}, "30189"}, ++ {{BCM47XX_BOARD_BUFFALO_WLA2_G54L, "Buffalo WLA2-G54L"}, "29129"}, ++ {{BCM47XX_BOARD_BUFFALO_WZR_G300N, "Buffalo WZR-G300N"}, "31120"}, ++ {{BCM47XX_BOARD_BUFFALO_WZR_RS_G54, "Buffalo WZR-RS-G54"}, "30083"}, ++ {{BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP, "Buffalo WZR-RS-G54HP"}, "30103"}, ++ { {0}, 0}, ++}; ++ ++/* boot_hw_model, boot_hw_ver */ ++static const ++struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = { ++ /* like WRT160N v3.0 */ ++ {{BCM47XX_BOARD_CISCO_M10V1, "Cisco M10"}, "M10", "1.0"}, ++ /* like WRT310N v2.0 */ ++ {{BCM47XX_BOARD_CISCO_M20V1, "Cisco M20"}, "M20", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_E900V1, "Linksys E900 V1"}, "E900", "1.0"}, ++ /* like WRT160N v3.0 */ ++ {{BCM47XX_BOARD_LINKSYS_E1000V1, "Linksys E1000 V1"}, "E100", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_E1000V2, "Linksys E1000 V2"}, "E1000", "2.0"}, ++ {{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"}, ++ {{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"}, ++ {{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"}, ++ /* like WRT610N v2.0 */ ++ {{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_E4200V1, "Linksys E4200 V1"}, "E4200", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT150NV11, "Linksys WRT150N V1.1"}, "WRT150N", "1.1"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT150NV1, "Linksys WRT150N V1"}, "WRT150N", "1"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT160NV1, "Linksys WRT160N V1"}, "WRT160N", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT160NV3, "Linksys WRT160N V3"}, "WRT160N", "3.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"}, ++ {{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"}, ++ { {0}, 0}, ++}; ++ ++/* board_id */ ++static const ++struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = { ++ {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR3400VCNA, "Netgear WNDR3400 Vcna"}, "U12H155T01_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR3700V3, "Netgear WNDR3700 V3"}, "U12H194T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR4000, "Netgear WNDR4000"}, "U12H181T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR4500V1, "Netgear WNDR4500 V1"}, "U12H189T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNDR4500V2, "Netgear WNDR4500 V2"}, "U12H224T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNR2000, "Netgear WNR2000"}, "U12H114T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "U12H136T99_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNR3500U, "Netgear WNR3500U"}, "U12H136T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNR3500V2, "Netgear WNR3500 V2"}, "U12H127T00_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNR3500V2VC, "Netgear WNR3500 V2vc"}, "U12H127T70_NETGEAR"}, ++ {{BCM47XX_BOARD_NETGEAR_WNR834BV2, "Netgear WNR834B V2"}, "U12H081T00_NETGEAR"}, ++ { {0}, 0}, ++}; ++ ++/* boardtype, boardnum, boardrev */ ++static const ++struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = { ++ {{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"}, ++ {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, ++ {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"}, ++ { {0}, 0}, ++}; ++ ++static const ++struct bcm47xx_board_type bcm47xx_board_unknown[] __initconst = { ++ {BCM47XX_BOARD_UNKNOWN, "Unknown Board"}, ++}; ++ ++static struct bcm47xx_board_store bcm47xx_board = {BCM47XX_BOARD_NO, "Unknown Board"}; ++ ++static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) ++{ ++ char buf1[30]; ++ char buf2[30]; ++ char buf3[30]; ++ const struct bcm47xx_board_type_list1 *e1; ++ const struct bcm47xx_board_type_list2 *e2; ++ const struct bcm47xx_board_type_list3 *e3; ++ ++ if (bcm47xx_nvram_getenv("model_name", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_model_name; e1->value1; e1++) { ++ if (!strcmp(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("model_no", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_model_no; e1->value1; e1++) { ++ if (strstarts(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("machine_name", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_machine_name; e1->value1; e1++) { ++ if (strstarts(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("hardware_version", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_hardware_version; e1->value1; e1++) { ++ if (strstarts(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("productid", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_productid; e1->value1; e1++) { ++ if (!strcmp(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("ModelId", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_ModelId; e1->value1; e1++) { ++ if (!strcmp(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("melco_id", buf1, sizeof(buf1)) >= 0 || ++ bcm47xx_nvram_getenv("buf1falo_id", buf1, sizeof(buf1)) >= 0) { ++ /* buffalo hardware, check id for specific hardware matches */ ++ for (e1 = bcm47xx_board_list_melco_id; e1->value1; e1++) { ++ if (!strcmp(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("boot_hw_model", buf1, sizeof(buf1)) >= 0 && ++ bcm47xx_nvram_getenv("boot_hw_ver", buf2, sizeof(buf2)) >= 0) { ++ for (e2 = bcm47xx_board_list_boot_hw; e2->value1; e2++) { ++ if (!strcmp(buf1, e2->value1) && ++ !strcmp(buf2, e2->value2)) ++ return &e2->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("board_id", buf1, sizeof(buf1)) >= 0) { ++ for (e1 = bcm47xx_board_list_board_id; e1->value1; e1++) { ++ if (!strcmp(buf1, e1->value1)) ++ return &e1->board; ++ } ++ } ++ ++ if (bcm47xx_nvram_getenv("boardtype", buf1, sizeof(buf1)) >= 0 && ++ bcm47xx_nvram_getenv("boardnum", buf2, sizeof(buf2)) >= 0 && ++ bcm47xx_nvram_getenv("boardrev", buf3, sizeof(buf3)) >= 0) { ++ for (e3 = bcm47xx_board_list_board; e3->value1; e3++) { ++ if (!strcmp(buf1, e3->value1) && ++ !strcmp(buf2, e3->value2) && ++ !strcmp(buf3, e3->value3)) ++ return &e3->board; ++ } ++ } ++ return bcm47xx_board_unknown; ++} ++ ++void __init bcm47xx_board_detect(void) ++{ ++ int err; ++ char buf[10]; ++ const struct bcm47xx_board_type *board_detected; ++ ++ if (bcm47xx_board.board != BCM47XX_BOARD_NO) ++ return; ++ ++ /* check if the nvram is available */ ++ err = bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)); ++ ++ /* init of nvram failed, probably too early now */ ++ if (err == -ENXIO) { ++ return; ++ } ++ ++ board_detected = bcm47xx_board_get_nvram(); ++ bcm47xx_board.board = board_detected->board; ++ strlcpy(bcm47xx_board.name, board_detected->name, ++ BCM47XX_BOARD_MAX_NAME); ++} ++ ++enum bcm47xx_board bcm47xx_board_get(void) ++{ ++ return bcm47xx_board.board; ++} ++EXPORT_SYMBOL(bcm47xx_board_get); ++ ++const char *bcm47xx_board_get_name(void) ++{ ++ return bcm47xx_board.name; ++} ++EXPORT_SYMBOL(bcm47xx_board_get_name); +--- a/arch/mips/bcm47xx/setup.c ++++ b/arch/mips/bcm47xx/setup.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + union bcm47xx_bus bcm47xx_bus; + EXPORT_SYMBOL(bcm47xx_bus); +@@ -221,6 +222,7 @@ void __init plat_mem_setup(void) + _machine_restart = bcm47xx_machine_restart; + _machine_halt = bcm47xx_machine_halt; + pm_power_off = bcm47xx_machine_halt; ++ bcm47xx_board_detect(); + } + + static int __init bcm47xx_register_bus_complete(void) +--- /dev/null ++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h +@@ -0,0 +1,110 @@ ++#ifndef __BCM47XX_BOARD_H ++#define __BCM47XX_BOARD_H ++ ++enum bcm47xx_board { ++ BCM47XX_BOARD_ASUS_RTAC66U, ++ BCM47XX_BOARD_ASUS_RTN10, ++ BCM47XX_BOARD_ASUS_RTN10D, ++ BCM47XX_BOARD_ASUS_RTN10U, ++ BCM47XX_BOARD_ASUS_RTN12, ++ BCM47XX_BOARD_ASUS_RTN12B1, ++ BCM47XX_BOARD_ASUS_RTN12C1, ++ BCM47XX_BOARD_ASUS_RTN12D1, ++ BCM47XX_BOARD_ASUS_RTN12HP, ++ BCM47XX_BOARD_ASUS_RTN15U, ++ BCM47XX_BOARD_ASUS_RTN16, ++ BCM47XX_BOARD_ASUS_RTN53, ++ BCM47XX_BOARD_ASUS_RTN66U, ++ BCM47XX_BOARD_ASUS_WL300G, ++ BCM47XX_BOARD_ASUS_WL320GE, ++ BCM47XX_BOARD_ASUS_WL330GE, ++ BCM47XX_BOARD_ASUS_WL500GD, ++ BCM47XX_BOARD_ASUS_WL500GPV1, ++ BCM47XX_BOARD_ASUS_WL500GPV2, ++ BCM47XX_BOARD_ASUS_WL500W, ++ BCM47XX_BOARD_ASUS_WL520GC, ++ BCM47XX_BOARD_ASUS_WL520GU, ++ BCM47XX_BOARD_ASUS_WL700GE, ++ BCM47XX_BOARD_ASUS_WLHDD, ++ ++ BCM47XX_BOARD_BELKIN_F7D4301, ++ ++ BCM47XX_BOARD_BUFFALO_WBR2_G54, ++ BCM47XX_BOARD_BUFFALO_WHR2_A54G54, ++ BCM47XX_BOARD_BUFFALO_WHR_G125, ++ BCM47XX_BOARD_BUFFALO_WHR_G54S, ++ BCM47XX_BOARD_BUFFALO_WHR_HP_G54, ++ BCM47XX_BOARD_BUFFALO_WLA2_G54L, ++ BCM47XX_BOARD_BUFFALO_WZR_G300N, ++ BCM47XX_BOARD_BUFFALO_WZR_RS_G54, ++ BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP, ++ ++ BCM47XX_BOARD_CISCO_M10V1, ++ BCM47XX_BOARD_CISCO_M20V1, ++ ++ BCM47XX_BOARD_DELL_TM2300, ++ ++ BCM47XX_BOARD_DLINK_DIR130, ++ BCM47XX_BOARD_DLINK_DIR330, ++ ++ BCM47XX_BOARD_HUAWEI_E970, ++ ++ BCM47XX_BOARD_LINKSYS_E900V1, ++ BCM47XX_BOARD_LINKSYS_E1000V1, ++ BCM47XX_BOARD_LINKSYS_E1000V2, ++ BCM47XX_BOARD_LINKSYS_E1000V21, ++ BCM47XX_BOARD_LINKSYS_E1200V2, ++ BCM47XX_BOARD_LINKSYS_E2000V1, ++ BCM47XX_BOARD_LINKSYS_E3000V1, ++ BCM47XX_BOARD_LINKSYS_E3200V1, ++ BCM47XX_BOARD_LINKSYS_E4200V1, ++ BCM47XX_BOARD_LINKSYS_WRT150NV1, ++ BCM47XX_BOARD_LINKSYS_WRT150NV11, ++ BCM47XX_BOARD_LINKSYS_WRT160NV1, ++ BCM47XX_BOARD_LINKSYS_WRT160NV3, ++ BCM47XX_BOARD_LINKSYS_WRT300NV11, ++ BCM47XX_BOARD_LINKSYS_WRT310NV1, ++ BCM47XX_BOARD_LINKSYS_WRT310NV2, ++ BCM47XX_BOARD_LINKSYS_WRT54G3GV2, ++ BCM47XX_BOARD_LINKSYS_WRT610NV1, ++ BCM47XX_BOARD_LINKSYS_WRT610NV2, ++ BCM47XX_BOARD_LINKSYS_WRTSL54GS, ++ ++ BCM47XX_BOARD_MOTOROLA_WE800G, ++ BCM47XX_BOARD_MOTOROLA_WR850GP, ++ BCM47XX_BOARD_MOTOROLA_WR850GV2V3, ++ ++ BCM47XX_BOARD_NETGEAR_WGR614V8, ++ BCM47XX_BOARD_NETGEAR_WGR614V9, ++ BCM47XX_BOARD_NETGEAR_WNDR3300, ++ BCM47XX_BOARD_NETGEAR_WNDR3400V1, ++ BCM47XX_BOARD_NETGEAR_WNDR3400V2, ++ BCM47XX_BOARD_NETGEAR_WNDR3400VCNA, ++ BCM47XX_BOARD_NETGEAR_WNDR3700V3, ++ BCM47XX_BOARD_NETGEAR_WNDR4000, ++ BCM47XX_BOARD_NETGEAR_WNDR4500V1, ++ BCM47XX_BOARD_NETGEAR_WNDR4500V2, ++ BCM47XX_BOARD_NETGEAR_WNR2000, ++ BCM47XX_BOARD_NETGEAR_WNR3500L, ++ BCM47XX_BOARD_NETGEAR_WNR3500U, ++ BCM47XX_BOARD_NETGEAR_WNR3500V2, ++ BCM47XX_BOARD_NETGEAR_WNR3500V2VC, ++ BCM47XX_BOARD_NETGEAR_WNR834BV2, ++ ++ BCM47XX_BOARD_PHICOMM_M1, ++ ++ BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE, ++ ++ BCM47XX_BOARD_ZTE_H218N, ++ ++ BCM47XX_BOARD_UNKNOWN, ++ BCM47XX_BOARD_NO, ++}; ++ ++#define BCM47XX_BOARD_MAX_NAME 30 ++ ++void bcm47xx_board_detect(void); ++enum bcm47xx_board bcm47xx_board_get(void); ++const char *bcm47xx_board_get_name(void); ++ ++#endif /* __BCM47XX_BOARD_H */ diff --git a/target/linux/brcm47xx/patches-3.10/071-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch b/target/linux/brcm47xx/patches-3.10/071-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch new file mode 100644 index 0000000000..c746279dc2 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/071-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch @@ -0,0 +1,55 @@ +commit 7ad3b82f9d80ef8919dcfdfe7561e1a83e09c6bd +Author: Hauke Mehrtens +Date: Wed Sep 18 13:29:58 2013 +0200 + + MIPS: BCM47XX: Print board name in /proc/cpuinfo + + Do not print the constant system type "Broadcom BCM47XX" but print the + name of the actual SoC in use and the detected board. + + Signed-off-by: Hauke Mehrtens + Cc: linux-mips@linux-mips.org + Patchwork: https://patchwork.linux-mips.org/patch/5839/ + Signed-off-by: Ralf Baechle + +--- a/arch/mips/bcm47xx/prom.c ++++ b/arch/mips/bcm47xx/prom.c +@@ -32,12 +32,37 @@ + #include + #include + #include ++#include ++#include + + static int cfe_cons_handle; + ++static u16 get_chip_id(void) ++{ ++ switch (bcm47xx_bus_type) { ++#ifdef CONFIG_BCM47XX_SSB ++ case BCM47XX_BUS_TYPE_SSB: ++ return bcm47xx_bus.ssb.chip_id; ++#endif ++#ifdef CONFIG_BCM47XX_BCMA ++ case BCM47XX_BUS_TYPE_BCMA: ++ return bcm47xx_bus.bcma.bus.chipinfo.id; ++#endif ++ } ++ return 0; ++} ++ + const char *get_system_type(void) + { +- return "Broadcom BCM47XX"; ++ static char buf[50]; ++ u16 chip_id = get_chip_id(); ++ ++ snprintf(buf, sizeof(buf), ++ (chip_id > 0x9999) ? "Broadcom BCM%d (%s)" : ++ "Broadcom BCM%04X (%s)", ++ chip_id, bcm47xx_board_get_name()); ++ ++ return buf; + } + + void prom_putchar(char c) diff --git a/target/linux/brcm47xx/patches-3.10/072-MIPS-BCM47XX-only-print-SoC-name-in-system-type-in-c.patch b/target/linux/brcm47xx/patches-3.10/072-MIPS-BCM47XX-only-print-SoC-name-in-system-type-in-c.patch new file mode 100644 index 0000000000..1993cf5a44 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/072-MIPS-BCM47XX-only-print-SoC-name-in-system-type-in-c.patch @@ -0,0 +1,83 @@ +commit 88aaea30099c1562c4b4015d965c22df29034a74 +Author: Hauke Mehrtens +Date: Thu Sep 19 22:01:53 2013 +0200 + + MIPS: BCM47XX: only print SoC name in system type in cpuinfo + + Recently the output of "system type" in /proc/cpuinfo was changed to + Broadcom BCM4730 (Some sample board), but it is better to just print + the SoC name in the "system type" entry. The board name will be added + in the machine entry later. + + Signed-off-by: Hauke Mehrtens + +--- a/arch/mips/bcm47xx/prom.c ++++ b/arch/mips/bcm47xx/prom.c +@@ -37,32 +37,19 @@ + + static int cfe_cons_handle; + +-static u16 get_chip_id(void) +-{ +- switch (bcm47xx_bus_type) { +-#ifdef CONFIG_BCM47XX_SSB +- case BCM47XX_BUS_TYPE_SSB: +- return bcm47xx_bus.ssb.chip_id; +-#endif +-#ifdef CONFIG_BCM47XX_BCMA +- case BCM47XX_BUS_TYPE_BCMA: +- return bcm47xx_bus.bcma.bus.chipinfo.id; +-#endif +- } +- return 0; +-} ++static char bcm47xx_system_type[20] = "Broadcom BCM47XX"; + + const char *get_system_type(void) + { +- static char buf[50]; +- u16 chip_id = get_chip_id(); +- +- snprintf(buf, sizeof(buf), +- (chip_id > 0x9999) ? "Broadcom BCM%d (%s)" : +- "Broadcom BCM%04X (%s)", +- chip_id, bcm47xx_board_get_name()); ++ return bcm47xx_system_type; ++} + +- return buf; ++__init void bcm47xx_set_system_type(u16 chip_id) ++{ ++ snprintf(bcm47xx_system_type, sizeof(bcm47xx_system_type), ++ (chip_id > 0x9999) ? "Broadcom BCM%d" : ++ "Broadcom BCM%04X", ++ chip_id); + } + + void prom_putchar(char c) +--- a/arch/mips/bcm47xx/setup.c ++++ b/arch/mips/bcm47xx/setup.c +@@ -210,12 +210,14 @@ void __init plat_mem_setup(void) + #ifdef CONFIG_BCM47XX_BCMA + bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA; + bcm47xx_register_bcma(); ++ bcm47xx_set_system_type(bcm47xx_bus.bcma.bus.chipinfo.id); + #endif + } else { + printk(KERN_INFO "bcm47xx: using ssb bus\n"); + #ifdef CONFIG_BCM47XX_SSB + bcm47xx_bus_type = BCM47XX_BUS_TYPE_SSB; + bcm47xx_register_ssb(); ++ bcm47xx_set_system_type(bcm47xx_bus.ssb.chip_id); + #endif + } + +--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h ++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h +@@ -56,4 +56,6 @@ void bcm47xx_fill_bcma_boardinfo(struct + const char *prefix); + #endif + ++void bcm47xx_set_system_type(u16 chip_id); ++ + #endif /* __ASM_BCM47XX_H */ diff --git a/target/linux/brcm47xx/patches-3.10/073-MIPS-BCM47XX-print-board-name-in-machine-entry-in-cp.patch b/target/linux/brcm47xx/patches-3.10/073-MIPS-BCM47XX-print-board-name-in-machine-entry-in-cp.patch new file mode 100644 index 0000000000..b7bc335f95 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/073-MIPS-BCM47XX-print-board-name-in-machine-entry-in-cp.patch @@ -0,0 +1,28 @@ +commit 86bd812676d1e99968f395ad82ccaa2db7965748 +Author: Hauke Mehrtens +Date: Thu Sep 19 22:04:04 2013 +0200 + + MIPS: BCM47XX: print board name in machine entry in cpuinfo + + This will add the board name to the machine entry in /proc/cpuinfo. + + Signed-off-by: Hauke Mehrtens + +--- a/arch/mips/bcm47xx/setup.c ++++ b/arch/mips/bcm47xx/setup.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -225,6 +226,7 @@ void __init plat_mem_setup(void) + _machine_halt = bcm47xx_machine_halt; + pm_power_off = bcm47xx_machine_halt; + bcm47xx_board_detect(); ++ mips_set_machine_name(bcm47xx_board_get_name()); + } + + static int __init bcm47xx_register_bus_complete(void) diff --git a/target/linux/brcm47xx/patches-3.10/114-MIPS-BCM47xx-Setup-and-register-serial-early.patch b/target/linux/brcm47xx/patches-3.10/114-MIPS-BCM47xx-Setup-and-register-serial-early.patch index 5e324e473b..3972458a95 100644 --- a/target/linux/brcm47xx/patches-3.10/114-MIPS-BCM47xx-Setup-and-register-serial-early.patch +++ b/target/linux/brcm47xx/patches-3.10/114-MIPS-BCM47xx-Setup-and-register-serial-early.patch @@ -22,9 +22,9 @@ Signed-off-by: Hauke Mehrtens +#include +#include #include + #include #include - #include -@@ -121,6 +123,31 @@ static int bcm47xx_get_invariants(struct +@@ -123,6 +125,31 @@ static int bcm47xx_get_invariants(struct return 0; } @@ -56,7 +56,7 @@ Signed-off-by: Hauke Mehrtens static void __init bcm47xx_register_ssb(void) { int err; -@@ -150,6 +177,10 @@ static void __init bcm47xx_register_ssb( +@@ -152,6 +179,10 @@ static void __init bcm47xx_register_ssb( memcpy(&mcore->serial_ports[1], &port, sizeof(port)); } } diff --git a/target/linux/brcm47xx/patches-3.10/116-MIPS-BCM47xx-Remove-CFE-console.patch b/target/linux/brcm47xx/patches-3.10/116-MIPS-BCM47xx-Remove-CFE-console.patch index 1db01f0cbb..ecccd82566 100644 --- a/target/linux/brcm47xx/patches-3.10/116-MIPS-BCM47xx-Remove-CFE-console.patch +++ b/target/linux/brcm47xx/patches-3.10/116-MIPS-BCM47xx-Remove-CFE-console.patch @@ -26,15 +26,17 @@ Signed-off-by: Hauke Mehrtens --- a/arch/mips/bcm47xx/prom.c +++ b/arch/mips/bcm47xx/prom.c -@@ -33,96 +33,28 @@ - #include - #include +@@ -35,8 +35,6 @@ + #include + #include -static int cfe_cons_handle; - + static char bcm47xx_system_type[20] = "Broadcom BCM47XX"; + const char *get_system_type(void) - { - return "Broadcom BCM47XX"; +@@ -52,89 +50,23 @@ __init void bcm47xx_set_system_type(u16 + chip_id); } -void prom_putchar(char c) @@ -130,7 +132,7 @@ Signed-off-by: Hauke Mehrtens } static __init void prom_init_mem(void) -@@ -173,8 +105,6 @@ static __init void prom_init_mem(void) +@@ -185,8 +117,6 @@ static __init void prom_init_mem(void) void __init prom_init(void) { prom_init_cfe(); diff --git a/target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch b/target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch deleted file mode 100644 index f7ec1642f9..0000000000 --- a/target/linux/brcm47xx/patches-3.10/260-MIPS-BCM47XX-add-board-detection.patch +++ /dev/null @@ -1,417 +0,0 @@ ---- a/arch/mips/bcm47xx/Makefile -+++ b/arch/mips/bcm47xx/Makefile -@@ -4,4 +4,5 @@ - # - - obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o -+obj-y += board.o - obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o ---- /dev/null -+++ b/arch/mips/bcm47xx/board.c -@@ -0,0 +1,296 @@ -+#include -+#include -+#include -+#include -+ -+struct bcm47xx_board_type { -+ const enum bcm47xx_board board; -+ const char *name; -+}; -+ -+struct bcm47xx_board_type_list1 { -+ struct bcm47xx_board_type board; -+ const char *value1; -+}; -+ -+struct bcm47xx_board_type_list2 { -+ struct bcm47xx_board_type board; -+ const char *value1; -+ const char *value2; -+}; -+ -+struct bcm47xx_board_type_list3 { -+ struct bcm47xx_board_type board; -+ const char *value1; -+ const char *value2; -+ const char *value3; -+}; -+ -+/* model_name */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] = { -+ {{BCM47XX_BOARD_DLINK_DIR130, "D-Link DIR-130"}, "DIR-130"}, -+ {{BCM47XX_BOARD_DLINK_DIR330, "D-Link DIR-330"}, "DIR-330"}, -+ { {0}, 0}, -+}; -+ -+/* model_no */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] = { -+ {{BCM47XX_BOARD_ASUS_WL700GE, "Asus WL700"}, "WL700"}, -+ { {0}, 0}, -+}; -+ -+/* machine_name */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] = { -+ {{BCM47XX_BOARD_LINKSYS_WRTSL54GS, "Linksys WRTSL54GS"}, "WRTSL54GS"}, -+ { {0}, 0}, -+}; -+ -+/* hardware_version */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] = { -+ {{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_WL500GD, "Asus WL500GD"}, "WL500gd-"}, -+ {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GP V1"}, "WL500gp-"}, -+ {{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_WL520GU, "Asus WL520GU"}, "WL520GU-"}, -+ {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301"}, -+ { {0}, 0}, -+}; -+ -+/* productid */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_productid[] = { -+ {{BCM47XX_BOARD_ASUS_RTAC66U, "Asus RT-AC66U"}, "RT-AC66U"}, -+ {{BCM47XX_BOARD_ASUS_RTN10, "Asus RT-N10"}, "RT-N10"}, -+ {{BCM47XX_BOARD_ASUS_RTN10D, "Asus RT-N10D"}, "RT-N10D"}, -+ {{BCM47XX_BOARD_ASUS_RTN10U, "Asus RT-N10U"}, "RT-N10U"}, -+ {{BCM47XX_BOARD_ASUS_RTN12, "Asus RT-N12"}, "RT-N12"}, -+ {{BCM47XX_BOARD_ASUS_RTN12B1, "Asus RT-N12B1"}, "RT-N12B1"}, -+ {{BCM47XX_BOARD_ASUS_RTN12C1, "Asus RT-N12C1"}, "RT-N12C1"}, -+ {{BCM47XX_BOARD_ASUS_RTN12D1, "Asus RT-N12D1"}, "RT-N12D1"}, -+ {{BCM47XX_BOARD_ASUS_RTN12HP, "Asus RT-N12HP"}, "RT-N12HP"}, -+ {{BCM47XX_BOARD_ASUS_RTN15U, "Asus RT-N15U"}, "RT-N15U"}, -+ {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16"}, -+ {{BCM47XX_BOARD_ASUS_RTN53, "Asus RT-N53"}, "RT-N53"}, -+ {{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}, -+}; -+ -+/* ModelId */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_ModelId[] = { -+ {{BCM47XX_BOARD_DELL_TM2300, "Dell WX-5565"}, "WX-5565"}, -+ {{BCM47XX_BOARD_MOTOROLA_WE800G, "Motorola WE800G"}, "WE800G"}, -+ {{BCM47XX_BOARD_MOTOROLA_WR850GP, "Motorola WR850GP"}, "WR850GP"}, -+ {{BCM47XX_BOARD_MOTOROLA_WR850GV2V3, "Motorola WR850G"}, "WR850G"}, -+ { {0}, 0}, -+}; -+ -+/* melco_id or buf1falo_id */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_melco_id[] = { -+ {{BCM47XX_BOARD_BUFFALO_WBR2_G54, "Buffalo WBR2-G54"}, "29bb0332"}, -+ {{BCM47XX_BOARD_BUFFALO_WHR2_A54G54, "Buffalo WHR2-A54G54"}, "290441dd"}, -+ {{BCM47XX_BOARD_BUFFALO_WHR_G125, "Buffalo WHR-G125"}, "32093"}, -+ {{BCM47XX_BOARD_BUFFALO_WHR_G54S, "Buffalo WHR-G54S"}, "30182"}, -+ {{BCM47XX_BOARD_BUFFALO_WHR_HP_G54, "Buffalo WHR-HP-G54"}, "30189"}, -+ {{BCM47XX_BOARD_BUFFALO_WLA2_G54L, "Buffalo WLA2-G54L"}, "29129"}, -+ {{BCM47XX_BOARD_BUFFALO_WZR_G300N, "Buffalo WZR-G300N"}, "31120"}, -+ {{BCM47XX_BOARD_BUFFALO_WZR_RS_G54, "Buffalo WZR-RS-G54"}, "30083"}, -+ {{BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP, "Buffalo WZR-RS-G54HP"}, "30103"}, -+ { {0}, 0}, -+}; -+ -+/* boot_hw_model, boot_hw_ver */ -+static const struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] = { -+ /* like WRT160N v3.0 */ -+ {{BCM47XX_BOARD_CISCO_M10V1, "Cisco M10"}, "M10", "1.0"}, -+ /* like WRT310N v2.0 */ -+ {{BCM47XX_BOARD_CISCO_M20V1, "Cisco M20"}, "M20", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E900V1, "Linksys E900 V1"}, "E900", "1.0"}, -+ /* like WRT160N v3.0 */ -+ {{BCM47XX_BOARD_LINKSYS_E1000V1, "Linksys E1000 V1"}, "E100", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E1000V2, "Linksys E1000 V2"}, "E1000", "2.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"}, -+ {{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"}, -+ /* like WRT610N v2.0 */ -+ {{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_E4200V1, "Linksys E4200 V1"}, "E4200", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT150NV11, "Linksys WRT150N V1.1"}, "WRT150N", "1.1"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT150NV1, "Linksys WRT150N V1"}, "WRT150N", "1"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT160NV1, "Linksys WRT160N V1"}, "WRT160N", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT160NV3, "Linksys WRT160N V3"}, "WRT160N", "3.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"}, -+ {{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"}, -+ { {0}, 0}, -+}; -+ -+/* board_id */ -+static const struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] = { -+ {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR3400VCNA, "Netgear WNDR3400 Vcna"}, "U12H155T01_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR3700V3, "Netgear WNDR3700 V3"}, "U12H194T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR4000, "Netgear WNDR4000"}, "U12H181T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR4500V1, "Netgear WNDR4500 V1"}, "U12H189T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNDR4500V2, "Netgear WNDR4500 V2"}, "U12H224T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNR2000, "Netgear WNR2000"}, "U12H114T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "U12H136T99_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNR3500U, "Netgear WNR3500U"}, "U12H136T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNR3500V2, "Netgear WNR3500 V2"}, "U12H127T00_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNR3500V2VC, "Netgear WNR3500 V2vc"}, "U12H127T70_NETGEAR"}, -+ {{BCM47XX_BOARD_NETGEAR_WNR834BV2, "Netgear WNR834B V2"}, "U12H081T00_NETGEAR"}, -+ { {0}, 0}, -+}; -+ -+/* boardtype, boardnum, boardrev */ -+static const struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] = { -+ {{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"}, -+ {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, -+ {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"}, -+ { {0}, 0}, -+}; -+ -+static const struct bcm47xx_board_type bcm47xx_board_unknown[] = { -+ {BCM47XX_BOARD_UNKNOWN, "Unknown Board"}, -+}; -+ -+static const struct bcm47xx_board_type bcm47xx_board_no[] = { -+ {BCM47XX_BOARD_NO, "No Board"}, -+}; -+ -+static const struct bcm47xx_board_type *bcm47xx_board = bcm47xx_board_no; -+ -+static const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) -+{ -+ char buf1[30]; -+ char buf2[30]; -+ char buf3[30]; -+ const struct bcm47xx_board_type_list1 *e1; -+ const struct bcm47xx_board_type_list2 *e2; -+ const struct bcm47xx_board_type_list3 *e3; -+ -+ if (bcm47xx_nvram_getenv("model_name", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_model_name; e1->value1; e1++) { -+ if (!strcmp(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("model_no", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_model_no; e1->value1; e1++) { -+ if (strstarts(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("machine_name", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_machine_name; e1->value1; e1++) { -+ if (strstarts(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("hardware_version", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_hardware_version; e1->value1; e1++) { -+ if (strstarts(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("productid", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_productid; e1->value1; e1++) { -+ if (!strcmp(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("ModelId", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_ModelId; e1->value1; e1++) { -+ if (!strcmp(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("melco_id", buf1, sizeof(buf1)) >= 0 || -+ bcm47xx_nvram_getenv("buf1falo_id", buf1, sizeof(buf1)) >= 0) { -+ /* buffalo hardware, check id for specific hardware matches */ -+ for (e1 = bcm47xx_board_list_melco_id; e1->value1; e1++) { -+ if (!strcmp(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("boot_hw_model", buf1, sizeof(buf1)) >= 0 && -+ bcm47xx_nvram_getenv("boot_hw_ver", buf2, sizeof(buf2)) >= 0) { -+ for (e2 = bcm47xx_board_list_boot_hw; e2->value1; e2++) { -+ if (!strcmp(buf1, e2->value1) && -+ !strcmp(buf2, e2->value2)) -+ return &e2->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("board_id", buf1, sizeof(buf1)) >= 0) { -+ for (e1 = bcm47xx_board_list_board_id; e1->value1; e1++) { -+ if (!strcmp(buf1, e1->value1)) -+ return &e1->board; -+ } -+ } -+ -+ if (bcm47xx_nvram_getenv("boardtype", buf1, sizeof(buf1)) >= 0 && -+ bcm47xx_nvram_getenv("boardnum", buf2, sizeof(buf2)) >= 0 && -+ bcm47xx_nvram_getenv("boardrev", buf3, sizeof(buf3)) >= 0) { -+ for (e3 = bcm47xx_board_list_board; e3->value1; e3++) { -+ if (!strcmp(buf1, e3->value1) && -+ !strcmp(buf2, e3->value2) && -+ !strcmp(buf3, e3->value3)) -+ return &e3->board; -+ } -+ } -+ return bcm47xx_board_unknown; -+} -+ -+static void bcm47xx_board_detect(void) -+{ -+ int err; -+ char buf[10]; -+ -+ if (bcm47xx_board != bcm47xx_board_no) -+ return; -+ -+ /* check if the nvram is available */ -+ err = bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)); -+ -+ /* init of nvram failed, probably too early now */ -+ if (err == -ENXIO) { -+ return; -+ } -+ -+ bcm47xx_board = bcm47xx_board_get_nvram(); -+ pr_debug("Found board: \"%s\"\n", bcm47xx_board->name); -+} -+ -+enum bcm47xx_board bcm47xx_board_get(void) -+{ -+ bcm47xx_board_detect(); -+ return bcm47xx_board->board; -+} -+EXPORT_SYMBOL(bcm47xx_board_get); -+ -+const char *bcm47xx_board_get_name(void) -+{ -+ bcm47xx_board_detect(); -+ return bcm47xx_board->name; -+} -+EXPORT_SYMBOL(bcm47xx_board_get_name); ---- /dev/null -+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -@@ -0,0 +1,107 @@ -+#ifndef __BCM47XX_BOARD_H -+#define __BCM47XX_BOARD_H -+ -+enum bcm47xx_board { -+ BCM47XX_BOARD_ASUS_RTAC66U, -+ BCM47XX_BOARD_ASUS_RTN10, -+ BCM47XX_BOARD_ASUS_RTN10D, -+ BCM47XX_BOARD_ASUS_RTN10U, -+ BCM47XX_BOARD_ASUS_RTN12, -+ BCM47XX_BOARD_ASUS_RTN12B1, -+ BCM47XX_BOARD_ASUS_RTN12C1, -+ BCM47XX_BOARD_ASUS_RTN12D1, -+ BCM47XX_BOARD_ASUS_RTN12HP, -+ BCM47XX_BOARD_ASUS_RTN15U, -+ BCM47XX_BOARD_ASUS_RTN16, -+ BCM47XX_BOARD_ASUS_RTN53, -+ BCM47XX_BOARD_ASUS_RTN66U, -+ BCM47XX_BOARD_ASUS_WL300G, -+ BCM47XX_BOARD_ASUS_WL320GE, -+ BCM47XX_BOARD_ASUS_WL330GE, -+ BCM47XX_BOARD_ASUS_WL500GD, -+ BCM47XX_BOARD_ASUS_WL500GPV1, -+ BCM47XX_BOARD_ASUS_WL500GPV2, -+ BCM47XX_BOARD_ASUS_WL500W, -+ BCM47XX_BOARD_ASUS_WL520GC, -+ BCM47XX_BOARD_ASUS_WL520GU, -+ BCM47XX_BOARD_ASUS_WL700GE, -+ BCM47XX_BOARD_ASUS_WLHDD, -+ -+ BCM47XX_BOARD_BELKIN_F7D4301, -+ -+ BCM47XX_BOARD_BUFFALO_WBR2_G54, -+ BCM47XX_BOARD_BUFFALO_WHR2_A54G54, -+ BCM47XX_BOARD_BUFFALO_WHR_G125, -+ BCM47XX_BOARD_BUFFALO_WHR_G54S, -+ BCM47XX_BOARD_BUFFALO_WHR_HP_G54, -+ BCM47XX_BOARD_BUFFALO_WLA2_G54L, -+ BCM47XX_BOARD_BUFFALO_WZR_G300N, -+ BCM47XX_BOARD_BUFFALO_WZR_RS_G54, -+ BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP, -+ -+ BCM47XX_BOARD_CISCO_M10V1, -+ BCM47XX_BOARD_CISCO_M20V1, -+ -+ BCM47XX_BOARD_DELL_TM2300, -+ -+ BCM47XX_BOARD_DLINK_DIR130, -+ BCM47XX_BOARD_DLINK_DIR330, -+ -+ BCM47XX_BOARD_HUAWEI_E970, -+ -+ BCM47XX_BOARD_LINKSYS_E900V1, -+ BCM47XX_BOARD_LINKSYS_E1000V1, -+ BCM47XX_BOARD_LINKSYS_E1000V2, -+ BCM47XX_BOARD_LINKSYS_E1000V21, -+ BCM47XX_BOARD_LINKSYS_E1200V2, -+ BCM47XX_BOARD_LINKSYS_E2000V1, -+ BCM47XX_BOARD_LINKSYS_E3000V1, -+ BCM47XX_BOARD_LINKSYS_E3200V1, -+ BCM47XX_BOARD_LINKSYS_E4200V1, -+ BCM47XX_BOARD_LINKSYS_WRT150NV1, -+ BCM47XX_BOARD_LINKSYS_WRT150NV11, -+ BCM47XX_BOARD_LINKSYS_WRT160NV1, -+ BCM47XX_BOARD_LINKSYS_WRT160NV3, -+ BCM47XX_BOARD_LINKSYS_WRT300NV11, -+ BCM47XX_BOARD_LINKSYS_WRT310NV1, -+ BCM47XX_BOARD_LINKSYS_WRT310NV2, -+ BCM47XX_BOARD_LINKSYS_WRT54G3GV2, -+ BCM47XX_BOARD_LINKSYS_WRT610NV1, -+ BCM47XX_BOARD_LINKSYS_WRT610NV2, -+ BCM47XX_BOARD_LINKSYS_WRTSL54GS, -+ -+ BCM47XX_BOARD_MOTOROLA_WE800G, -+ BCM47XX_BOARD_MOTOROLA_WR850GP, -+ BCM47XX_BOARD_MOTOROLA_WR850GV2V3, -+ -+ BCM47XX_BOARD_NETGEAR_WGR614V8, -+ BCM47XX_BOARD_NETGEAR_WGR614V9, -+ BCM47XX_BOARD_NETGEAR_WNDR3300, -+ BCM47XX_BOARD_NETGEAR_WNDR3400V1, -+ BCM47XX_BOARD_NETGEAR_WNDR3400V2, -+ BCM47XX_BOARD_NETGEAR_WNDR3400VCNA, -+ BCM47XX_BOARD_NETGEAR_WNDR3700V3, -+ BCM47XX_BOARD_NETGEAR_WNDR4000, -+ BCM47XX_BOARD_NETGEAR_WNDR4500V1, -+ BCM47XX_BOARD_NETGEAR_WNDR4500V2, -+ BCM47XX_BOARD_NETGEAR_WNR2000, -+ BCM47XX_BOARD_NETGEAR_WNR3500L, -+ BCM47XX_BOARD_NETGEAR_WNR3500U, -+ BCM47XX_BOARD_NETGEAR_WNR3500V2, -+ BCM47XX_BOARD_NETGEAR_WNR3500V2VC, -+ BCM47XX_BOARD_NETGEAR_WNR834BV2, -+ -+ BCM47XX_BOARD_PHICOMM_M1, -+ -+ BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE, -+ -+ BCM47XX_BOARD_ZTE_H218N, -+ -+ BCM47XX_BOARD_UNKNOWN, -+ BCM47XX_BOARD_NO, -+}; -+ -+enum bcm47xx_board bcm47xx_board_get(void); -+const char *bcm47xx_board_get_name(void); -+ -+#endif /* __BCM47XX_BOARD_H */ diff --git a/target/linux/brcm47xx/patches-3.10/261-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch b/target/linux/brcm47xx/patches-3.10/261-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch deleted file mode 100644 index 63874552d6..0000000000 --- a/target/linux/brcm47xx/patches-3.10/261-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/arch/mips/bcm47xx/prom.c -+++ b/arch/mips/bcm47xx/prom.c -@@ -32,10 +32,35 @@ - #include - #include - #include -+#include -+#include -+ -+static u16 get_chip_id(void) -+{ -+ switch (bcm47xx_bus_type) { -+#ifdef CONFIG_BCM47XX_SSB -+ case BCM47XX_BUS_TYPE_SSB: -+ return bcm47xx_bus.ssb.chip_id; -+#endif -+#ifdef CONFIG_BCM47XX_BCMA -+ case BCM47XX_BUS_TYPE_BCMA: -+ return bcm47xx_bus.bcma.bus.chipinfo.id; -+#endif -+ } -+ return 0; -+} - - const char *get_system_type(void) - { -- return "Broadcom BCM47XX"; -+ static char buf[50]; -+ u16 chip_id = get_chip_id(); -+ -+ snprintf(buf, sizeof(buf), -+ (chip_id > 0x9999) ? "Broadcom BCM%d (%s)" : -+ "Broadcom BCM%04X (%s)", -+ chip_id, bcm47xx_board_get_name()); -+ -+ return buf; - } - - static __init int prom_init_cfe(void) diff --git a/target/linux/brcm47xx/patches-3.10/262-MIPS-BCM47XX-use-init-const-in-board-detect.patch b/target/linux/brcm47xx/patches-3.10/262-MIPS-BCM47XX-use-init-const-in-board-detect.patch deleted file mode 100644 index f7b46288b3..0000000000 --- a/target/linux/brcm47xx/patches-3.10/262-MIPS-BCM47XX-use-init-const-in-board-detect.patch +++ /dev/null @@ -1,189 +0,0 @@ ---- a/arch/mips/bcm47xx/board.c -+++ b/arch/mips/bcm47xx/board.c -@@ -26,27 +26,36 @@ struct bcm47xx_board_type_list3 { - const char *value3; - }; - -+struct bcm47xx_board_store { -+ enum bcm47xx_board board; -+ char name[BCM47XX_BOARD_MAX_NAME]; -+}; -+ - /* model_name */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] __initconst = { - {{BCM47XX_BOARD_DLINK_DIR130, "D-Link DIR-130"}, "DIR-130"}, - {{BCM47XX_BOARD_DLINK_DIR330, "D-Link DIR-330"}, "DIR-330"}, - { {0}, 0}, - }; - - /* model_no */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] __initconst = { - {{BCM47XX_BOARD_ASUS_WL700GE, "Asus WL700"}, "WL700"}, - { {0}, 0}, - }; - - /* machine_name */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] __initconst = { - {{BCM47XX_BOARD_LINKSYS_WRTSL54GS, "Linksys WRTSL54GS"}, "WRTSL54GS"}, - { {0}, 0}, - }; - - /* hardware_version */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] __initconst = { - {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-"}, - {{BCM47XX_BOARD_ASUS_WL320GE, "Asus WL320GE"}, "WL320G-"}, - {{BCM47XX_BOARD_ASUS_WL330GE, "Asus WL330GE"}, "WL330GE-"}, -@@ -61,7 +70,8 @@ static const struct bcm47xx_board_type_l - }; - - /* productid */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_productid[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_productid[] __initconst = { - {{BCM47XX_BOARD_ASUS_RTAC66U, "Asus RT-AC66U"}, "RT-AC66U"}, - {{BCM47XX_BOARD_ASUS_RTN10, "Asus RT-N10"}, "RT-N10"}, - {{BCM47XX_BOARD_ASUS_RTN10D, "Asus RT-N10D"}, "RT-N10D"}, -@@ -81,7 +91,8 @@ static const struct bcm47xx_board_type_l - }; - - /* ModelId */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_ModelId[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_ModelId[] __initconst = { - {{BCM47XX_BOARD_DELL_TM2300, "Dell WX-5565"}, "WX-5565"}, - {{BCM47XX_BOARD_MOTOROLA_WE800G, "Motorola WE800G"}, "WE800G"}, - {{BCM47XX_BOARD_MOTOROLA_WR850GP, "Motorola WR850GP"}, "WR850GP"}, -@@ -90,7 +101,8 @@ static const struct bcm47xx_board_type_l - }; - - /* melco_id or buf1falo_id */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_melco_id[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_melco_id[] __initconst = { - {{BCM47XX_BOARD_BUFFALO_WBR2_G54, "Buffalo WBR2-G54"}, "29bb0332"}, - {{BCM47XX_BOARD_BUFFALO_WHR2_A54G54, "Buffalo WHR2-A54G54"}, "290441dd"}, - {{BCM47XX_BOARD_BUFFALO_WHR_G125, "Buffalo WHR-G125"}, "32093"}, -@@ -104,7 +116,8 @@ static const struct bcm47xx_board_type_l - }; - - /* boot_hw_model, boot_hw_ver */ --static const struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] = { -+static const -+struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = { - /* like WRT160N v3.0 */ - {{BCM47XX_BOARD_CISCO_M10V1, "Cisco M10"}, "M10", "1.0"}, - /* like WRT310N v2.0 */ -@@ -134,7 +147,8 @@ static const struct bcm47xx_board_type_l - }; - - /* board_id */ --static const struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] = { -+static const -+struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = { - {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, - {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"}, - {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"}, -@@ -155,24 +169,22 @@ static const struct bcm47xx_board_type_l - }; - - /* boardtype, boardnum, boardrev */ --static const struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] = { -+static const -+struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = { - {{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"}, - {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, - {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"}, - { {0}, 0}, - }; - --static const struct bcm47xx_board_type bcm47xx_board_unknown[] = { -+static const -+struct bcm47xx_board_type bcm47xx_board_unknown[] __initconst = { - {BCM47XX_BOARD_UNKNOWN, "Unknown Board"}, - }; - --static const struct bcm47xx_board_type bcm47xx_board_no[] = { -- {BCM47XX_BOARD_NO, "No Board"}, --}; -- --static const struct bcm47xx_board_type *bcm47xx_board = bcm47xx_board_no; -+static struct bcm47xx_board_store bcm47xx_board = {BCM47XX_BOARD_NO, "Unknown Board"}; - --static const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) -+static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) - { - char buf1[30]; - char buf2[30]; -@@ -261,12 +273,13 @@ static const struct bcm47xx_board_type * - return bcm47xx_board_unknown; - } - --static void bcm47xx_board_detect(void) -+void __init bcm47xx_board_detect(void) - { - int err; - char buf[10]; -+ const struct bcm47xx_board_type *board_detected; - -- if (bcm47xx_board != bcm47xx_board_no) -+ if (bcm47xx_board.board != BCM47XX_BOARD_NO) - return; - - /* check if the nvram is available */ -@@ -277,20 +290,20 @@ static void bcm47xx_board_detect(void) - return; - } - -- bcm47xx_board = bcm47xx_board_get_nvram(); -- pr_debug("Found board: \"%s\"\n", bcm47xx_board->name); -+ board_detected = bcm47xx_board_get_nvram(); -+ bcm47xx_board.board = board_detected->board; -+ strncpy(bcm47xx_board.name, board_detected->name, BCM47XX_BOARD_MAX_NAME); -+ bcm47xx_board.name[BCM47XX_BOARD_MAX_NAME - 1] = 0; - } - - enum bcm47xx_board bcm47xx_board_get(void) - { -- bcm47xx_board_detect(); -- return bcm47xx_board->board; -+ return bcm47xx_board.board; - } - EXPORT_SYMBOL(bcm47xx_board_get); - - const char *bcm47xx_board_get_name(void) - { -- bcm47xx_board_detect(); -- return bcm47xx_board->name; -+ return bcm47xx_board.name; - } - EXPORT_SYMBOL(bcm47xx_board_get_name); ---- a/arch/mips/bcm47xx/setup.c -+++ b/arch/mips/bcm47xx/setup.c -@@ -252,6 +252,7 @@ void __init plat_mem_setup(void) - _machine_restart = bcm47xx_machine_restart; - _machine_halt = bcm47xx_machine_halt; - pm_power_off = bcm47xx_machine_halt; -+ bcm47xx_board_detect(); - } - - static int __init bcm47xx_register_bus_complete(void) ---- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h -@@ -101,6 +101,9 @@ enum bcm47xx_board { - BCM47XX_BOARD_NO, - }; - -+#define BCM47XX_BOARD_MAX_NAME 30 -+ -+void bcm47xx_board_detect(void); - enum bcm47xx_board bcm47xx_board_get(void); - const char *bcm47xx_board_get_name(void); - diff --git a/target/linux/brcm47xx/patches-3.10/830-huawei_e970_support.patch b/target/linux/brcm47xx/patches-3.10/830-huawei_e970_support.patch index 19adf6ff10..5e8a2cb461 100644 --- a/target/linux/brcm47xx/patches-3.10/830-huawei_e970_support.patch +++ b/target/linux/brcm47xx/patches-3.10/830-huawei_e970_support.patch @@ -1,21 +1,15 @@ --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c -@@ -33,11 +33,13 @@ +@@ -33,6 +33,7 @@ #include #include #include +#include #include + #include #include - #include - #include - #include -+#include - - union bcm47xx_bus bcm47xx_bus; - EXPORT_SYMBOL(bcm47xx_bus); -@@ -255,6 +257,33 @@ void __init plat_mem_setup(void) - bcm47xx_board_detect(); +@@ -260,6 +261,33 @@ void __init plat_mem_setup(void) + mips_set_machine_name(bcm47xx_board_get_name()); } +static struct gpio_wdt_platform_data gpio_wdt_data; @@ -48,7 +42,7 @@ static int __init bcm47xx_register_bus_complete(void) { switch (bcm47xx_bus_type) { -@@ -269,6 +298,8 @@ static int __init bcm47xx_register_bus_c +@@ -274,6 +302,8 @@ static int __init bcm47xx_register_bus_c break; #endif } diff --git a/target/linux/brcm47xx/patches-3.10/980-wnr834b_no_cardbus_invariant.patch b/target/linux/brcm47xx/patches-3.10/980-wnr834b_no_cardbus_invariant.patch index f30a4fbd75..55c7365fef 100644 --- a/target/linux/brcm47xx/patches-3.10/980-wnr834b_no_cardbus_invariant.patch +++ b/target/linux/brcm47xx/patches-3.10/980-wnr834b_no_cardbus_invariant.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c -@@ -122,6 +122,10 @@ static int bcm47xx_get_invariants(struct +@@ -123,6 +123,10 @@ static int bcm47xx_get_invariants(struct if (bcm47xx_nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);