From 6f484fc2831379b8204efa6cdd1eaa2a86e8a862 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Fri, 27 Feb 2009 15:48:23 +0000 Subject: provide a sane SPROMv2 to make on-board bcm4318 card work, thanks mb__ SVN-Revision: 14683 --- .../arch/mips/bcm63xx/boards/board_bcm963xx.c | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'target/linux/brcm63xx/files/arch') 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 76dd54013f..4323ee2f67 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 #include #include +#include #include #include #include @@ -447,6 +448,31 @@ static struct platform_device mtd_dev = { .num_resources = ARRAY_SIZE(mtd_resources), }; +/* + * 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. */ @@ -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)); -- cgit v1.2.3