aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.18
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-12-07 21:53:20 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2014-12-07 21:53:20 +0000
commitd9bb8326fa2cb6f964a6dcdf841e2e9551ee7899 (patch)
treeded871d0ae0a461cb985370b267b456ab6851c82 /target/linux/generic/patches-3.18
parent7a65768ddca031ec9d450366881c5958a687a996 (diff)
downloadupstream-d9bb8326fa2cb6f964a6dcdf841e2e9551ee7899.tar.gz
upstream-d9bb8326fa2cb6f964a6dcdf841e2e9551ee7899.tar.bz2
upstream-d9bb8326fa2cb6f964a6dcdf841e2e9551ee7899.zip
kernel: update bcma and ssb to wireless-testing master-2014-12-05
This brings ssb and bcma to wireless-testing tag master-2014-12-05 In addition it also adds the ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus- axi-in-DTS-f.patch which adds the irq number in a way it is done in the mainline kernel. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 43544
Diffstat (limited to 'target/linux/generic/patches-3.18')
-rw-r--r--target/linux/generic/patches-3.18/020-ssb_update.patch78
-rw-r--r--target/linux/generic/patches-3.18/025-bcma_backport.patch211
2 files changed, 285 insertions, 4 deletions
diff --git a/target/linux/generic/patches-3.18/020-ssb_update.patch b/target/linux/generic/patches-3.18/020-ssb_update.patch
new file mode 100644
index 0000000000..9171b24704
--- /dev/null
+++ b/target/linux/generic/patches-3.18/020-ssb_update.patch
@@ -0,0 +1,78 @@
+--- a/drivers/ssb/pcihost_wrapper.c
++++ b/drivers/ssb/pcihost_wrapper.c
+@@ -11,15 +11,17 @@
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
++#include <linux/pm.h>
+ #include <linux/pci.h>
+ #include <linux/export.h>
+ #include <linux/slab.h>
+ #include <linux/ssb/ssb.h>
+
+
+-#ifdef CONFIG_PM
+-static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
++#ifdef CONFIG_PM_SLEEP
++static int ssb_pcihost_suspend(struct device *d)
+ {
++ struct pci_dev *dev = to_pci_dev(d);
+ struct ssb_bus *ssb = pci_get_drvdata(dev);
+ int err;
+
+@@ -28,17 +30,23 @@ static int ssb_pcihost_suspend(struct pc
+ return err;
+ pci_save_state(dev);
+ pci_disable_device(dev);
+- pci_set_power_state(dev, pci_choose_state(dev, state));
++
++ /* if there is a wakeup enabled child device on ssb bus,
++ enable pci wakeup posibility. */
++ device_set_wakeup_enable(d, d->power.wakeup_path);
++
++ pci_prepare_to_sleep(dev);
+
+ return 0;
+ }
+
+-static int ssb_pcihost_resume(struct pci_dev *dev)
++static int ssb_pcihost_resume(struct device *d)
+ {
++ struct pci_dev *dev = to_pci_dev(d);
+ struct ssb_bus *ssb = pci_get_drvdata(dev);
+ int err;
+
+- pci_set_power_state(dev, PCI_D0);
++ pci_back_from_sleep(dev);
+ err = pci_enable_device(dev);
+ if (err)
+ return err;
+@@ -49,10 +57,12 @@ static int ssb_pcihost_resume(struct pci
+
+ return 0;
+ }
+-#else /* CONFIG_PM */
+-# define ssb_pcihost_suspend NULL
+-# define ssb_pcihost_resume NULL
+-#endif /* CONFIG_PM */
++
++static const struct dev_pm_ops ssb_pcihost_pm_ops = {
++ SET_SYSTEM_SLEEP_PM_OPS(ssb_pcihost_suspend, ssb_pcihost_resume)
++};
++
++#endif /* CONFIG_PM_SLEEP */
+
+ static int ssb_pcihost_probe(struct pci_dev *dev,
+ const struct pci_device_id *id)
+@@ -115,8 +125,9 @@ int ssb_pcihost_register(struct pci_driv
+ {
+ driver->probe = ssb_pcihost_probe;
+ driver->remove = ssb_pcihost_remove;
+- driver->suspend = ssb_pcihost_suspend;
+- driver->resume = ssb_pcihost_resume;
++#ifdef CONFIG_PM_SLEEP
++ driver->driver.pm = &ssb_pcihost_pm_ops;
++#endif
+
+ return pci_register_driver(driver);
+ }
diff --git a/target/linux/generic/patches-3.18/025-bcma_backport.patch b/target/linux/generic/patches-3.18/025-bcma_backport.patch
index 871791e871..07ceb037b7 100644
--- a/target/linux/generic/patches-3.18/025-bcma_backport.patch
+++ b/target/linux/generic/patches-3.18/025-bcma_backport.patch
@@ -8,21 +8,198 @@
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus,
+--- a/drivers/bcma/driver_chipcommon.c
++++ b/drivers/bcma/driver_chipcommon.c
+@@ -339,7 +339,7 @@ void bcma_chipco_serial_init(struct bcma
+ return;
+ }
+
+- irq = bcma_core_irq(cc->core);
++ irq = bcma_core_irq(cc->core, 0);
+
+ /* Determine the registers of the UARTs */
+ cc->nr_serial_ports = (cc->capabilities & BCMA_CC_CAP_NRUART);
+--- a/drivers/bcma/driver_gpio.c
++++ b/drivers/bcma/driver_gpio.c
+@@ -152,7 +152,7 @@ static int bcma_gpio_irq_domain_init(str
+ handle_simple_irq);
+ }
+
+- hwirq = bcma_core_irq(cc->core);
++ hwirq = bcma_core_irq(cc->core, 0);
+ err = request_irq(hwirq, bcma_gpio_irq_handler, IRQF_SHARED, "gpio",
+ cc);
+ if (err)
+@@ -183,7 +183,7 @@ static void bcma_gpio_irq_domain_exit(st
+ return;
+
+ bcma_cc_mask32(cc, BCMA_CC_IRQMASK, ~BCMA_CC_IRQ_GPIO);
+- free_irq(bcma_core_irq(cc->core), cc);
++ free_irq(bcma_core_irq(cc->core, 0), cc);
+ for (gpio = 0; gpio < chip->ngpio; gpio++) {
+ int irq = irq_find_mapping(cc->irq_domain, gpio);
+
+--- a/drivers/bcma/driver_mips.c
++++ b/drivers/bcma/driver_mips.c
+@@ -115,7 +115,7 @@ static u32 bcma_core_mips_irqflag(struct
+ * If disabled, 5 is returned.
+ * If not supported, 6 is returned.
+ */
+-static unsigned int bcma_core_mips_irq(struct bcma_device *dev)
++unsigned int bcma_core_mips_irq(struct bcma_device *dev)
+ {
+ struct bcma_device *mdev = dev->bus->drv_mips.core;
+ u32 irqflag;
+@@ -133,13 +133,6 @@ static unsigned int bcma_core_mips_irq(s
+ return 5;
+ }
+
+-unsigned int bcma_core_irq(struct bcma_device *dev)
+-{
+- unsigned int mips_irq = bcma_core_mips_irq(dev);
+- return mips_irq <= 4 ? mips_irq + 2 : 0;
+-}
+-EXPORT_SYMBOL(bcma_core_irq);
+-
+ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
+ {
+ unsigned int oldirq = bcma_core_mips_irq(dev);
+@@ -423,7 +416,7 @@ void bcma_core_mips_init(struct bcma_drv
+ break;
+ default:
+ list_for_each_entry(core, &bus->cores, list) {
+- core->irq = bcma_core_irq(core);
++ core->irq = bcma_core_irq(core, 0);
+ }
+ bcma_err(bus,
+ "Unknown device (0x%x) found, can not configure IRQs\n",
+--- a/drivers/bcma/driver_pci_host.c
++++ b/drivers/bcma/driver_pci_host.c
+@@ -593,7 +593,7 @@ int bcma_core_pci_plat_dev_init(struct p
+ pr_info("PCI: Fixing up device %s\n", pci_name(dev));
+
+ /* Fix up interrupt lines */
+- dev->irq = bcma_core_irq(pc_host->pdev->core);
++ dev->irq = bcma_core_irq(pc_host->pdev->core, 0);
+ pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+
+ readrq = pcie_get_readrq(dev);
+@@ -617,6 +617,6 @@ int bcma_core_pci_pcibios_map_irq(const
+
+ pc_host = container_of(dev->bus->ops, struct bcma_drv_pci_host,
+ pci_ops);
+- return bcma_core_irq(pc_host->pdev->core);
++ return bcma_core_irq(pc_host->pdev->core, 0);
+ }
+ EXPORT_SYMBOL(bcma_core_pci_pcibios_map_irq);
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
-@@ -169,10 +169,8 @@ static void bcma_of_fill_device(struct p
+@@ -11,6 +11,7 @@
+ #include <linux/bcma/bcma.h>
+ #include <linux/slab.h>
+ #include <linux/of_address.h>
++#include <linux/of_irq.h>
+
+ MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
+ MODULE_LICENSE("GPL");
+@@ -153,6 +154,46 @@ static struct device_node *bcma_of_find_
+ return NULL;
+ }
+
++static int bcma_of_irq_parse(struct platform_device *parent,
++ struct bcma_device *core,
++ struct of_phandle_args *out_irq, int num)
++{
++ __be32 laddr[1];
++ int rc;
++
++ if (core->dev.of_node) {
++ rc = of_irq_parse_one(core->dev.of_node, num, out_irq);
++ if (!rc)
++ return rc;
++ }
++
++ out_irq->np = parent->dev.of_node;
++ out_irq->args_count = 1;
++ out_irq->args[0] = num;
++
++ laddr[0] = cpu_to_be32(core->addr);
++ return of_irq_parse_raw(laddr, out_irq);
++}
++
++static unsigned int bcma_of_get_irq(struct platform_device *parent,
++ struct bcma_device *core, int num)
++{
++ struct of_phandle_args out_irq;
++ int ret;
++
++ if (!parent || !parent->dev.of_node)
++ return 0;
++
++ ret = bcma_of_irq_parse(parent, core, &out_irq, num);
++ if (ret) {
++ bcma_debug(core->bus, "bcma_of_get_irq() failed with rc=%d\n",
++ ret);
++ return 0;
++ }
++
++ return irq_create_of_mapping(&out_irq);
++}
++
+ static void bcma_of_fill_device(struct platform_device *parent,
+ struct bcma_device *core)
+ {
+@@ -161,18 +202,47 @@ static void bcma_of_fill_device(struct p
+ node = bcma_of_find_child_device(parent, core);
+ if (node)
+ core->dev.of_node = node;
++
++ core->irq = bcma_of_get_irq(parent, core, 0);
+ }
+ #else
+ static void bcma_of_fill_device(struct platform_device *parent,
+ struct bcma_device *core)
+ {
}
++static inline unsigned int bcma_of_get_irq(struct platform_device *parent,
++ struct bcma_device *core, int num)
++{
++ return 0;
++}
#endif /* CONFIG_OF */
-static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
-+void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
++unsigned int bcma_core_irq(struct bcma_device *core, int num)
{
- int err;
--
++ struct bcma_bus *bus = core->bus;
++ unsigned int mips_irq;
++
++ switch (bus->hosttype) {
++ case BCMA_HOSTTYPE_PCI:
++ return bus->host_pci->irq;
++ case BCMA_HOSTTYPE_SOC:
++ if (bus->drv_mips.core && num == 0) {
++ mips_irq = bcma_core_mips_irq(core);
++ return mips_irq <= 4 ? mips_irq + 2 : 0;
++ }
++ if (bus->host_pdev)
++ return bcma_of_get_irq(bus->host_pdev, core, num);
++ return 0;
++ case BCMA_HOSTTYPE_SDIO:
++ return 0;
++ }
+
++ return 0;
++}
++EXPORT_SYMBOL(bcma_core_irq);
++
++void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
++{
core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
-@@ -196,6 +194,11 @@ static void bcma_register_core(struct bc
+@@ -196,6 +266,11 @@ static void bcma_register_core(struct bc
case BCMA_HOSTTYPE_SDIO:
break;
}
@@ -44,3 +221,29 @@
bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
core->core_index, bcma_device_name(&core->id),
+--- a/include/linux/bcma/bcma.h
++++ b/include/linux/bcma/bcma.h
+@@ -447,4 +447,6 @@ extern u32 bcma_chipco_pll_read(struct b
+ #define BCMA_DMA_TRANSLATION_DMA64_CMT 0x80000000 /* Client Mode Translation for 64-bit DMA */
+ extern u32 bcma_core_dma_translation(struct bcma_device *core);
+
++extern unsigned int bcma_core_irq(struct bcma_device *core, int num);
++
+ #endif /* LINUX_BCMA_H_ */
+--- a/include/linux/bcma/bcma_driver_mips.h
++++ b/include/linux/bcma/bcma_driver_mips.h
+@@ -43,12 +43,12 @@ struct bcma_drv_mips {
+ extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
+ extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
+
+-extern unsigned int bcma_core_irq(struct bcma_device *core);
++extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
+ #else
+ static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
+ static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
+
+-static inline unsigned int bcma_core_irq(struct bcma_device *core)
++static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
+ {
+ return 0;
+ }