diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-12-16 10:11:02 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-12-16 10:11:02 +0000 |
commit | 86f043c41a3e36a4afb24943ac21d046453d4acd (patch) | |
tree | 94b55dfb6b62f1e52676095e3cc91a41b835428f /target/linux/ar71xx | |
parent | 6d5b1475361030a88421d80e9875355687154588 (diff) | |
download | upstream-86f043c41a3e36a4afb24943ac21d046453d4acd.tar.gz upstream-86f043c41a3e36a4afb24943ac21d046453d4acd.tar.bz2 upstream-86f043c41a3e36a4afb24943ac21d046453d4acd.zip |
ar71xx: rb95x: use the rb_get_wlan_data helper
Also remove unused RB_* defines.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39092 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c index 1e5c477e3b..8213c47c10 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c @@ -22,7 +22,6 @@ #include <linux/mtd/partitions.h> #include <linux/spi/spi.h> #include <linux/spi/flash.h> -#include <linux/rle.h> #include <linux/routerboot.h> #include <linux/gpio.h> @@ -40,17 +39,6 @@ #define RB95X_GPIO_NAND_NCE 14 -#define RB_ROUTERBOOT_OFFSET 0x0000 -#define RB_ROUTERBOOT_SIZE 0xb000 -#define RB_HARD_CFG_OFFSET 0xc000 -#define RB_HARD_CFG_SIZE 0x1000 -#define RB_BIOS_OFFSET 0xd000 -#define RB_BIOS_SIZE 0x2000 -#define RB_SOFT_CFG_OFFSET 0xe000 -#define RB_SOFT_CFG_SIZE 0x1000 - -#define RB_ART_SIZE 0x10000 - static struct mtd_partition rb95x_nand_partitions[] = { { .name = "booter", @@ -99,37 +87,16 @@ static struct mdio_board_info rb95x_mdio0_info[] = { void __init rb95x_wlan_init(void) { - u8 *hard_cfg = (u8 *) KSEG1ADDR(0x1f000000 + RB_HARD_CFG_OFFSET); - u16 tag_len; - u8 *tag; char *art_buf; u8 wlan_mac[ETH_ALEN]; - int err; - err = routerboot_find_tag(hard_cfg, RB_HARD_CFG_SIZE, RB_ID_WLAN_DATA, - &tag, &tag_len); - if (err) { - pr_err("no calibration data found\n"); + art_buf = rb_get_wlan_data(); + if (art_buf == NULL) return; - } - - art_buf = kmalloc(RB_ART_SIZE, GFP_KERNEL); - if (art_buf == NULL) { - pr_err("no memory for calibration data\n"); - return; - } - - err = rle_decode((char *) tag, tag_len, art_buf, RB_ART_SIZE, - NULL, NULL); - if (err) { - pr_err("unable to decode calibration data\n"); - goto free; - } ath79_init_mac(wlan_mac, ath79_mac_base, 11); ath79_register_wmac(art_buf + 0x1000, wlan_mac); -free: kfree(art_buf); } @@ -180,8 +147,14 @@ void __init rb95x_nand_init(void) ath79_register_nfc(); } -static void __init rb95x_setup(void) +static int __init rb95x_setup(void) { + const struct rb_info *info; + + info = rb_init_info((void *)(KSEG1ADDR(0x1f00000)), 0x10000); + if (!info) + return -EINVAL; + rb95x_nand_init(); ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | @@ -197,11 +170,15 @@ static void __init rb95x_setup(void) ath79_eth0_data.phy_mask = BIT(0); ath79_register_eth(0); + + return 0; } static void __init rb951g_setup(void) { - rb95x_setup(); + if (rb95x_setup()) + return; + rb95x_wlan_init(); ath79_register_usb(); } |