lantiq: fix fritz7320 wifi support
authorJohn Crispin <john@phrozen.org>
Mon, 13 Jun 2016 19:50:13 +0000 (21:50 +0200)
committerJohn Crispin <john@phrozen.org>
Tue, 14 Jun 2016 04:43:02 +0000 (06:43 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
target/linux/lantiq/base-files/etc/board.d/01_leds
target/linux/lantiq/dts/FRITZ7320.dts
target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
target/linux/lantiq/xway/profiles/avm.mk

index c365468030b9735ff3c26acd0881b1438e8b6723..08c384297d384ae621967e001cb6e02c37efd606 100755 (executable)
@@ -42,6 +42,9 @@ P2812HNUF*)
 ARV7519RW22)
        ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
        ;;
+FRITZ7320)
+       ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0"
+       ;;
 WBMR300)
        ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08"
        ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04"
index 475da7ac8ef70a65e29811c1de12eaed01f2e0f5..acb88b60a0c225bbee4ba0ae3f56aee3ec497716 100644 (file)
@@ -37,7 +37,7 @@
                                        #address-cells = <1>;
                                        #size-cells = <1>;
 
-                                       partition@0 {
+                                       ath9k_cal: partition@0 {
                                                label = "urlader";
                                                reg = <0x00000 0x20000>;
                                                read-only;
                        };
                };
 
+               ath9k_eep {
+                       compatible = "ath9k,eeprom";
+                       ath,eep-flash = <&ath9k_cal 0x985>;
+                       ath,device-id = /bits/ 16 <0xff1d 0x2d>;
+                       ath,eep-endian;
+                       ath,eep-swap;
+               };
+
                gpio: pinmux@E100B10 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&state_default>;
index 91a884d2ea0fe981e2befc18575180e97a53feed..07e6a001ebac4847ab3b15c4243ecd86e1fe0186 100644 (file)
@@ -30,7 +30,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +#endif /* _PCI_ATH_FIXUP */
 --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
 +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
-@@ -104,5 +104,8 @@ int xrx200_gphy_boot(struct device *dev,
+@@ -104,5 +104,8 @@
  extern void ltq_pmu_enable(unsigned int module);
  extern void ltq_pmu_disable(unsigned int module);
  
@@ -41,7 +41,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
  #endif /* _LTQ_XWAY_H__ */
 --- a/arch/mips/lantiq/xway/Makefile
 +++ b/arch/mips/lantiq/xway/Makefile
-@@ -2,4 +2,7 @@ obj-y := prom.o sysctrl.o clk.o reset.o
+@@ -2,4 +2,7 @@
  
  obj-y += vmmc.o tffs.o
  
@@ -51,7 +51,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
  obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/ath_eep.c
-@@ -0,0 +1,298 @@
+@@ -0,0 +1,307 @@
 +/*
 + *  Copyright (C) 2011 Luca Olivetti <luca@ventoso.org>
 + *  Copyright (C) 2011 John Crispin <blogic@openwrt.org>
@@ -104,6 +104,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +      const __be32 *list;
 +      const char *part;
 +      phandle phandle;
++      u16 dev_ids[2] = { 0 };
 +
 +      if ((list = of_get_property(np, "ath,eep-flash", &i)) && i == 2 *
 +                      sizeof(*list) && (phandle = be32_to_cpup(list++)) &&
@@ -188,6 +189,14 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +
 +      }
 +
++      if (!of_property_read_u16_array(np, "ath,device-id", dev_ids, 2)) {
++              struct pci_dev *d = NULL;
++
++              while ((d = pci_get_device(PCI_VENDOR_ID_ATHEROS,
++                                         dev_ids[0], d)) != NULL)
++                      d->device = dev_ids[1];
++      }
++
 +      if (!of_property_read_u32(np, "ath,led-pin", &led_pin)) {
 +              ath9k_pdata.led_pin = led_pin;
 +              dev_info(&pdev->dev, "using led pin %d.\n", led_pin);
@@ -615,7 +624,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +device_initcall(of_ralink_eeprom_init);
 --- a/drivers/net/ethernet/lantiq_etop.c
 +++ b/drivers/net/ethernet/lantiq_etop.c
-@@ -840,7 +840,11 @@ ltq_etop_init(struct net_device *dev)
+@@ -840,7 +840,11 @@
        if (err)
                goto err_hw;
  
index 2922b0862e95f6ac770fd3483043f7300a7fac06..72d97ded2290164ba77337071419ae8f2fa3f648 100644 (file)
@@ -4,7 +4,8 @@ define Profile/FRITZ7320
        kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
        kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
        ltq-adsl-app ppp-mod-pppoa \
-       kmod-ltq-deu-ar9 kmod-usb-dwc2
+       kmod-ltq-deu-ar9 kmod-usb-dwc2 \
+       kmod-ath9k wpad-mini
 endef
 
 $(eval $(call Profile,FRITZ7320))