From 95ed72af251c48ba02712641f949579d1bc9c27e Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 27 Feb 2009 15:48:23 +0000 Subject: [PATCH] [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 --- target/linux/brcm63xx/Makefile | 2 +- target/linux/brcm63xx/config-2.6.27 | 59 +++---------------- .../arch/mips/bcm63xx/boards/board_bcm963xx.c | 34 +++++++++++ 3 files changed, 43 insertions(+), 52 deletions(-) diff --git a/target/linux/brcm63xx/Makefile b/target/linux/brcm63xx/Makefile index 08667c70c..c1a1a5980 100644 --- a/target/linux/brcm63xx/Makefile +++ b/target/linux/brcm63xx/Makefile @@ -14,7 +14,7 @@ LINUX_VERSION:=2.6.27.19 include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += hostapd-mini kmod-ssb +DEFAULT_PACKAGES += hostapd-mini define Target/Description Build firmware images for Broadcom based xDSL/routers diff --git a/target/linux/brcm63xx/config-2.6.27 b/target/linux/brcm63xx/config-2.6.27 index ac272819f..79716aba2 100644 --- a/target/linux/brcm63xx/config-2.6.27 +++ b/target/linux/brcm63xx/config-2.6.27 @@ -8,7 +8,6 @@ CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SUPPORTS_MSI is not set CONFIG_ARCH_SUPPORTS_OPROFILE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ATM_DRIVERS=y CONFIG_AUDIT=y CONFIG_AUDIT_GENERIC=y CONFIG_BASE_SMALL=0 @@ -19,18 +18,14 @@ CONFIG_BCM63XX_CPU_6348=y CONFIG_BCM63XX_CPU_6358=y CONFIG_BCM63XX_ENET=y CONFIG_BCM63XX_PHY=y -# CONFIG_BINFMT_MISC is not set CONFIG_BITREVERSE=y CONFIG_BLK_DEV_IO_TRACE=y -# CONFIG_BLK_DEV_LOOP is not set CONFIG_BOARD_BCM963XX=y # CONFIG_BOARD_LIVEBOX is not set # CONFIG_BSD_DISKLABEL is not set CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_CEVT_R4K=y -# CONFIG_CIFS is not set CONFIG_CLASSIC_RCU=y -# CONFIG_CLS_U32_MARK is not set CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200" # CONFIG_CONFIGFS_FS is not set CONFIG_CPU_BIG_ENDIAN=y @@ -63,6 +58,12 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y # CONFIG_CPU_TX49XX is not set # CONFIG_CPU_VR41XX is not set CONFIG_CRAMFS=y +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_ALGAPI=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_BLKCIPHER=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_MANAGER=m CONFIG_CSRC_R4K=y CONFIG_DEFAULT_BIC=y CONFIG_DEFAULT_CFQ=y @@ -74,18 +75,10 @@ CONFIG_DEVPORT=y # CONFIG_DM9000 is not set CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y -# CONFIG_DUMMY is not set CONFIG_EARLY_PRINTK=y CONFIG_ELF_CORE=y -# CONFIG_EQUALIZER is not set -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -CONFIG_EXT3_FS_XATTR=y CONFIG_FIRMWARE_IN_KERNEL=y # CONFIG_FIXED_PHY is not set -# CONFIG_FS_MBCACHE is not set -CONFIG_FS_POSIX_ACL=y -# CONFIG_FUSE_FS is not set CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CMOS_UPDATE=y @@ -121,13 +114,9 @@ CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y CONFIG_IOSCHED_CFQ=y # CONFIG_IOSCHED_DEADLINE is not set -# CONFIG_IP6_NF_RAW is not set -CONFIG_IPV6_PRIVACY=y -# CONFIG_IPV6_TUNNEL is not set CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y -# CONFIG_IP_SCTP is not set CONFIG_IRQ_CPU=y # CONFIG_ISDN is not set CONFIG_KMOD=y @@ -136,7 +125,6 @@ CONFIG_LBD=y # CONFIG_LEDS_GPIO is not set # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set # CONFIG_LEMOTE_FULONG is not set -# CONFIG_LLC2 is not set # CONFIG_MACH_ALCHEMY is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set @@ -148,7 +136,6 @@ CONFIG_MAGIC_SYSRQ=y # CONFIG_MFD_CORE is not set # CONFIG_MFD_TMIO is not set # CONFIG_MIKROTIK_RB532 is not set -# CONFIG_MINIX_FS is not set CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 @@ -208,19 +195,14 @@ CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y # CONFIG_MTD_ROM is not set # CONFIG_MTD_SLRAM is not set # CONFIG_NATSEMI is not set -CONFIG_NF_CT_ACCT=y # CONFIG_NO_IOPORT is not set CONFIG_PAGEFLAGS_EXTENDED=y # CONFIG_PAGE_SIZE_16KB is not set CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_PAGE_SIZE_8KB is not set -# CONFIG_PCCARD is not set -# CONFIG_PCCARD_NONSTATIC is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y -# CONFIG_PCMCIA is not set -# CONFIG_PCMCIA_BCM63XX is not set # CONFIG_PCSPKR_PLATFORM is not set CONFIG_PHYLIB=y # CONFIG_PMC_MSP is not set @@ -232,17 +214,10 @@ CONFIG_POSIX_MQUEUE=y # CONFIG_PROM_EMU is not set # CONFIG_R6040 is not set CONFIG_RELAY=y -CONFIG_RFKILL_LEDS=y CONFIG_RTC_LIB=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_WAIT_SCAN is not set -# CONFIG_SCTP_DBG_MSG is not set -# CONFIG_SCTP_DBG_OBJCNT is not set -CONFIG_SCTP_HMAC_MD5=y -# CONFIG_SCTP_HMAC_NONE is not set -# CONFIG_SCTP_HMAC_SHA1 is not set +# CONFIG_SCSI_DMA is not set # CONFIG_SERIAL_8250 is not set CONFIG_SERIAL_BCM63XX=y CONFIG_SERIAL_BCM63XX_CONSOLE=y @@ -258,18 +233,16 @@ CONFIG_SERIAL_BCM63XX_CONSOLE=y # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set -# CONFIG_SOUND is not set # CONFIG_SPARSEMEM_STATIC is not set # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set CONFIG_SQUASHFS_EMBEDDED=y CONFIG_SQUASHFS_VMALLOC=y -# CONFIG_SSB is not set +CONFIG_SSB=y CONFIG_SSB_B43_PCI_BRIDGE=y CONFIG_SSB_DRIVER_PCICORE=y CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y CONFIG_SSB_PCIHOST=y CONFIG_SSB_PCIHOST_POSSIBLE=y -CONFIG_SSB_PCMCIAHOST_POSSIBLE=y CONFIG_SSB_POSSIBLE=y CONFIG_SSB_SPROM=y CONFIG_SWAP_IO_SPACE=y @@ -281,31 +254,15 @@ CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y # CONFIG_TC35815 is not set CONFIG_TCP_CONG_BIC=y -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_SCALABLE is not set # CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_VENO is not set CONFIG_TICK_ONESHOT=y -# CONFIG_TIPC is not set -# CONFIG_TIPC_ADVANCED is not set -# CONFIG_TIPC_DEBUG is not set CONFIG_TRAD_SIGNALS=y -# CONFIG_USB is not set CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y -# CONFIG_USB_SERIAL_CH341 is not set CONFIG_USB_SUPPORT=y -# CONFIG_USB_UHCI_HCD is not set # CONFIG_VGASTATE is not set # CONFIG_VIA_RHINE is not set -# CONFIG_VIDEO_MEDIA is not set -# CONFIG_VIDEO_V4L2 is not set -# CONFIG_VIDEO_V4L2_COMMON is not set CONFIG_VM_EVENT_COUNTERS=y -# CONFIG_WAN_ROUTER is not set # CONFIG_WATCHDOG is not set CONFIG_ZONE_DMA_FLAG=0 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 #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)); -- 2.20.1