kernel: update kernel 4.1 to version 4.1.11
[openwrt/openwrt.git] / target / linux / lantiq / patches-4.1 / 0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
index 04c2071f320ce76876a5128b69861050621f07ff..2fc4db30660035bf24592bd649f3ae2da617aea0 100644 (file)
@@ -415,7 +415,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +device_initcall(of_eth_mac_init);
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/pci-ath-fixup.c
-@@ -0,0 +1,109 @@
+@@ -0,0 +1,118 @@
 +/*
 + *  Atheros AP94 reference board PCI initialization
 + *
@@ -431,8 +431,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +#include <linux/delay.h>
 +#include <lantiq_soc.h>
 +
-+#define LTQ_PCI_MEM_BASE              0x18000000
-+
 +struct ath_fixup {
 +      u16             *cal_data;
 +      unsigned        slot;
@@ -444,10 +442,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +static void ath_pci_fixup(struct pci_dev *dev)
 +{
 +      void __iomem *mem;
++      struct pci_dev *bridge = pci_upstream_bridge(dev); 
 +      u16 *cal_data = NULL;
 +      u16 cmd;
 +      u32 bar0;
 +      u32 val;
++      u32 base;
 +      unsigned i;
 +
 +      for (i = 0; i < ath_num_fixups; i++) {
@@ -471,14 +471,19 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +
 +      pr_info("pci %s: fixup device configuration\n", pci_name(dev));
 +
-+      mem = ioremap(LTQ_PCI_MEM_BASE, 0x10000);
++      base = dev->resource[0].start;
++      mem = ioremap(base, 0x10000);
 +      if (!mem) {
 +              pr_err("pci %s: ioremap error\n", pci_name(dev));
 +              return;
 +      }
 +
++      if (bridge) {
++              pci_enable_device(dev);
++      }
++
 +      pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar0);
-+      pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, LTQ_PCI_MEM_BASE);
++      pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, base);
 +      pci_read_config_word(dev, PCI_COMMAND, &cmd);
 +      cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
 +      pci_write_config_word(dev, PCI_COMMAND, cmd);
@@ -512,6 +517,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +
 +      pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, bar0);
 +
++      if (bridge) {
++              pci_disable_device(dev);
++      }
++
 +      iounmap(mem);
 +}
 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath_pci_fixup);
@@ -590,15 +599,6 @@ 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
-@@ -161,7 +161,7 @@ struct ltq_etop_priv {
-       int tx_irq;
-       int rx_irq;
--      const void *mac;
-+      void *mac;
-       int mii_mode;
-       spinlock_t lock;
 @@ -840,7 +840,11 @@ ltq_etop_init(struct net_device *dev)
        if (err)
                goto err_hw;