summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-12-16 10:11:02 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-12-16 10:11:02 +0000
commit627651dfcaea574cfb59fa9a3865a7bc34fb0dab (patch)
treef3caeed717ed0a08c9573117f249797fcbe0e27f
parent16565ec94b39abceca14cb844fb1ff6cab2f815d (diff)
downloadmaster-31e0f0ae-627651dfcaea574cfb59fa9a3865a7bc34fb0dab.tar.gz
master-31e0f0ae-627651dfcaea574cfb59fa9a3865a7bc34fb0dab.tar.bz2
master-31e0f0ae-627651dfcaea574cfb59fa9a3865a7bc34fb0dab.zip
ar71xx: rb95x: use the rb_get_wlan_data helper
Also remove unused RB_* defines. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 39092
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c51
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();
}