summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/files/arch/mips
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-02-27 15:48:23 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-02-27 15:48:23 +0000
commit95ed72af251c48ba02712641f949579d1bc9c27e (patch)
tree0c6da2933d41d7aaaf5daad3d86b72e1a0c5db40 /target/linux/brcm63xx/files/arch/mips
parent9c695dc81fc65643179f8bc54b10cc3497b2500b (diff)
[brcm63xx] provide a sane SPROMv2 to make on-board bcm4318 card work, thanks mb__
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14683 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/files/arch/mips')
-rw-r--r--target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 76dd54013..4323ee2f6 100644
--- a/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -13,6 +13,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
+#include <linux/ssb/ssb.h>
#include <asm/addrspace.h>
#include <bcm63xx_board.h>
#include <bcm63xx_cpu.h>
@@ -448,6 +449,31 @@ static struct platform_device mtd_dev = {
};
/*
+ * Register a sane SPROMv2 to make the on-board
+ * bcm4318 WLAN work
+ */
+static struct ssb_sprom bcm63xx_sprom = {
+ .revision = 0x02,
+ .board_rev = 0x17,
+ .country_code = 0x0,
+ .ant_available_bg = 0x3,
+ .pa0b0 = 0x15ae,
+ .pa0b1 = 0xfa85,
+ .pa0b2 = 0xfe8d,
+ .pa1b0 = 0xffff,
+ .pa1b1 = 0xffff,
+ .pa1b2 = 0xffff,
+ .gpio0 = 0xff,
+ .gpio1 = 0xff,
+ .gpio2 = 0xff,
+ .gpio3 = 0xff,
+ .maxpwr_bg = 0x004c,
+ .itssi_bg = 0x00,
+ .boardflags_lo = 0x2848,
+ .boardflags_hi = 0x0000,
+};
+
+/*
* third stage init callback, register all board devices.
*/
int __init board_register_devices(void)
@@ -474,6 +500,14 @@ int __init board_register_devices(void)
if (board.has_ehci0)
bcm63xx_ehci_register();
+ /* Generate MAC address for WLAN and
+ * register our SPROM */
+ if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
+ memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+ memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+ if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
+ printk(KERN_ERR "failed to register fallback SPROM\n");
+ }
/* read base address of boot chip select (0) */
val = bcm_mpi_readl(MPI_CSBASE_REG(0));