Changeset 38308


Ignore:
Timestamp:
2013-10-07T01:51:24+02:00 (4 years ago)
Author:
hauke
Message:

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 <hauke@…>

Location:
trunk/target/linux/brcm47xx/patches-3.10
Files:
2 added
1 deleted
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-3.10/070-MIPS-BCM47XX-add-board-detection.patch

    r38307 r38308  
     1commit 74370cf83baefceb83f5f4b7ff5c8e19e7056632 
     2Author: Hauke Mehrtens <hauke@hauke-m.de> 
     3Date:   Wed Sep 18 13:29:57 2013 +0200 
     4 
     5    MIPS: BCM47XX: Add board detection 
     6     
     7    Detect on which board this code is running based on some nvram 
     8    settings. This is needed to start board specific workarounds and 
     9    configure the leds and buttons which are on different gpios on every board. 
     10     
     11    This patches add some boards we have seen, but there are many more. 
     12     
     13    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
     14    Cc: linux-mips@linux-mips.org 
     15    Patchwork: https://patchwork.linux-mips.org/patch/5840 
     16    Patchwork: https://patchwork.linux-mips.org/patch/5855/ 
     17    Signed-off-by: Ralf Baechle <ralf@linux-mips.org> 
     18 
    119--- a/arch/mips/bcm47xx/Makefile 
    220+++ b/arch/mips/bcm47xx/Makefile 
     
    927--- /dev/null 
    1028+++ b/arch/mips/bcm47xx/board.c 
    11 @@ -0,0 +1,296 @@ 
     29@@ -0,0 +1,309 @@ 
    1230+#include <linux/export.h> 
    1331+#include <linux/string.h> 
     
    3856+}; 
    3957+ 
     58+struct bcm47xx_board_store { 
     59+       enum bcm47xx_board board; 
     60+       char name[BCM47XX_BOARD_MAX_NAME]; 
     61+}; 
     62+ 
    4063+/* model_name */ 
    41 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] = { 
     64+static const 
     65+struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] __initconst = { 
    4266+       {{BCM47XX_BOARD_DLINK_DIR130, "D-Link DIR-130"}, "DIR-130"}, 
    4367+       {{BCM47XX_BOARD_DLINK_DIR330, "D-Link DIR-330"}, "DIR-330"}, 
     
    4670+ 
    4771+/* model_no */ 
    48 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] = { 
     72+static const 
     73+struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] __initconst = { 
    4974+       {{BCM47XX_BOARD_ASUS_WL700GE, "Asus WL700"}, "WL700"}, 
    5075+       { {0}, 0}, 
     
    5277+ 
    5378+/* machine_name */ 
    54 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] = { 
     79+static const 
     80+struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] __initconst = { 
    5581+       {{BCM47XX_BOARD_LINKSYS_WRTSL54GS, "Linksys WRTSL54GS"}, "WRTSL54GS"}, 
    5682+       { {0}, 0}, 
     
    5884+ 
    5985+/* hardware_version */ 
    60 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] = { 
     86+static const 
     87+struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] __initconst = { 
    6188+       {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-"}, 
    6289+       {{BCM47XX_BOARD_ASUS_WL320GE, "Asus WL320GE"}, "WL320G-"}, 
     
    73100+ 
    74101+/* productid */ 
    75 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_productid[] = { 
     102+static const 
     103+struct bcm47xx_board_type_list1 bcm47xx_board_list_productid[] __initconst = { 
    76104+       {{BCM47XX_BOARD_ASUS_RTAC66U, "Asus RT-AC66U"}, "RT-AC66U"}, 
    77105+       {{BCM47XX_BOARD_ASUS_RTN10, "Asus RT-N10"}, "RT-N10"}, 
     
    93121+ 
    94122+/* ModelId */ 
    95 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_ModelId[] = { 
     123+static const 
     124+struct bcm47xx_board_type_list1 bcm47xx_board_list_ModelId[] __initconst = { 
    96125+       {{BCM47XX_BOARD_DELL_TM2300, "Dell WX-5565"}, "WX-5565"}, 
    97126+       {{BCM47XX_BOARD_MOTOROLA_WE800G, "Motorola WE800G"}, "WE800G"}, 
     
    102131+ 
    103132+/* melco_id or buf1falo_id */ 
    104 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_melco_id[] = { 
     133+static const 
     134+struct bcm47xx_board_type_list1 bcm47xx_board_list_melco_id[] __initconst = { 
    105135+       {{BCM47XX_BOARD_BUFFALO_WBR2_G54, "Buffalo WBR2-G54"}, "29bb0332"}, 
    106136+       {{BCM47XX_BOARD_BUFFALO_WHR2_A54G54, "Buffalo WHR2-A54G54"}, "290441dd"}, 
     
    116146+ 
    117147+/* boot_hw_model, boot_hw_ver */ 
    118 +static const struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] = { 
     148+static const 
     149+struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = { 
    119150+       /* like WRT160N v3.0 */ 
    120151+       {{BCM47XX_BOARD_CISCO_M10V1, "Cisco M10"}, "M10", "1.0"}, 
     
    146177+ 
    147178+/* board_id */ 
    148 +static const struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] = { 
     179+static const 
     180+struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = { 
    149181+       {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, 
    150182+       {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"}, 
     
    167199+ 
    168200+/* boardtype, boardnum, boardrev */ 
    169 +static const struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] = { 
     201+static const 
     202+struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = { 
    170203+       {{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"}, 
    171204+       {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, 
     
    174207+}; 
    175208+ 
    176 +static const struct bcm47xx_board_type bcm47xx_board_unknown[] = { 
     209+static const 
     210+struct bcm47xx_board_type bcm47xx_board_unknown[] __initconst = { 
    177211+       {BCM47XX_BOARD_UNKNOWN, "Unknown Board"}, 
    178212+}; 
    179213+ 
    180 +static const struct bcm47xx_board_type bcm47xx_board_no[] = { 
    181 +       {BCM47XX_BOARD_NO, "No Board"}, 
    182 +}; 
    183 + 
    184 +static const struct bcm47xx_board_type *bcm47xx_board = bcm47xx_board_no; 
    185 + 
    186 +static const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) 
     214+static struct bcm47xx_board_store bcm47xx_board = {BCM47XX_BOARD_NO, "Unknown Board"}; 
     215+ 
     216+static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) 
    187217+{ 
    188218+       char buf1[30]; 
     
    273303+} 
    274304+ 
    275 +static void bcm47xx_board_detect(void) 
     305+void __init bcm47xx_board_detect(void) 
    276306+{ 
    277307+       int err; 
    278308+       char buf[10]; 
    279 + 
    280 +       if (bcm47xx_board != bcm47xx_board_no) 
     309+       const struct bcm47xx_board_type *board_detected; 
     310+ 
     311+       if (bcm47xx_board.board != BCM47XX_BOARD_NO) 
    281312+               return; 
    282313+ 
     
    289320+       } 
    290321+ 
    291 +       bcm47xx_board = bcm47xx_board_get_nvram(); 
    292 +       pr_debug("Found board: \"%s\"\n", bcm47xx_board->name); 
     322+       board_detected = bcm47xx_board_get_nvram(); 
     323+       bcm47xx_board.board = board_detected->board; 
     324+       strlcpy(bcm47xx_board.name, board_detected->name, 
     325+               BCM47XX_BOARD_MAX_NAME); 
    293326+} 
    294327+ 
    295328+enum bcm47xx_board bcm47xx_board_get(void) 
    296329+{ 
    297 +       bcm47xx_board_detect(); 
    298 +       return bcm47xx_board->board; 
     330+       return bcm47xx_board.board; 
    299331+} 
    300332+EXPORT_SYMBOL(bcm47xx_board_get); 
     
    302334+const char *bcm47xx_board_get_name(void) 
    303335+{ 
    304 +       bcm47xx_board_detect(); 
    305 +       return bcm47xx_board->name; 
     336+       return bcm47xx_board.name; 
    306337+} 
    307338+EXPORT_SYMBOL(bcm47xx_board_get_name); 
     339--- a/arch/mips/bcm47xx/setup.c 
     340+++ b/arch/mips/bcm47xx/setup.c 
     341@@ -36,6 +36,7 @@ 
     342 #include <asm/time.h> 
     343 #include <bcm47xx.h> 
     344 #include <bcm47xx_nvram.h> 
     345+#include <bcm47xx_board.h> 
     346  
     347 union bcm47xx_bus bcm47xx_bus; 
     348 EXPORT_SYMBOL(bcm47xx_bus); 
     349@@ -221,6 +222,7 @@ void __init plat_mem_setup(void) 
     350        _machine_restart = bcm47xx_machine_restart; 
     351        _machine_halt = bcm47xx_machine_halt; 
     352        pm_power_off = bcm47xx_machine_halt; 
     353+       bcm47xx_board_detect(); 
     354 } 
     355  
     356 static int __init bcm47xx_register_bus_complete(void) 
    308357--- /dev/null 
    309358+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h 
    310 @@ -0,0 +1,107 @@ 
     359@@ -0,0 +1,110 @@ 
    311360+#ifndef __BCM47XX_BOARD_H 
    312361+#define __BCM47XX_BOARD_H 
     
    412461+}; 
    413462+ 
     463+#define BCM47XX_BOARD_MAX_NAME 30 
     464+ 
     465+void bcm47xx_board_detect(void); 
    414466+enum bcm47xx_board bcm47xx_board_get(void); 
    415467+const char *bcm47xx_board_get_name(void); 
  • trunk/target/linux/brcm47xx/patches-3.10/071-MIPS-BCM47XX-print-board-name-in-proc-cpuinfo.patch

    r38307 r38308  
     1commit 7ad3b82f9d80ef8919dcfdfe7561e1a83e09c6bd 
     2Author: Hauke Mehrtens <hauke@hauke-m.de> 
     3Date:   Wed Sep 18 13:29:58 2013 +0200 
     4 
     5    MIPS: BCM47XX: Print board name in /proc/cpuinfo 
     6     
     7    Do not print the constant system type "Broadcom BCM47XX" but print the 
     8    name of the actual SoC in use and the detected board. 
     9     
     10    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
     11    Cc: linux-mips@linux-mips.org 
     12    Patchwork: https://patchwork.linux-mips.org/patch/5839/ 
     13    Signed-off-by: Ralf Baechle <ralf@linux-mips.org> 
     14 
    115--- a/arch/mips/bcm47xx/prom.c 
    216+++ b/arch/mips/bcm47xx/prom.c 
    3 @@ -32,10 +32,35 @@ 
     17@@ -32,12 +32,37 @@ 
    418 #include <asm/bootinfo.h> 
    519 #include <asm/fw/cfe/cfe_api.h> 
     
    721+#include <bcm47xx.h> 
    822+#include <bcm47xx_board.h> 
    9 + 
     23  
     24 static int cfe_cons_handle; 
     25  
    1026+static u16 get_chip_id(void) 
    1127+{ 
     
    2238+       return 0; 
    2339+} 
    24   
     40+ 
    2541 const char *get_system_type(void) 
    2642 { 
     
    3753 } 
    3854  
    39  static __init int prom_init_cfe(void) 
     55 void prom_putchar(char c) 
  • trunk/target/linux/brcm47xx/patches-3.10/114-MIPS-BCM47xx-Setup-and-register-serial-early.patch

    r37287 r38308  
    2323+#include <linux/serial_8250.h> 
    2424 #include <asm/bootinfo.h> 
     25 #include <asm/prom.h> 
    2526 #include <asm/reboot.h> 
    26  #include <asm/time.h> 
    27 @@ -121,6 +123,31 @@ static int bcm47xx_get_invariants(struct 
     27@@ -123,6 +125,31 @@ static int bcm47xx_get_invariants(struct 
    2828        return 0; 
    2929 } 
     
    5757 { 
    5858        int err; 
    59 @@ -150,6 +177,10 @@ static void __init bcm47xx_register_ssb( 
     59@@ -152,6 +179,10 @@ static void __init bcm47xx_register_ssb( 
    6060                        memcpy(&mcore->serial_ports[1], &port, sizeof(port)); 
    6161                } 
  • trunk/target/linux/brcm47xx/patches-3.10/116-MIPS-BCM47xx-Remove-CFE-console.patch

    r37832 r38308  
    2727--- a/arch/mips/bcm47xx/prom.c 
    2828+++ b/arch/mips/bcm47xx/prom.c 
    29 @@ -33,96 +33,28 @@ 
    30  #include <asm/fw/cfe/cfe_api.h> 
    31  #include <asm/fw/cfe/cfe_error.h> 
     29@@ -35,8 +35,6 @@ 
     30 #include <bcm47xx.h> 
     31 #include <bcm47xx_board.h> 
    3232  
    3333-static int cfe_cons_handle; 
    3434- 
     35 static char bcm47xx_system_type[20] = "Broadcom BCM47XX"; 
     36  
    3537 const char *get_system_type(void) 
    36  { 
    37         return "Broadcom BCM47XX"; 
     38@@ -52,89 +50,23 @@ __init void bcm47xx_set_system_type(u16 
     39                 chip_id); 
    3840 } 
    3941  
     
    131133  
    132134 static __init void prom_init_mem(void) 
    133 @@ -173,8 +105,6 @@ static __init void prom_init_mem(void) 
     135@@ -185,8 +117,6 @@ static __init void prom_init_mem(void) 
    134136 void __init prom_init(void) 
    135137 { 
  • trunk/target/linux/brcm47xx/patches-3.10/830-huawei_e970_support.patch

    r38036 r38308  
    11--- a/arch/mips/bcm47xx/setup.c 
    22+++ b/arch/mips/bcm47xx/setup.c 
    3 @@ -33,11 +33,13 @@ 
     3@@ -33,6 +33,7 @@ 
    44 #include <linux/bcma/bcma_soc.h> 
    55 #include <linux/serial.h> 
     
    77+#include <linux/gpio_wdt.h> 
    88 #include <asm/bootinfo.h> 
     9 #include <asm/prom.h> 
    910 #include <asm/reboot.h> 
    10  #include <asm/time.h> 
    11  #include <bcm47xx.h> 
    12  #include <bcm47xx_nvram.h> 
    13 +#include <bcm47xx_board.h> 
    14   
    15  union bcm47xx_bus bcm47xx_bus; 
    16  EXPORT_SYMBOL(bcm47xx_bus); 
    17 @@ -255,6 +257,33 @@ void __init plat_mem_setup(void) 
    18         bcm47xx_board_detect(); 
     11@@ -260,6 +261,33 @@ void __init plat_mem_setup(void) 
     12        mips_set_machine_name(bcm47xx_board_get_name()); 
    1913 } 
    2014  
     
    4943 { 
    5044        switch (bcm47xx_bus_type) { 
    51 @@ -269,6 +298,8 @@ static int __init bcm47xx_register_bus_c 
     45@@ -274,6 +302,8 @@ static int __init bcm47xx_register_bus_c 
    5246                break; 
    5347 #endif 
  • trunk/target/linux/brcm47xx/patches-3.10/980-wnr834b_no_cardbus_invariant.patch

    r38011 r38308  
    11--- a/arch/mips/bcm47xx/setup.c 
    22+++ b/arch/mips/bcm47xx/setup.c 
    3 @@ -122,6 +122,10 @@ static int bcm47xx_get_invariants(struct 
     3@@ -123,6 +123,10 @@ static int bcm47xx_get_invariants(struct 
    44        if (bcm47xx_nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) 
    55                iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10); 
Note: See TracChangeset for help on using the changeset viewer.