Avoid getting a new mac address each time the sprom is checked.
Added array parenthesis.
Added pr_fmt().

Signed-off-by: Álvaro Fernández Rojas <nolt...@gmail.com>

Index: target/linux/brcm63xx/config-3.3
===================================================================
--- target/linux/brcm63xx/config-3.3    (revisión: 32911)
+++ target/linux/brcm63xx/config-3.3    (copia de trabajo)
@@ -15,6 +15,12 @@
 CONFIG_BCM63XX_ENET=y
 CONFIG_BCM63XX_PHY=y
 CONFIG_BCM63XX_WDT=y
+CONFIG_BCMA=y
+CONFIG_BCMA_DEBUG=y
+CONFIG_BCMA_DRIVER_MIPS=y
+CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y
+CONFIG_BCMA_HOST_PCI=y
+CONFIG_BCMA_HOST_PCI_POSSIBLE=y
 CONFIG_BCMA_POSSIBLE=y
 CONFIG_BOARD_BCM963XX=y
 # CONFIG_BOARD_LIVEBOX is not set
Index: target/linux/brcm63xx/patches-3.3/901-bcm63xx_bcma_sprom.patch
===================================================================
--- target/linux/brcm63xx/patches-3.3/901-bcm63xx_bcma_sprom.patch      
(revisión: 0)
+++ target/linux/brcm63xx/patches-3.3/901-bcm63xx_bcma_sprom.patch      
(revisión: 0)
@@ -0,0 +1,891 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -35,6 +35,7 @@
+ #include <bcm63xx_dev_spi.h>
+ #include <bcm63xx_dev_usb_ohci.h>
+ #include <bcm63xx_dev_usb_ehci.h>
++#include <bcm63xx_sprom_bcma.h>
+ #include <board_bcm963xx.h>
+ #include <bcm_tag.h>
+ #include <pci_ath9k_fixup.h>
+@@ -3220,6 +3221,14 @@ int __init board_register_devices(void)
+                       pr_err(PFX "failed to register fallback SPROM\n");
+       }
+ #endif
++
++#ifdef CONFIG_BCMA_HOST_PCI
++      if (!board.has_caldata &&
++              bcma_arch_register_fallback_sprom(
++              &bcm63xx_get_bcma_fallback_sprom) < 0)
++              pr_err(PFX "failed to register BCMA fallback SPROM\n");
++#endif
++
+       bcm63xx_hsspi_register();
+
+       bcm63xx_spi_register();
+--- a/arch/mips/bcm63xx/Makefile
++++ b/arch/mips/bcm63xx/Makefile
+@@ -3,5 +3,6 @@ obj-y          += clk.o cpu.o cs.o gpio.o irq.o
+                  dev-pcmcia.o dev-rng.o dev-spi.o dev-uart.o dev-usb-ehci.o \
+                  dev-usb-ohci.o dev-wdt.o pci-ath9k-fixup.o
+ obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
++obj-$(CONFIG_BCMA)                    += sprom_bcma.o
+
+ obj-y         += boards/
+--- /dev/null
++++ b/arch/mips/bcm63xx/sprom_bcma.c
+@@ -0,0 +1,70 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License.  See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 2012 Álvaro Fernández Rojas <nolt...@gmail.com>
++ */
++
++#define pr_fmt(fmt) "bcm63xx_sprom_bcma: " fmt
++
++#include <linux/if_ether.h>
++
++#include <bcm63xx_sprom_bcma.h>
++#include <bcm63xx_sprom_bcma_defs.h>
++#include <bcm63xx_nvram.h>
++
++int bcm63xx_get_bcma_fallback_sprom(struct bcma_bus *bus, struct ssb_sprom 
*out)
++{
++      if (bus->hosttype == BCMA_HOSTTYPE_PCI) {
++              /* Copy SPROM params. */
++              switch (bus->chipinfo.id) {
++              case BCMA_CHIP_ID_BCM4313:
++                      memcpy(out, &bcm4313_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM4331:
++                      memcpy(out, &bcm4331_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM6362:
++                      memcpy(out, &bcm6362_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM43224:
++                      memcpy(out, &bcm43224_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM43225:
++                      memcpy(out, &bcm43225_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM43227:
++                      memcpy(out, &bcm43227_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM43228:
++                      memcpy(out, &bcm43228_sprom, sizeof(struct ssb_sprom));
++                      break;
++              case BCMA_CHIP_ID_BCM43428:
++                      memcpy(out, &bcm43428_sprom, sizeof(struct ssb_sprom));
++                      break;
++              default:
++                      pr_err("unable to fill BCMA fallback "
++                              "SPROM for chip id 0x%x\n", bus->chipinfo.id);
++                      return -EINVAL;
++              }
++
++              pr_info("filled BCMA SPROM for chip id 0x%x\n", 
bus->chipinfo.id);
++
++              /* Get MAC address. */
++              if (bcm63xx_nvram_get_sprom_mac_address(
++                      PCI_FUNC(bus->host_pci->devfn),
++                      PCI_SLOT(bus->host_pci->devfn),
++                      out->il0mac)) {
++                      pr_err("failed to get mac address\n");
++                      return -EINVAL;
++              }
++              memcpy(out->et0mac, out->il0mac, ETH_ALEN);
++              memcpy(out->et1mac, out->il0mac, ETH_ALEN);
++
++              return 0;
++      } else {
++              pr_err("unable to fill fallback SPROM for given hosttype\n");
++              return -EINVAL;
++      }
++}
+--- /dev/null
++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_sprom_bcma_defs.h
+@@ -0,0 +1,769 @@
++#ifndef BCM63XX_SPROM_BCMA_DEFS_H_
++#define BCM63XX_SPROM_BCMA_DEFS_H_
++
++static struct ssb_sprom bcm4313_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1215,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .boardflags_lo          = 0x2a00,
++      .boardflags_hi          = 0x800,
++      .boardflags2_lo         = 0x800,
++      .core_pwr_info = {
++              {
++                      .maxpwr_2g      = 0x44,
++                      .pa_2g          = { 0x1684, 0xfd0d, 0xff35, 0xffff },
++              },
++              {
++                      .maxpwr_2g      = 0x48,
++                      .pa_2g          = { 0xfed2, 0x15d9, 0xfac6, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .tr_iso         = 0x2,
++              },
++      },
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x44,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0xff,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0x88,
++      .rssismf2g                      = 0xa,
++      .rssismc2g                      = 0x7,
++      .pa0b0                          = 0x1684,
++      .pa0b1                          = 0xfd0d,
++      .pa0b2                          = 0xff35,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0xff,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x1,
++      .rxchain                        = 0x1,
++      .rawtempsense           = 0xa,
++      .measpower                      = 0x3e,
++      .tempsense_slope        = 0x98,
++      .tempsense_option       = 0x3,
++      .freqoffset_corr        = 0x8,
++      .tempthresh                     = 0x78,
++};
++
++static struct ssb_sprom bcm4331_sprom = {
++      .revision                       = 0x9,
++      .board_rev                      = 0x1104,
++      .txpid2g                        = { 0x0, 0x80, 0x2, 0x0 },
++      .txpid5gl                       = { 0x0, 0x18, 0x0, 0x0 },
++      .txpid5g                        = { 0x0, 0x0, 0x30, 0x1f },
++      .txpid5gh                       = { 0x0, 0x0, 0xff, 0xff },
++      .boardflags_lo          = 0x200,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x48,
++                      .pa_2g          = { 0xfe56, 0x16f2, 0xfa44, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x3c,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x3c,
++                      .pa_5gl         = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5g          = { 0xfe77, 0x1657, 0xfa75, 0xffff },
++                      .pa_5gh         = { 0xfe76, 0x15da, 0xfa85, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x48,
++                      .pa_2g          = { 0xfe5c, 0x16b5, 0xfa56, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x3c,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x3c,
++                      .pa_5gl         = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5g          = { 0xfe7c, 0x169d, 0xfa6b, 0xffff },
++                      .pa_5gh         = { 0xfe7a, 0x1597, 0xfa97, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x48,
++                      .pa_2g          = { 0xfe68, 0x1734, 0xfa46, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x3c,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x3c,
++                      .pa_5gl         = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5g          = { 0xfe7f, 0x15e4, 0xfa94, 0xffff },
++                      .pa_5gh         = { 0xfe7d, 0x1582, 0xfa9f, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x4,
++                      .tr_iso         = 0x3,
++              },
++              .ghz5 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x4,
++                      .tr_iso         = 0x3,
++              },
++      },
++      .ant_available_a        = 0x7,
++      .ant_available_bg       = 0x7,
++      .maxpwr_bg                      = 0x48,
++      .itssi_bg                       = 0x20,
++      .maxpwr_a                       = 0x3c,
++      .itssi_a                        = 0x3e,
++      .maxpwr_ah                      = 0x3c,
++      .maxpwr_al                      = 0x3c,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0xff,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0x88,
++      .tri2g                          = 0xff,
++      .tri5g                          = 0xff,
++      .tri5gl                         = 0xff,
++      .tri5gh                         = 0xff,
++      .rxpo2g                         = 0xff,
++      .rxpo5g                         = 0xff,
++      .rssismf2g                      = 0xf,
++      .rssismc2g                      = 0xf,
++      .rssisav2g                      = 0x7,
++      .bxa2g                          = 0x3,
++      .rssismf5g                      = 0xf,
++      .rssismc5g                      = 0xf,
++      .rssisav5g                      = 0x7,
++      .bxa5g                          = 0x3,
++      .pa0b0                          = 0xfe56,
++      .pa0b1                          = 0x16f2,
++      .pa0b2                          = 0xfa44,
++      .pa1b0                          = 0xfe77,
++      .pa1b1                          = 0x1657,
++      .pa1b2                          = 0xfa75,
++      .pa1lob0                        = 0xffff,
++      .pa1lob1                        = 0xffff,
++      .pa1lob2                        = 0xffff,
++      .pa1hib0                        = 0xfe76,
++      .pa1hib1                        = 0x15da,
++      .pa1hib2                        = 0xfa85,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0x2,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x7,
++      .rxchain                        = 0x7,
++      .rawtempsense           = 0x1ff,
++      .measpower                      = 0x7f,
++      .tempsense_slope        = 0xff,
++      .tempcorrx                      = 0x3f,
++      .tempsense_option       = 0x3,
++      .freqoffset_corr        = 0xf,
++      .iqcal_swp_dis          = 0x1,
++      .hw_iqcal_en            = 0x1,
++      .bwduppo                        = 0xffff,
++      .tempthresh                     = 0xff,
++      .tempoffset                     = 0xff,
++      .phycal_tempdelta       = 0xff,
++      .temps_period           = 0xf,
++      .temps_hysteresis       = 0xf,
++};
++
++static struct ssb_sprom bcm6362_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1102,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .txpid5gh                       = { 0, 0, 0xff, 0xff },
++      .boardflags_lo          = 0x200,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x54,
++                      .pa_2g          = { 0xfe97, 0x189e, 0xfa0c, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x30,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x40,
++                      .pa_5gl         = { 0xfea2, 0x149a, 0xfafc, 0xffff },
++                      .pa_5g          = { 0xff43, 0x1317, 0xfb23, 0xffff },
++                      .pa_5gh         = { 0xff43, 0x1317, 0xfb23, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x54,
++                      .pa_2g          = { 0xfe8b, 0x187b, 0xfa0a, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x30,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x40,
++                      .pa_5gl         = { 0xfebe, 0x1478, 0xfb1a, 0xffff },
++                      .pa_5g          = { 0xff80, 0x12f0, 0xfb15, 0xffff },
++                      .pa_5gh         = { 0xff80, 0x12f0, 0xfb15, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x1,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x3,
++              },
++              .ghz5 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x1,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x3,
++              },
++      },
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x54,
++      .itssi_bg                       = 0x20,
++      .maxpwr_a                       = 0x30,
++      .itssi_a                        = 0x3e,
++      .maxpwr_ah                      = 0x3c,
++      .maxpwr_al                      = 0x40,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0xff,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0xff,
++      .tri2g                          = 0xff,
++      .tri5g                          = 0xff,
++      .tri5gl                         = 0xff,
++      .tri5gh                         = 0xff,
++      .rxpo2g                         = 0xff,
++      .rxpo5g                         = 0xff,
++      .rssismf2g                      = 0xf,
++      .rssismc2g                      = 0xf,
++      .rssisav2g                      = 0x7,
++      .bxa2g                          = 0x3,
++      .rssismf5g                      = 0xf,
++      .rssismc5g                      = 0xf,
++      .rssisav5g                      = 0x7,
++      .bxa5g                          = 0x3,
++      .pa0b0                          = 0xfe97,
++      .pa0b1                          = 0x189e,
++      .pa0b2                          = 0xfa0c,
++      .pa1b0                          = 0xff43,
++      .pa1b1                          = 0x1317,
++      .pa1b2                          = 0xfb23,
++      .pa1lob0                        = 0xfea2,
++      .pa1lob1                        = 0x149a,
++      .pa1lob2                        = 0xfafc,
++      .pa1hib0                        = 0xff43,
++      .pa1hib1                        = 0x1317,
++      .pa1hib2                        = 0xfb23,
++      .ofdm2gpo                       = 0x4444,
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x3,
++      .rxchain                        = 0x3,
++      .opo                            = 0x44,
++      .mcs2gpo                        = { 0x4444, 0x4444, 0x4444, 0x4444,
++               0, 0, 0, 0 },
++      .rawtempsense           = 0x1ff,
++      .measpower                      = 0x7f,
++      .tempsense_slope        = 0xff,
++      .tempcorrx                      = 0x3f,
++      .tempsense_option       = 0x3,
++      .freqoffset_corr        = 0xf,
++      .iqcal_swp_dis          = 0x1,
++      .hw_iqcal_en            = 0x1,
++      .bw40po                         = 0x6,
++      .tempthresh                     = 0x78,
++      .phycal_tempdelta       = 0xff,
++      .temps_period           = 0xf,
++      .temps_hysteresis       = 0xf,
++};
++
++static struct ssb_sprom bcm43224_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1188,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .txpid5gh                       = { 0, 0, 0xff, 0xff },
++      .boardflags_lo          = 0x200,
++      .boardflags2_lo         = 0x1000,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xfed1, 0x163d, 0xfab9, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x40,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x3a,
++                      .pa_5gl         = { 0xfe87, 0x1637, 0xfa8e, 0xffff },
++                      .pa_5g          = { 0xfecd, 0x1417, 0xfaf6, 0xffff },
++                      .pa_5gh         = { 0xfedc, 0x14cb, 0xfaef, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xfed2, 0x1699, 0xfaaa, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x40,
++                      .maxpwr_5gh     = 0x3c,
++                      .maxpwr_5gl     = 0x3a,
++                      .pa_5gl         = { 0xfe9a, 0x1591, 0xfabc, 0xffff },
++                      .pa_5g          = { 0xfe9d, 0x1334, 0xfb08, 0xffff },
++                      .pa_5gh         = { 0xfeb2, 0x143b, 0xfaeb, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x4,
++                      .tr_iso         = 0x3,
++              },
++              .ghz5 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x4,
++                      .tr_iso         = 0x3,
++              },
++      },
++      .ant_available_a        = 0x3,
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x4c,
++      .itssi_bg                       = 0x20,
++      .maxpwr_a                       = 0x40,
++      .itssi_a                        = 0x3e,
++      .maxpwr_ah                      = 0x3c,
++      .maxpwr_al                      = 0x3a,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0x88,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0xff,
++      .tri2g                          = 0xff,
++      .tri5g                          = 0xff,
++      .tri5gl                         = 0xff,
++      .tri5gh                         = 0xff,
++      .rxpo2g                         = 0xff,
++      .rxpo5g                         = 0xff,
++      .rssismf2g                      = 0xf,
++      .rssismc2g                      = 0xf,
++      .rssisav2g                      = 0x7,
++      .bxa2g                          = 0x3,
++      .rssismf5g                      = 0xf,
++      .rssismc5g                      = 0xf,
++      .rssisav5g                      = 0x7,
++      .bxa5g                          = 0x3,
++      .pa0b0                          = 0xfed1,
++      .pa0b1                          = 0x163d,
++      .pa0b2                          = 0xfab9,
++      .pa1b0                          = 0xfecd,
++      .pa1b1                          = 0x1417,
++      .pa1b2                          = 0xfaf6,
++      .pa1lob0                        = 0xfe87,
++      .pa1lob1                        = 0x1637,
++      .pa1lob2                        = 0xfa8e,
++      .pa1hib0                        = 0xfedc,
++      .pa1hib1                        = 0x14cb,
++      .pa1hib2                        = 0xfaef,
++      .ofdm2gpo                       = 0x4444,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0xff,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x3,
++      .rxchain                        = 0x3,
++      .opo                            = 0x44,
++      .mcs2gpo                        = { 0x4444, 0x4444, 0x4444, 0x4444,
++              0x4444, 0x4444, 0x4444, 0x4444 },
++      .mcs5gpo                        = { 0, 0x2000, 0, 0x2000, 0, 0, 0, 0 },
++      .rawtempsense           = 0x1ff,
++      .measpower                      = 0x7f,
++      .tempsense_slope        = 0xff,
++      .tempcorrx                      = 0x3f,
++      .tempsense_option       = 0x3,
++      .freqoffset_corr        = 0xf,
++      .iqcal_swp_dis          = 0x1,
++      .hw_iqcal_en            = 0x1,
++      .bw40po                         = 0x22,
++      .tempthresh                     = 0x78,
++      .phycal_tempdelta       = 0xff,
++      .temps_period           = 0xf,
++      .temps_hysteresis       = 0xf,
++};
++
++static struct ssb_sprom bcm43225_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1200,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .txpid5gh                       = { 0, 0, 0xff, 0xff },
++      .boardflags_lo          = 0x200,
++      .boardflags2_lo         = 0x1000,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4e,
++                      .pa_2g          = { 0xfead, 0x1611, 0xfa9a, 0xffff },
++                      .itssi_5g       = 0xff,
++                      .maxpwr_5g      = 0xff,
++                      .maxpwr_5gh     = 0xff,
++                      .maxpwr_5gl     = 0xff,
++                      .pa_5gl         = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5g          = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5gh         = { 0xffff, 0xffff, 0xffff, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4e,
++                      .pa_2g          = { 0xfec1, 0x1674, 0xfab2, 0xffff },
++                      .itssi_5g       = 0xff,
++                      .maxpwr_5g      = 0xff,
++                      .maxpwr_5gh     = 0xff,
++                      .maxpwr_5gl     = 0xff,
++                      .pa_5gl         = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5g          = { 0xffff, 0xffff, 0xffff, 0xffff },
++                      .pa_5gh         = { 0xffff, 0xffff, 0xffff, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x4,
++                      .tr_iso         = 0x3,
++              },
++              .ghz5 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x3,
++                      .pdet_range     = 0x1f,
++                      .tr_iso         = 0x7,
++                      .antswlut       = 0x1f,
++              },
++      },
++      .ant_available_a        = 0x3,
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x4e,
++      .itssi_bg                       = 0x20,
++      .maxpwr_a                       = 0xff,
++      .itssi_a                        = 0xff,
++      .maxpwr_ah                      = 0xff,
++      .maxpwr_al                      = 0xff,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0x88,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0xff,
++      .tri2g                          = 0xff,
++      .tri5g                          = 0xff,
++      .tri5gl                         = 0xff,
++      .tri5gh                         = 0xff,
++      .rxpo2g                         = 0xff,
++      .rxpo5g                         = 0xff,
++      .rssismf2g                      = 0xf,
++      .rssismc2g                      = 0xf,
++      .rssisav2g                      = 0x7,
++      .bxa2g                          = 0x3,
++      .rssismf5g                      = 0xf,
++      .rssismc5g                      = 0xf,
++      .rssisav5g                      = 0x7,
++      .bxa5g                          = 0x3,
++      .pa0b0                          = 0xfead,
++      .pa0b1                          = 0x1611,
++      .pa0b2                          = 0xfa9a,
++      .pa1b0                          = 0xffff,
++      .pa1b1                          = 0xffff,
++      .pa1b2                          = 0xffff,
++      .pa1lob0                        = 0xffff,
++      .pa1lob1                        = 0xffff,
++      .pa1lob2                        = 0xffff,
++      .pa1hib0                        = 0xffff,
++      .pa1hib1                        = 0xffff,
++      .pa1hib2                        = 0xffff,
++      .ofdm2gpo                       = 0x5555,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0xff,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x3,
++      .rxchain                        = 0x3,
++      .opo                            = 0x55,
++      .mcs2gpo                        = { 0x5555, 0x7555, 0x5555, 0x7555,
++              0x5555, 0x7555, 0x5555, 0x7555 },
++      .rawtempsense           = 0x1ff,
++      .measpower                      = 0x7f,
++      .tempsense_slope        = 0xff,
++      .tempcorrx                      = 0x3f,
++      .tempsense_option       = 0x3,
++      .freqoffset_corr        = 0xf,
++      .iqcal_swp_dis          = 0x1,
++      .hw_iqcal_en            = 0x1,
++      .bw40po                         = 0x2,
++      .tempthresh                     = 0x78,
++      .phycal_tempdelta       = 0xff,
++      .temps_period           = 0xf,
++      .temps_hysteresis       = 0xf,
++};
++
++static struct ssb_sprom bcm43227_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1402,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .boardflags_lo          = 0x200,
++      .boardflags2_lo         = 0x800,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xff36, 0x16d2, 0xfaae, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xfeca, 0x159b, 0xfa80, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x4,
++              },
++      },
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x4c,
++      .itssi_bg                       = 0x20,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0xff,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0x88,
++      .pa0b0                          = 0xff36,
++      .pa0b1                          = 0x16d2,
++      .pa0b2                          = 0xfaae,
++      .ofdm2gpo                       = 0x4444,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0xff,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x3,
++      .rxchain                        = 0x3,
++      .opo                            = 0x44,
++      .mcs2gpo                        = { 0x4444, 0x4444, 0x4444, 0x4444,
++              0x6666, 0x6666, 0x6666, 0x6666 },
++      .tempthresh                     = 0x78,
++};
++
++static struct ssb_sprom bcm43228_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1203,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .boardflags_lo          = 0x200,
++      .boardflags2_lo         = 0x800,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xff73, 0x1762, 0xfaa4, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x34,
++                      .maxpwr_5gh     = 0x34,
++                      .maxpwr_5gl     = 0x34,
++                      .pa_5gl         = { 0xfea1, 0x144c, 0xfafb, 0xffff },
++                      .pa_5g          = { 0xfea1, 0x154c, 0xfad0, 0xffff },
++                      .pa_5gh         = { 0xfe7b, 0x13fe, 0xfafc, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xff41, 0x16a3, 0xfa8f, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x34,
++                      .maxpwr_5gh     = 0x34,
++                      .maxpwr_5gl     = 0x34,
++                      .pa_5gl         = { 0xfe97, 0x1346, 0xfb32, 0xffff },
++                      .pa_5g          = { 0xfe97, 0x1446, 0xfb05, 0xffff },
++                      .pa_5gh         = { 0xfeb9, 0x1516, 0xfaee, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x2,
++              },
++              .ghz5 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x2,
++              },
++      },
++      .ant_available_a        = 0x3,
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x4c,
++      .itssi_bg                       = 0x20,
++      .maxpwr_a                       = 0x34,
++      .itssi_a                        = 0x3e,
++      .maxpwr_ah                      = 0x34,
++      .maxpwr_al                      = 0x34,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0xff,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0x88,
++      .pa0b0                          = 0xff73,
++      .pa0b1                          = 0x1762,
++      .pa0b2                          = 0xfaa4,
++      .pa1b0                          = 0xfea1,
++      .pa1b1                          = 0x154c,
++      .pa1b2                          = 0xfad0,
++      .pa1lob0                        = 0xfea1,
++      .pa1lob1                        = 0x144c,
++      .pa1lob2                        = 0xfafb,
++      .pa1hib0                        = 0xfe7b,
++      .pa1hib1                        = 0x13fe,
++      .pa1hib2                        = 0xfafc,
++      .ofdm2gpo                       = 0x4444,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0xff,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x3,
++      .rxchain                        = 0x3,
++      .opo                            = 0x44,
++      .mcs2gpo                        = { 0x4444, 0x4444, 0x4444, 0x4444,
++              0x8888, 0x8888, 0x8888, 0x8888 },
++      .mcs5gpo                        = { 0, 0, 0, 0,
++              0x3333, 0x3333, 0x3333, 0x3333 },
++      .mcs5glpo                       = { 0, 0, 0, 0,
++              0x3333, 0x3333, 0x3333, 0x3333 },
++      .mcs5ghpo                       = { 0, 0, 0, 0,
++              0x3333, 0x3333, 0x3333, 0x3333 },
++      .tempthresh                     = 0x78,
++};
++
++static struct ssb_sprom bcm43428_sprom = {
++      .revision                       = 0x8,
++      .board_rev                      = 0x1424,
++      .txpid2g                        = { 0, 0x80, 0x2, 0 },
++      .txpid5gl                       = { 0, 0x18, 0, 0 },
++      .txpid5g                        = { 0, 0, 0x30, 0x1f },
++      .boardflags_lo          = 0x200,
++      .boardflags2_lo         = 0x1800,
++      .core_pwr_info = {
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xff3e, 0x1636, 0xfaca, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x40,
++                      .maxpwr_5gh     = 0x40,
++                      .maxpwr_5gl     = 0x40,
++                      .pa_5gl         = { 0xfe98, 0x13e1, 0xfb14, 0xffff },
++                      .pa_5g          = { 0xfe98, 0x13e1, 0xfb14, 0xffff },
++                      .pa_5gh         = { 0xfe9d, 0x133d, 0xfb36, 0xffff },
++              },
++              {
++                      .itssi_2g       = 0x20,
++                      .maxpwr_2g      = 0x4c,
++                      .pa_2g          = { 0xff22, 0x15ce, 0xfac2, 0xffff },
++                      .itssi_5g       = 0x3e,
++                      .maxpwr_5g      = 0x40,
++                      .maxpwr_5gh     = 0x40,
++                      .maxpwr_5gl     = 0x40,
++                      .pa_5gl         = { 0xfea6, 0x1378, 0xfb33, 0xffff },
++                      .pa_5g          = { 0xfea6, 0x1378, 0xfb33, 0xffff },
++                      .pa_5gh         = { 0xfe9c, 0x1245, 0xfb5f, 0xffff },
++              },
++      },
++      .fem = {
++              .ghz2 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x4,
++              },
++              .ghz5 = {
++                      .tssipos        = 0x1,
++                      .extpa_gain     = 0x2,
++                      .pdet_range     = 0x2,
++                      .tr_iso         = 0x2,
++              },
++      },
++      .ant_available_a        = 0x3,
++      .ant_available_bg       = 0x3,
++      .maxpwr_bg                      = 0x4c,
++      .itssi_bg                       = 0x20,
++      .maxpwr_a                       = 0x40,
++      .itssi_a                        = 0x3e,
++      .maxpwr_ah                      = 0x40,
++      .maxpwr_al                      = 0x40,
++      .gpio0                          = 0xff,
++      .gpio1                          = 0xff,
++      .gpio2                          = 0xff,
++      .gpio3                          = 0x88,
++      .pa0b0                          = 0xff3e,
++      .pa0b1                          = 0x1636,
++      .pa0b2                          = 0xfaca,
++      .pa1b0                          = 0xfe98,
++      .pa1b1                          = 0x13e1,
++      .pa1b2                          = 0xfb14,
++      .pa1lob0                        = 0xfe98,
++      .pa1lob1                        = 0x13e1,
++      .pa1lob2                        = 0xfb14,
++      .pa1hib0                        = 0xfe9d,
++      .pa1hib1                        = 0x133d,
++      .pa1hib2                        = 0xfb36,
++      .ofdm2gpo                       = 0x4444,
++      .antenna_gain = {
++              .a0                             = 0x2,
++              .a1                             = 0x2,
++              .a2                             = 0xff,
++              .a3                             = 0xff,
++      },
++      .leddc_on_time          = 0xff,
++      .leddc_off_time         = 0xff,
++      .txchain                        = 0x3,
++      .rxchain                        = 0x3,
++      .opo                            = 0x44,
++      .mcs2gpo                        = { 0x4444, 0x4444, 0x4444, 0x4444,
++              0x6666, 0x6666, 0x6666, 0x6666 },
++      .mcs5gpo                        = { 0, 0x2000, 0, 0x2000,
++              0x4444, 0x4444, 0x4444, 0x4444 },
++      .mcs5glpo                       = { 0, 0x2000, 0, 0x2000,
++              0x2222, 0x2222, 0x2222, 0x2222 },
++      .mcs5ghpo                       = { 0, 0x2000, 0, 0x2000,
++              0x4444, 0x4444, 0x4444, 0x4444 },
++      .tempthresh                     = 0x78,
++};
++
++#endif /* ! BCM63XX_SPROM_BCMA_DEFS_H_ */
+--- /dev/null
++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_sprom_bcma.h
+@@ -0,0 +1,9 @@
++#ifndef BCM63XX_SPROM_BCMA_H_
++#define BCM63XX_SPROM_BCMA_H_
++
++#include <linux/bcma/bcma.h>
++
++int bcm63xx_get_bcma_fallback_sprom(struct bcma_bus *bus,
++      struct ssb_sprom *out);
++
++#endif /* ! BCM63XX_SPROM_BCMA_H_ */

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to