kernel: update 3.10 to 3.10.26
[oweals/openwrt.git] / target / linux / generic / patches-3.10 / 025-bcma_backport.patch
index 93702af7fca2b04ce8519783d40127d756a6ea31..853d524e12974ff519b85f4a4c7440bd5d0c1c00 100644 (file)
        switch (cc->capabilities & BCMA_CC_CAP_FLASHT) {
 --- a/drivers/bcma/host_pci.c
 +++ b/drivers/bcma/host_pci.c
-@@ -275,6 +275,7 @@ static DEFINE_PCI_DEVICE_TABLE(bcma_pci_
+@@ -188,8 +188,11 @@ static int bcma_host_pci_probe(struct pc
+               pci_write_config_dword(dev, 0x40, val & 0xffff00ff);
+       /* SSB needed additional powering up, do we have any AMBA PCI cards? */
+-      if (!pci_is_pcie(dev))
+-              bcma_err(bus, "PCI card detected, report problems.\n");
++      if (!pci_is_pcie(dev)) {
++              bcma_err(bus, "PCI card detected, they are not supported.\n");
++              err = -ENXIO;
++              goto err_pci_release_regions;
++      }
+       /* Map MMIO */
+       err = -ENOMEM;
+@@ -269,12 +272,14 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bc
+ static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
+       { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
++      { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) },
+       { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) },
+       { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
+       { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
        { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
        { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
        { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
  /**************************************************
   * Workarounds.
   **************************************************/
-@@ -203,6 +210,25 @@ static void bcma_core_pci_config_fixup(s
-       }
+@@ -229,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_
+               bcma_core_pci_clientmode_init(pc);
  }
  
-+static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up)
++void bcma_core_pci_power_save(struct bcma_bus *bus, bool up)
 +{
++      struct bcma_drv_pci *pc;
 +      u16 data;
 +
++      if (bus->hosttype != BCMA_HOSTTYPE_PCI)
++              return;
++
++      pc = &bus->drv_pci[0];
++
 +      if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
 +              data = up ? 0x74 : 0x7C;
 +              bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
 +                                       BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
 +      }
 +}
++EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
 +
- /**************************************************
-  * Init.
-  **************************************************/
-@@ -262,7 +288,7 @@ out:
+ int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
+                         bool enable)
+ {
+@@ -262,7 +295,7 @@ out:
  }
  EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl);
  
  {
        u32 w;
  
-@@ -274,4 +300,33 @@ void bcma_core_pci_extend_L1timer(struct
+@@ -274,4 +307,29 @@ void bcma_core_pci_extend_L1timer(struct
        bcma_pcie_write(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG, w);
        bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
  }
 +
 +      pc = &bus->drv_pci[0];
 +
-+      bcma_core_pci_power_save(pc, true);
-+
 +      bcma_core_pci_extend_L1timer(pc, true);
 +}
 +EXPORT_SYMBOL_GPL(bcma_core_pci_up);
 +      pc = &bus->drv_pci[0];
 +
 +      bcma_core_pci_extend_L1timer(pc, false);
-+
-+      bcma_core_pci_power_save(pc, false);
 +}
 +EXPORT_SYMBOL_GPL(bcma_core_pci_down);
 --- a/drivers/bcma/driver_pci_host.c
  
  #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
  struct bcma_drv_pci_host {
-@@ -219,7 +240,8 @@ struct bcma_drv_pci {
+@@ -219,7 +240,9 @@ struct bcma_drv_pci {
  extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
  extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
                                 struct bcma_device *core, bool enable);
 -extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend);
 +extern void bcma_core_pci_up(struct bcma_bus *bus);
 +extern void bcma_core_pci_down(struct bcma_bus *bus);
++extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
  
  extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
  extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);