ar71xx: use routerboot_find_tag to find wlan data offset on RB751
authorGabor Juhos <juhosg@openwrt.org>
Sun, 9 Sep 2012 14:05:30 +0000 (14:05 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 9 Sep 2012 14:05:30 +0000 (14:05 +0000)
SVN-Revision: 33348

target/linux/ar71xx/config-3.3
target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
target/linux/ar71xx/patches-3.3/611-TEW-712BR-support.patch
target/linux/ar71xx/patches-3.3/613-RB2011-support.patch

index fd113addd1e7e2e4100e718acadc908dd9010cae..9194701e7807b9f61d14438880299e80778c7764 100644 (file)
@@ -83,7 +83,7 @@ CONFIG_ATH79_MACH_WZR_HP_G450H=y
 CONFIG_ATH79_MACH_ZCN_1523H=y
 CONFIG_ATH79_NVRAM=y
 CONFIG_ATH79_PCI_ATH9K_FIXUP=y
-# CONFIG_ATH79_ROUTERBOOT is not set
+CONFIG_ATH79_ROUTERBOOT=y
 # CONFIG_ATH79_WDT is not set
 CONFIG_BCMA_POSSIBLE=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
index 305fa2f87a7537b3a216b778c119ea6500ab9986..bee8bdf9c2e71e8a445adbe8e35d805454d1cf1b 100644 (file)
@@ -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;
index 97e957f2dcaac4d79a7a39444796f7839b98ac4e..59eeee06995d8995cff386b9c80db1c955e25df9 100644 (file)
  config ATH79_MACH_PB44
        bool "Atheros PB44 reference board"
        select SOC_AR71XX
-@@ -66,6 +137,428 @@ config ATH79_MACH_PB44
+@@ -66,6 +137,429 @@ config ATH79_MACH_PB44
          Say 'Y' here if you want your kernel to support the
          Atheros PB44 reference board.
  
 +      select ATH79_DEV_ETH
 +      select ATH79_DEV_AP9X_PCI if PCI
 +      select ATH79_DEV_USB
++      select ATH79_ROUTERBOOT
 +      select RLE_DECOMPRESS
 +
 +config ATH79_MACH_WNDR3700
  config ATH79_MACH_UBNT_XM
        bool "Ubiquiti Networks XM (rev 1.0) board"
        select SOC_AR724X
-@@ -79,6 +572,24 @@ config ATH79_MACH_UBNT_XM
+@@ -79,6 +573,24 @@ config ATH79_MACH_UBNT_XM
          Say 'Y' here if you want your kernel to support the
          Ubiquiti Networks XM (rev 1.0) board.
  
  endmenu
  
  config SOC_AR71XX
-@@ -114,10 +625,6 @@ config SOC_QCA955X
+@@ -114,10 +626,6 @@ config SOC_QCA955X
        select PCI_AR724X if PCI
        def_bool n
  
  config ATH79_DEV_AP9X_PCI
        select ATH79_PCI_ATH9K_FIXUP
        def_bool n
-@@ -128,7 +635,14 @@ config ATH79_DEV_DSA
+@@ -128,7 +636,14 @@ config ATH79_DEV_DSA
  config ATH79_DEV_ETH
        def_bool n
  
        def_bool n
  
  config ATH79_DEV_GPIO_BUTTONS
-@@ -156,4 +670,7 @@ config ATH79_PCI_ATH9K_FIXUP
+@@ -156,4 +671,7 @@ config ATH79_PCI_ATH9K_FIXUP
  config ATH79_ROUTERBOOT
        def_bool n
  
index b8c227e4ca4d4fc192e836419b04e5e52e445da3..319f1f5ce7a6aa22ef2ada0f17baff0d046f2aa4 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/Kconfig
 +++ b/arch/mips/ath79/Kconfig
-@@ -550,6 +550,16 @@ config ATH79_MACH_TEW_673GRU
+@@ -551,6 +551,16 @@ config ATH79_MACH_TEW_673GRU
        select ATH79_DEV_USB
        select ATH79_NVRAM
  
index 6622b4d96e285f91e906c1075e34a1b9483d1475..be2b144c7469b14e7eaa7de72209ad08c4144d9f 100644 (file)
@@ -1,7 +1,7 @@
 --- a/arch/mips/ath79/Kconfig
 +++ b/arch/mips/ath79/Kconfig
-@@ -334,6 +334,11 @@ config ATH79_MACH_RB750
-       select ATH79_DEV_USB
+@@ -335,6 +335,11 @@ config ATH79_MACH_RB750
+       select ATH79_ROUTERBOOT
        select RLE_DECOMPRESS
  
 +config ATH79_MACH_RB2011