1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

[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
This commit is contained in:
florian
2009-02-27 15:48:23 +00:00
parent 9c695dc81f
commit 95ed72af25
3 changed files with 43 additions and 52 deletions

View File

@@ -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>
@@ -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));