Changeset 41860


Ignore:
Timestamp:
2014-07-28T17:26:41+02:00 (4 years ago)
Author:
blogic
Message:

lantiq: fix dgn3500 and td8970 wifi

ath9k failed to come up due to a bad mac addr

Signed-off-by: John Crispin <blogic@…>

Location:
trunk/target/linux/lantiq
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/lantiq/dts/TDW8970.dts

    r40498 r41860  
    7373                                #size-cells = <0>; 
    7474                                reg = <0>; 
    75                                 mac-address = [ 00 11 22 33 44 55 ]; 
     75                                mtd-mac-address = <&ath9k_cal 0xf100>; 
    7676 
    7777                                ethernet@0 { 
     
    195195                compatible = "ath9k,eeprom"; 
    196196                ath,eep-flash = <&ath9k_cal 0x21000>; 
     197                ath,mac-offset = <0xf100>; 
     198                ath,mac-increment; 
    197199                ath,led-pin = <0>; 
    198200        }; 
  • trunk/target/linux/lantiq/patches-3.10/0010-MIPS-lantiq-wifi-and-ethernet-eeprom-handling.patch

    r41269 r41860  
    2020 create mode 100644 arch/mips/lantiq/xway/rt_eep.c 
    2121 
    22 --- /dev/null 
    23 +++ b/arch/mips/include/asm/mach-lantiq/pci-ath-fixup.h 
     22Index: linux-3.10.49/arch/mips/include/asm/mach-lantiq/pci-ath-fixup.h 
     23=================================================================== 
     24--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     25+++ linux-3.10.49/arch/mips/include/asm/mach-lantiq/pci-ath-fixup.h     2014-07-28 15:42:11.008968725 +0100 
    2426@@ -0,0 +1,6 @@ 
    2527+#ifndef _PCI_ATH_FIXUP 
     
    2931+ 
    3032+#endif /* _PCI_ATH_FIXUP */ 
    31 --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h 
    32 +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h 
    33 @@ -90,5 +90,8 @@ int xrx200_gphy_boot(struct device *dev, 
     33Index: linux-3.10.49/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h 
     34=================================================================== 
     35--- linux-3.10.49.orig/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h      2014-07-17 23:58:15.000000000 +0100 
     36+++ linux-3.10.49/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h   2014-07-28 15:42:11.008968725 +0100 
     37@@ -90,5 +90,8 @@ 
    3438 extern void ltq_pmu_enable(unsigned int module); 
    3539 extern void ltq_pmu_disable(unsigned int module); 
     
    4044 #endif /* CONFIG_SOC_TYPE_XWAY */ 
    4145 #endif /* _LTQ_XWAY_H__ */ 
    42 --- a/arch/mips/lantiq/xway/Makefile 
    43 +++ b/arch/mips/lantiq/xway/Makefile 
    44 @@ -2,4 +2,7 @@ obj-y := prom.o sysctrl.o clk.o reset.o 
     46Index: linux-3.10.49/arch/mips/lantiq/xway/Makefile 
     47=================================================================== 
     48--- linux-3.10.49.orig/arch/mips/lantiq/xway/Makefile   2014-07-28 15:42:10.976968725 +0100 
     49+++ linux-3.10.49/arch/mips/lantiq/xway/Makefile        2014-07-28 15:49:51.008978396 +0100 
     50@@ -2,4 +2,7 @@ 
    4551  
    4652 obj-y += vmmc.o 
     
    5056+ 
    5157 obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o 
    52 --- /dev/null 
    53 +++ b/arch/mips/lantiq/xway/ath_eep.c 
    54 @@ -0,0 +1,271 @@ 
     58Index: linux-3.10.49/arch/mips/lantiq/xway/ath_eep.c 
     59=================================================================== 
     60--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     61+++ linux-3.10.49/arch/mips/lantiq/xway/ath_eep.c       2014-07-28 15:46:33.032974234 +0100 
     62@@ -0,0 +1,277 @@ 
    5563+/* 
    5664+ *  Copyright (C) 2011 Luca Olivetti <luca@ventoso.org> 
     
    114122+                               ATH9K_PLAT_EEP_MAX_WORDS << 1, &flash_readlen, 
    115123+                               (void *) ath9k_pdata.eeprom_data); 
     124+               if (!of_property_read_u32(np, "ath,mac-offset", &mac_offset)) { 
     125+                       size_t mac_readlen; 
     126+                       mtd_read(the_mtd, mac_offset, 6, &mac_readlen, 
     127+                               (void *) athxk_eeprom_mac); 
     128+               } 
    116129+               put_mtd_device(the_mtd); 
    117130+               if ((sizeof(ath9k_pdata.eeprom_data) != flash_readlen) || i) { 
     
    147160+       } 
    148161+ 
    149 +       if (!of_property_read_u32(np, "ath,mac-offset", &mac_offset)) { 
    150 +               memcpy_fromio(athxk_eeprom_mac, (void*) ath9k_pdata.eeprom_data + mac_offset, 6); 
    151 +       } else if (mac_res) { 
    152 +               if (resource_size(mac_res) != 6) { 
    153 +                       dev_err(&pdev->dev, "mac has an invalid size\n"); 
    154 +                       return -EINVAL; 
    155 +               } 
    156 +               mac = ioremap(mac_res->start, resource_size(mac_res)); 
    157 +               memcpy_fromio(athxk_eeprom_mac, mac, 6); 
    158 +       } else if (ltq_get_eth_mac()) 
    159 +               memcpy(athxk_eeprom_mac, ltq_get_eth_mac(), 6); 
    160 +       else { 
     162+       if (!is_valid_ether_addr(athxk_eeprom_mac)) { 
     163+               if (mac_res) { 
     164+                       if (resource_size(mac_res) != 6) { 
     165+                               dev_err(&pdev->dev, "mac has an invalid size\n"); 
     166+                               return -EINVAL; 
     167+                       } 
     168+                       mac = ioremap(mac_res->start, resource_size(mac_res)); 
     169+                       memcpy_fromio(athxk_eeprom_mac, mac, 6); 
     170+               } else if (ltq_get_eth_mac()) { 
     171+                       memcpy(athxk_eeprom_mac, ltq_get_eth_mac(), 6); 
     172+               } 
     173+       } 
     174+       if (!is_valid_ether_addr(athxk_eeprom_mac)) { 
    161175+               dev_warn(&pdev->dev, "using random mac\n"); 
    162176+               random_ether_addr(athxk_eeprom_mac); 
     
    324338+} 
    325339+device_initcall(of_ath5k_eeprom_init); 
    326 --- /dev/null 
    327 +++ b/arch/mips/lantiq/xway/eth_mac.c 
     340Index: linux-3.10.49/arch/mips/lantiq/xway/eth_mac.c 
     341=================================================================== 
     342--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     343+++ linux-3.10.49/arch/mips/lantiq/xway/eth_mac.c       2014-07-28 15:42:11.008968725 +0100 
    328344@@ -0,0 +1,76 @@ 
    329345+/* 
     
    403419+} 
    404420+device_initcall(of_eth_mac_init); 
    405 --- /dev/null 
    406 +++ b/arch/mips/lantiq/xway/pci-ath-fixup.c 
     421Index: linux-3.10.49/arch/mips/lantiq/xway/pci-ath-fixup.c 
     422=================================================================== 
     423--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     424+++ linux-3.10.49/arch/mips/lantiq/xway/pci-ath-fixup.c 2014-07-28 15:42:11.008968725 +0100 
    407425@@ -0,0 +1,109 @@ 
    408426+/* 
     
    515533+       ath_num_fixups++; 
    516534+} 
    517 --- /dev/null 
    518 +++ b/arch/mips/lantiq/xway/rt_eep.c 
     535Index: linux-3.10.49/arch/mips/lantiq/xway/rt_eep.c 
     536=================================================================== 
     537--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     538+++ linux-3.10.49/arch/mips/lantiq/xway/rt_eep.c        2014-07-28 15:42:11.008968725 +0100 
    519539@@ -0,0 +1,60 @@ 
    520540+/* 
Note: See TracChangeset for help on using the changeset viewer.