Changeset 31093 for trunk


Ignore:
Timestamp:
2012-03-27T19:07:28+02:00 (4 years ago)
Author:
hauke
Message:

brcm47xx: update sprom patches like they are in the mainline kernel

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

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-3.2/190-ssb-sprom-fix-some-sizes-signedness.patch

    r30638 r31093  
    1 From 0af3fa9e4c9ea0ca0662f09183d71ea9a7eb572f Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 14:33:08 +0100 
    4 Subject: [PATCH 190/202] ssb: sprom fix some sizes / signedness 
    5  
    6 Some parts of the sprom struct are bigger than needed. 
    7 The leddc and maxpwr values are just 8 bit long and not 16. 
    8 rxpo2g and rxpo5g are signed 
    9 antenna_gain is unsigned 
    10  
    11 I got these information for the open source part of the Braodcom SDK 
    12 covering sprom version 1 to 9. rxpo2g contained a negative number on my 
    13 bcm5354 based device, this cased an error and Broadcom SDK says this is 
    14 signed. 
    15  
    16 I was unable to find any reverences to antenna_gain.ghz5 in the 
    17 Broadcom SDK. 
    18  
    19 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    20 --- 
    21  include/linux/ssb/ssb.h |   20 ++++++++++---------- 
    22  1 files changed, 10 insertions(+), 10 deletions(-) 
    23  
    241--- a/include/linux/ssb/ssb.h 
    252+++ b/include/linux/ssb/ssb.h 
     
    6138        u8 rssismc2g; 
    6239        u8 rssismf2g; 
    63 @@ -95,10 +95,10 @@ struct ssb_sprom { 
    64          * loss in the connectors is bigger than the gain. */ 
    65         struct { 
    66                 struct { 
    67 -                       s8 a0, a1, a2, a3; 
    68 +                       u8 a0, a1, a2, a3; 
    69                 } ghz24;        /* 2.4GHz band */ 
    70                 struct { 
    71 -                       s8 a0, a1, a2, a3; 
    72 +                       u8 a0, a1, a2, a3; 
    73                 } ghz5;         /* 5GHz band */ 
    74         } antenna_gain; 
    75   
  • trunk/target/linux/brcm47xx/patches-3.2/192-ssb-fix-per-path-sprom-vars.patch

    r31092 r31093  
    1 From f453c08359a875df66cbbda48087e3592c29da58 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 16:23:58 +0100 
    4 Subject: [PATCH 191/202] ssb: fix per path sprom vars 
    5  
    6 On sprom version 4 and 5 there are 4 values for pa_2g, pa_5gl, pa_5g 
    7 and pa_5gh, for sprom version 8 and 9 there are only 3. Make the per 
    8 path sprom store also work for older sprom versions. 
    9  
    10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    11 --- 
    12  include/linux/ssb/ssb.h |    2 +- 
    13  1 files changed, 1 insertions(+), 1 deletions(-) 
    14  
    151--- a/include/linux/ssb/ssb.h 
    162+++ b/include/linux/ssb/ssb.h 
  • trunk/target/linux/brcm47xx/patches-3.2/194-ssb-add-some-missing-sprom-attributes.patch

    r31092 r31093  
    1 From 91e6ca304fb163e2f9b15188686fc4637f2cd32a Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Fri, 17 Feb 2012 23:26:39 +0100 
    4 Subject: [PATCH 193/202] ssb: add some missing sprom attributes 
    5  
    6 This patch extends the sprom struct to contain all sprom attributes 
    7 found in sprom version 1 to 9. This was done accordingly to the open 
    8 source part of the Braodcom SDK. 
    9  
    10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    11 --- 
    12  include/linux/ssb/ssb.h |   76 ++++++++++++++++++++++++++++++++++++++++++++++- 
    13  1 files changed, 75 insertions(+), 1 deletions(-) 
    141 
    152--- a/include/linux/ssb/ssb.h 
     
    196        u8 et1mdcport;          /* MDIO for enet1 */ 
    207        u16 board_rev;          /* Board revision number from SPROM. */ 
    21 +       u16 board_num; 
    22 +       u16 board_type; 
     8+       u16 board_num;          /* Board number from SPROM. */ 
     9+       u16 board_type;         /* Board type from SPROM. */ 
    2310        u8 country_code;        /* Country Code */ 
     11        char alpha2[2];         /* Country Code as two chars like EU or US */ 
    2412        u8 leddc_on_time;       /* LED Powersave Duty Cycle On Count */ 
    25         u8 leddc_off_time;      /* LED Powersave Duty Cycle Off Count */ 
    2613@@ -112,7 +114,79 @@ struct ssb_sprom { 
    2714                } ghz5; 
  • trunk/target/linux/brcm47xx/patches-3.2/195-bcma-export-bcma_find_core.patch

    r31092 r31093  
    1 From a07c69ed06031373726e9e5e513d0d942997c265 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 14:22:32 +0100 
    4 Subject: [PATCH 194/202] bcma: export bcma_find_core 
    5  
    6 This function is needed by the bcm47xx arch code to get the number of 
    7 the ieee80211 core. 
    8  
    9 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    10 --- 
    11  drivers/bcma/main.c       |    3 ++- 
    12  include/linux/bcma/bcma.h |    1 + 
    13  2 files changed, 3 insertions(+), 1 deletions(-) 
    141 
    152--- a/drivers/bcma/main.c 
  • trunk/target/linux/brcm47xx/patches-3.2/196-bcma-add-support-for-sprom-not-found-on-the-device.patch

    r31092 r31093  
    1 From 332b8f6ca7da3197c631928b6bd1e7fdca87e109 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 01:16:35 +0100 
    4 Subject: [PATCH 195/202] bcma: add support for sprom not found on the device. 
    5  
    6 On SoCs the sprom is stored in the nvram in a special partition on the 
    7 flash chip. The nvram contains the sprom for the main bus, but 
    8 sometimes also for a pci devices using bcma. This patch makes it 
    9 possible for the arch code to register a function to fetch the needed 
    10 sprom from the nvram and provide it to the bcma code. 
    11  
    12 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    13 --- 
    14  drivers/bcma/sprom.c      |   80 ++++++++++++++++++++++++++++++++++++++++---- 
    15  include/linux/bcma/bcma.h |    6 +++ 
    16  2 files changed, 78 insertions(+), 8 deletions(-) 
    171 
    182--- a/drivers/bcma/sprom.c 
    193+++ b/drivers/bcma/sprom.c 
    20 @@ -16,6 +16,49 @@ 
     4@@ -2,6 +2,8 @@ 
     5  * Broadcom specific AMBA 
     6  * SPROM reading 
     7  * 
     8+ * Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de> 
     9+ * 
     10  * Licensed under the GNU/GPL. See COPYING for details. 
     11  */ 
     12  
     13@@ -16,6 +18,45 @@ 
    2114  
    2215 #define SPOFF(offset)  ((offset) / sizeof(u16)) 
     
    2518+ 
    2619+/** 
    27 + * ssb_arch_register_fallback_sprom - Registers a method providing a 
     20+ * bcma_arch_register_fallback_sprom - Registers a method providing a 
    2821+ * fallback SPROM if no SPROM is found. 
    2922+ * 
     
    3225+ * With this function the architecture implementation may register a 
    3326+ * callback handler which fills the SPROM data structure. The fallback is 
    34 + * only used for PCI based SSB devices, where no valid SPROM can be found 
    35 + * in the shadow registers. 
     27+ * used for PCI based BCMA devices, where no valid SPROM can be found 
     28+ * in the shadow registers and to provide the SPROM for SoCs where BCMA is 
     29+ * to controll the system bus. 
    3630+ * 
    3731+ * This function is useful for weird architectures that have a half-assed 
    38 + * SSB device hardwired to their PCI bus. 
    39 + * 
    40 + * Note that it does only work with PCI attached SSB devices. PCMCIA 
    41 + * devices currently don't use this fallback. 
    42 + * Architectures must provide the SPROM for native SSB devices anyway, so 
    43 + * the fallback also isn't used for native devices. 
     32+ * BCMA device hardwired to their PCI bus. 
    4433+ * 
    4534+ * This function is available for architecture code, only. So it is not 
     
    6857  * R/W ops. 
    6958  **************************************************/ 
    70 @@ -205,23 +248,44 @@ static void bcma_sprom_extract_r8(struct 
     59@@ -205,23 +246,43 @@ static void bcma_sprom_extract_r8(struct 
    7160                SSB_SROM8_FEM_ANTSWLUT) >> SSB_SROM8_FEM_ANTSWLUT_SHIFT; 
    7261 } 
     
    8170+       if (bus->drv_cc.core->id.rev >= 32) { 
    8271+               sromctrl = bcma_read32(bus->drv_cc.core, BCMA_CC_SROM_CONTROL); 
    83 +               if (!(sromctrl & BCMA_CC_SROM_CONTROL_PRESENT)) 
    84 +                       return false; 
     72+               return sromctrl & BCMA_CC_SROM_CONTROL_PRESENT; 
    8573+       } 
    8674+       return true; 
     
    10896+                * Maybe there is no SPROM on the device? 
    10997+                * Now we ask the arch code if there is some sprom 
    110 +                * available for this device in some other storage 
     98+                * available for this device in some other storage. 
    11199+                */ 
    112100+               err = bcma_fill_sprom_with_fallback(bus, &bus->sprom); 
  • trunk/target/linux/brcm47xx/patches-3.2/197-MIPS-BCM47XX-return-number-of-written-bytes-in-nvram.patch

    r31092 r31093  
    1 From 3ac18c5072e097ffa719994ef3b5c64e744a5405 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 14:46:45 +0100 
    4 Subject: [PATCH 196/202] MIPS: BCM47XX: return number of written bytes in 
    5  nvram_getenv 
    6  
    7  
    8 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    9 --- 
    10  arch/mips/bcm47xx/nvram.c |    3 +-- 
    11  1 files changed, 1 insertions(+), 2 deletions(-) 
    121 
    132--- a/arch/mips/bcm47xx/nvram.c 
  • trunk/target/linux/brcm47xx/patches-3.2/198-MIPS-BCM47XX-fix-signature-of-nvram_parse_macaddr.patch

    r31092 r31093  
    1 From c330338212785092aab7a266f24b52c132775463 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 15:00:36 +0100 
    4 Subject: [PATCH 197/202] MIPS: BCM47XX: fix signature of nvram_parse_macaddr 
    5  
    6 Explicitly enforce an char array of 6 bytes for the mac address. 
    7  
    8 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    9 --- 
    10  arch/mips/include/asm/mach-bcm47xx/nvram.h |    2 +- 
    11  1 files changed, 1 insertions(+), 1 deletions(-) 
    121 
    132--- a/arch/mips/include/asm/mach-bcm47xx/nvram.h 
  • trunk/target/linux/brcm47xx/patches-3.2/199-MIPS-BCM47XX-move-and-extend-sprom-parsing.patch

    r31092 r31093  
    1 From bf975de39d2c6be28421c1de2068fd8bd018b96d Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Sat, 18 Feb 2012 14:50:24 +0100 
    4 Subject: [PATCH 198/202] MIPS: BCM47XX: move and extend sprom parsing 
    5  
    6 Move the sprom parsing from nvram into sprom.c. There are all values 
    7 needed for sprom version 1 to 9 read from nvram and there are more 
    8 sanity checks added. This is based on the sprom parsing in the open 
    9 source part of the Broadcom SDK. 
    10  
    11 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    12 --- 
    13  arch/mips/bcm47xx/Makefile                   |    2 +- 
    14  arch/mips/bcm47xx/setup.c                    |  151 +------- 
    15  arch/mips/bcm47xx/sprom.c                    |  618 ++++++++++++++++++++++++++ 
    16  arch/mips/include/asm/mach-bcm47xx/bcm47xx.h |    3 + 
    17  4 files changed, 623 insertions(+), 151 deletions(-) 
    18  create mode 100644 arch/mips/bcm47xx/sprom.c 
    19  
    201--- a/arch/mips/bcm47xx/Makefile 
    212+++ b/arch/mips/bcm47xx/Makefile 
     
    189170--- /dev/null 
    190171+++ b/arch/mips/bcm47xx/sprom.c 
    191 @@ -0,0 +1,618 @@ 
     172@@ -0,0 +1,620 @@ 
    192173+/* 
    193174+ *  Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> 
     
    332313+} 
    333314+ 
    334 +static void nvram_read_ccode(const char *prefix, const char *name, 
     315+static void nvram_read_alpha2(const char *prefix, const char *name, 
    335316+                            char (*val)[2]) 
    336317+{ 
     
    347328+               return; 
    348329+       if (strlen(buf) > 2) { 
    349 +               pr_warn("ccode is too long %s", buf); 
     330+               pr_warn("alpha2 is too long %s", buf); 
    350331+               return; 
    351332+       } 
     
    364345+       nvram_read_u8(prefix, NULL, "aa2g", &sprom->ant_available_bg, 0); 
    365346+       nvram_read_u8(prefix, NULL, "aa5g", &sprom->ant_available_a, 0); 
    366 +       nvram_read_u8(prefix, NULL, "ag0", &sprom->antenna_gain.ghz24.a0, 0); 
    367 +       nvram_read_u8(prefix, NULL, "ag1", &sprom->antenna_gain.ghz24.a1, 0); 
    368 +       nvram_read_ccode(prefix, "ccode", &sprom->ccode); 
     347+       nvram_read_s8(prefix, NULL, "ag0", &sprom->antenna_gain.ghz24.a0, 0); 
     348+       nvram_read_s8(prefix, NULL, "ag1", &sprom->antenna_gain.ghz24.a1, 0); 
     349+       nvram_read_alpha2(prefix, "ccode", &sprom->alpha2); 
    369350+} 
    370351+ 
     
    448429+       nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0); 
    449430+       nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0); 
    450 +       nvram_read_u8(prefix, NULL, "ag2", &sprom->antenna_gain.ghz24.a2, 0); 
    451 +       nvram_read_u8(prefix, NULL, "ag3", &sprom->antenna_gain.ghz24.a3, 0); 
     431+       nvram_read_s8(prefix, NULL, "ag2", &sprom->antenna_gain.ghz24.a2, 0); 
     432+       nvram_read_s8(prefix, NULL, "ag3", &sprom->antenna_gain.ghz24.a3, 0); 
    452433+       nvram_read_u8(prefix, NULL, "txchain", &sprom->txchain, 0xf); 
    453434+       nvram_read_u8(prefix, NULL, "rxchain", &sprom->rxchain, 0xf); 
     
    805786+                       " v1\n", sprom->revision); 
    806787+               sprom->revision = 1; 
     788+               bcm47xx_fill_sprom_r1234589(sprom, prefix); 
     789+               bcm47xx_fill_sprom_r12389(sprom, prefix); 
    807790+               bcm47xx_fill_sprom_r1(sprom, prefix); 
    808791+       } 
  • trunk/target/linux/brcm47xx/patches-3.2/200-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch

    r31092 r31093  
    1 From 112b2e12edda60f495b57e8a1d85eb95e2662845 Mon Sep 17 00:00:00 2001 
    2 From: Hauke Mehrtens <hauke@hauke-m.de> 
    3 Date: Thu, 16 Feb 2012 23:44:26 +0100 
    4 Subject: [PATCH 199/202] MIPS: BCM47XX: provide sprom to bcma bus 
    5  
    6 On SoCs the sprom is often stored in nvram in the flashchip. This patch 
    7 registers a sprom fallback callback handler in bcma and provides the 
    8 sprom needed for this device. 
    9  
    10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    11 --- 
    12  arch/mips/bcm47xx/setup.c |   39 +++++++++++++++++++++++++++++++++++---- 
    13  1 files changed, 35 insertions(+), 4 deletions(-) 
    14  
    151--- a/arch/mips/bcm47xx/setup.c 
    162+++ b/arch/mips/bcm47xx/setup.c 
     
    6046+       struct bcma_device *core; 
    6147+ 
    62 +       if (bus->hosttype == BCMA_HOSTTYPE_PCI) { 
     48+       switch (bus->hosttype) { 
     49+       case BCMA_HOSTTYPE_PCI: 
    6350+               snprintf(prefix, sizeof(prefix), "pci/%u/%u/", 
    6451+                        bus->host_pci->bus->number + 1, 
     
    6653+               bcm47xx_fill_sprom(out, prefix); 
    6754+               return 0; 
    68 +       } else if (bus->hosttype == BCMA_HOSTTYPE_SOC) { 
     55+       case BCMA_HOSTTYPE_SOC: 
    6956+               bcm47xx_fill_sprom_ethernet(out, NULL); 
    7057+               core = bcma_find_core(bus, BCMA_CORE_80211); 
     
    7562+               } 
    7663+               return 0; 
    77 +       } else { 
    78 +               printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given bustype.\n"); 
     64+       default: 
     65+               pr_warn("bcm47xx: unable to fill SPROM for given bustype.\n"); 
    7966+               return -EINVAL; 
    8067+       } 
     
    8774+       err = bcma_arch_register_fallback_sprom(&bcm47xx_get_sprom_bcma); 
    8875+       if (err) 
    89 +               printk(KERN_WARNING "bcm47xx: someone else already registered" 
    90 +                       " a bcma SPROM callback handler (err %d)\n", err); 
     76+               pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err); 
    9177+ 
    9278        err = bcma_host_soc_register(&bcm47xx_bus.bcma); 
  • trunk/target/linux/brcm47xx/patches-3.2/231-bcma_reorder_sprom_fill.patch

    r30943 r31093  
    1717  
    1818        if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0) 
    19 @@ -205,12 +207,14 @@ static int bcm47xx_get_sprom_bcma(struct 
    20         struct bcma_device *core; 
     19@@ -206,12 +208,14 @@ static int bcm47xx_get_sprom_bcma(struct 
    2120  
    22         if (bus->hosttype == BCMA_HOSTTYPE_PCI) { 
     21        switch (bus->hosttype) { 
     22        case BCMA_HOSTTYPE_PCI: 
    2323+               memset(out, 0, sizeof(struct ssb_sprom)); 
    2424                snprintf(prefix, sizeof(prefix), "pci/%u/%u/", 
     
    2727                bcm47xx_fill_sprom(out, prefix); 
    2828                return 0; 
    29         } else if (bus->hosttype == BCMA_HOSTTYPE_SOC) { 
     29        case BCMA_HOSTTYPE_SOC: 
    3030+               memset(out, 0, sizeof(struct ssb_sprom)); 
    3131                bcm47xx_fill_sprom_ethernet(out, NULL); 
Note: See TracChangeset for help on using the changeset viewer.