diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-09-09 14:05:30 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-09-09 14:05:30 +0000 |
commit | 0ea5d33e08cdb493b780eab8de0f0607e57c27f1 (patch) | |
tree | 9b43a8d9de1780ab0b7879e1eb627a2266ffd867 /target/linux/ar71xx/files/arch/mips | |
parent | 2a30d5c072401036729afad83947d9343ffdb862 (diff) | |
download | master-187ad058-0ea5d33e08cdb493b780eab8de0f0607e57c27f1.tar.gz master-187ad058-0ea5d33e08cdb493b780eab8de0f0607e57c27f1.tar.bz2 master-187ad058-0ea5d33e08cdb493b780eab8de0f0607e57c27f1.zip |
ar71xx: use routerboot_find_tag to find wlan data offset on RB751
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33348 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c index 305fa2f87a..bee8bdf9c2 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c @@ -15,6 +15,7 @@ #include <linux/phy.h> #include <linux/ar8216_platform.h> #include <linux/rle.h> +#include <linux/routerboot.h> #include <asm/mach-ath79/ar71xx_regs.h> #include <asm/mach-ath79/ath79.h> @@ -26,6 +27,7 @@ #include "dev-usb.h" #include "dev-eth.h" #include "machtypes.h" +#include "routerboot.h" static struct rb750_led_data rb750_leds[] = { { @@ -277,15 +279,16 @@ static void __init rb750gr3_setup(void) MIPS_MACHINE(ATH79_MACH_RB_750G_R3, "750Gr3", "MikroTik RouterBOARD 750GL", rb750gr3_setup); -#define RB751_HARDCONFIG 0x1f00b000 +#define RB751_HARDCONFIG 0x1f00b000 +#define RB751_HARDCONFIG_SIZE 0x1000 #define RB751_MAC_ADDRESS_OFFSET 0xE80 -#define RB751_CALDATA_OFFSET 0x27C -#define RB751_CALDATA_SIZE 0xc00 static void __init rb751_wlan_setup(void) { u8 *hardconfig = (u8 *) KSEG1ADDR(RB751_HARDCONFIG); struct ath9k_platform_data *wmac_data; + u16 tag_len; + u8 *tag; int err; wmac_data = ap9x_pci_get_wmac_data(0); @@ -296,11 +299,15 @@ static void __init rb751_wlan_setup(void) ap9x_pci_setup_wmac_led_pin(0, 9); - err = rle_decode(hardconfig + RB751_CALDATA_OFFSET, - RB751_CALDATA_SIZE, - (unsigned char *) wmac_data->eeprom_data, - sizeof(wmac_data->eeprom_data), - NULL, NULL); + err = routerboot_find_tag(hardconfig, RB751_HARDCONFIG_SIZE, + RB_ID_WLAN_DATA, &tag, &tag_len); + if (err) { + pr_err("rb75x: no calibration data found\n"); + return; + } + + err = rle_decode(tag, tag_len, (unsigned char *) wmac_data->eeprom_data, + sizeof(wmac_data->eeprom_data), NULL, NULL); if (err) { pr_err("rb75x: unable to decode wlan eeprom data\n"); return; |