From d9bb8326fa2cb6f964a6dcdf841e2e9551ee7899 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Dec 2014 21:53:20 +0000 Subject: [PATCH] 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 SVN-Revision: 43544 --- ...-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch | 58 ++++ ...M5301X-Add-buttons-for-Netgear-R6250.patch | 7 - .../121-bcma-get-irqs-from-dt.patch | 38 --- .../130-ARM-BCM5301X-register-bcma-bus.patch | 108 ++------ ...2-bcma-add-new-PCIe2-driver-for-bcma.patch | 4 +- ...-Switch-DT-files-to-gpio-keys-polled.patch | 13 - ...nable-ChipCommon-UART-serial-console.patch | 11 - ...M5301X-Add-DT-for-Buffalo-WZR-900DHP.patch | 8 - .../patches-3.14/420-mtd-bcm5301x_nand.patch | 17 +- ...-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch | 58 ++++ ...sible-to-specify-a-IRQ-num-in-bcma_c.patch | 162 ----------- .../061-bcma-get-IRQ-numbers-from-dt.patch | 141 ---------- .../130-ARM-BCM5301X-register-bcma-bus.patch | 108 ++------ ...2-bcma-add-new-PCIe2-driver-for-bcma.patch | 2 +- .../patches-3.18/420-mtd-bcm5301x_nand.patch | 17 +- .../generic/patches-3.10/020-ssb_update.patch | 83 +++++- .../patches-3.10/025-bcma_backport.patch | 258 +++++++++++++++--- .../generic/patches-3.14/020-ssb_update.patch | 90 ++++++ .../patches-3.14/025-bcma_backport.patch | 231 +++++++++++++++- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- .../generic/patches-3.18/020-ssb_update.patch | 78 ++++++ .../patches-3.18/025-bcma_backport.patch | 211 +++++++++++++- 22 files changed, 1092 insertions(+), 615 deletions(-) create mode 100644 target/linux/bcm53xx/patches-3.14/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch delete mode 100644 target/linux/bcm53xx/patches-3.14/121-bcma-get-irqs-from-dt.patch create mode 100644 target/linux/bcm53xx/patches-3.18/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch delete mode 100644 target/linux/bcm53xx/patches-3.18/060-bcma-make-it-possible-to-specify-a-IRQ-num-in-bcma_c.patch delete mode 100644 target/linux/bcm53xx/patches-3.18/061-bcma-get-IRQ-numbers-from-dt.patch create mode 100644 target/linux/generic/patches-3.18/020-ssb_update.patch diff --git a/target/linux/bcm53xx/patches-3.14/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch b/target/linux/bcm53xx/patches-3.14/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch new file mode 100644 index 0000000000..35cd0ca90a --- /dev/null +++ b/target/linux/bcm53xx/patches-3.14/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch @@ -0,0 +1,58 @@ +From dec378827c4aaab6c46ecdd5fc2c3b3155d68743 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 24 Sep 2014 23:50:07 +0200 +Subject: [PATCH] ARM: BCM5301X: Add IRQs to Broadcom's bus-axi in DTS file + +IRQ support for Broadcom's bus-axi driver bcma was merged into John +Linville's wireless tree and will show up in 3.19. This patch makes use +of this feature in the DTS file for the the BCM5301X SoCs. I left the +PCIe controller out, because this still needs some discussion. + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/boot/dts/bcm5301x.dtsi | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -101,6 +101,40 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0x000fffff 0xffff>; ++ interrupt-map = ++ /* ChipCommon */ ++ <0x00000000 0 &gic GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* USB 2.0 Controller */ ++ <0x00021000 0 &gic GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* USB 3.0 Controller */ ++ <0x00023000 0 &gic GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 0 */ ++ <0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 1 */ ++ <0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 2 */ ++ <0x00026000 0 &gic GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 3 */ ++ <0x00027000 0 &gic GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* NAND Controller */ ++ <0x00028000 0 &gic GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 1 &gic GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 2 &gic GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 3 &gic GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 4 &gic GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 5 &gic GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 6 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 7 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; ++ + chipcommon: chipcommon@0 { + reg = <0x00000000 0x1000>; + diff --git a/target/linux/bcm53xx/patches-3.14/047-ARM-BCM5301X-Add-buttons-for-Netgear-R6250.patch b/target/linux/bcm53xx/patches-3.14/047-ARM-BCM5301X-Add-buttons-for-Netgear-R6250.patch index 82aa11c5c4..2b9b900064 100644 --- a/target/linux/bcm53xx/patches-3.14/047-ARM-BCM5301X-Add-buttons-for-Netgear-R6250.patch +++ b/target/linux/bcm53xx/patches-3.14/047-ARM-BCM5301X-Add-buttons-for-Netgear-R6250.patch @@ -13,8 +13,6 @@ Signed-off-by: Hauke Mehrtens arch/arm/boot/dts/bcm5301x.dtsi | 1 + 2 files changed, 26 insertions(+) -diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts -index 58d999d..4ed7de1 100644 --- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts @@ -66,4 +66,29 @@ @@ -47,8 +45,6 @@ index 58d999d..4ed7de1 100644 + }; + }; }; -diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi -index b7c4e9e..78aec62 100644 --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi @@ -9,6 +9,7 @@ @@ -59,6 +55,3 @@ index b7c4e9e..78aec62 100644 #include #include #include "skeleton.dtsi" --- -1.8.4.5 - diff --git a/target/linux/bcm53xx/patches-3.14/121-bcma-get-irqs-from-dt.patch b/target/linux/bcm53xx/patches-3.14/121-bcma-get-irqs-from-dt.patch deleted file mode 100644 index e38b5bc1c6..0000000000 --- a/target/linux/bcm53xx/patches-3.14/121-bcma-get-irqs-from-dt.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6611afa6c49434780096cdf2c1028f0ac277f9bc Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 9 Jan 2014 19:40:14 +0100 -Subject: [PATCH v3 2/2] bcma: get IRQ numbers from dt - -It is not possible to auto detect the irq numbers used by the cores on -an arm SoC. If bcma was registered with device tree it will search for -some device tree nodes with the irq number and add it to the core -configuration. - -Signed-off-by: Hauke Mehrtens ---- - drivers/bcma/main.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 48 insertions(+), 1 deletion(-) - ---- a/drivers/bcma/main.c -+++ b/drivers/bcma/main.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - #include - - MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); -@@ -159,8 +160,10 @@ static void bcma_of_fill_device(struct p - struct device_node *node; - - node = bcma_of_find_child_device(parent, core); -- if (node) -- core->dev.of_node = node; -+ if (!node) -+ return; -+ core->dev.of_node = node; -+ core->irq = irq_of_parse_and_map(node, 0); - } - #else - static void bcma_of_fill_device(struct platform_device *parent, diff --git a/target/linux/bcm53xx/patches-3.14/130-ARM-BCM5301X-register-bcma-bus.patch b/target/linux/bcm53xx/patches-3.14/130-ARM-BCM5301X-register-bcma-bus.patch index 024123f9d3..4044b44ff2 100644 --- a/target/linux/bcm53xx/patches-3.14/130-ARM-BCM5301X-register-bcma-bus.patch +++ b/target/linux/bcm53xx/patches-3.14/130-ARM-BCM5301X-register-bcma-bus.patch @@ -9,7 +9,7 @@ Subject: [PATCH 07/17] ARM: BCM5301X: register bcma bus --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -94,18 +94,102 @@ +@@ -95,12 +95,23 @@ }; }; @@ -31,84 +31,36 @@ Subject: [PATCH 07/17] ARM: BCM5301X: register bcma bus #size-cells = <1>; + sprom = <&sprom0>; - chipcommon: chipcommon@0 { - reg = <0x00000000 0x1000>; -+ interrupts = ; + #interrupt-cells = <1>; + interrupt-map-mask = <0x000fffff 0xffff>; +@@ -108,6 +119,30 @@ + /* ChipCommon */ + <0x00000000 0 &gic GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>, - gpio-controller; - #gpio-cells = <2>; - }; -+ -+ pcie@12000 { -+ reg = <0x00012000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ ; -+ }; -+ -+ pcie@13000 { -+ reg = <0x00013000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ ; -+ }; -+ -+ pcie@14000 { -+ reg = <0x00014000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ ; -+ }; -+ -+ usb2@21000 { -+ reg = <0x00021000 0x1000>; -+ interrupts = ; -+ }; ++ /* PCIe Controller 0 */ ++ <0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + -+ usb3@23000 { -+ reg = <0x00023000 0x1000>; -+ interrupts = ; -+ }; ++ /* PCIe Controller 1 */ ++ <0x00013000 0 &gic GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 1 &gic GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 2 &gic GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 3 &gic GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 4 &gic GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 5 &gic GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>, + -+ ethernet@24000 { -+ reg = <0x00024000 0x1000>; -+ interrupts = ; -+ }; ++ /* PCIe Controller 2 */ ++ <0x00014000 0 &gic GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 1 &gic GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 2 &gic GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 3 &gic GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 4 &gic GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 5 &gic GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>, + -+ ethernet@25000 { -+ reg = <0x00025000 0x1000>; -+ interrupts = ; -+ }; -+ -+ ethernet@26000 { -+ reg = <0x00026000 0x1000>; -+ interrupts = ; -+ }; -+ -+ ethernet@27000 { -+ reg = <0x00027000 0x1000>; -+ interrupts = ; -+ }; -+ -+ nand@28000 { -+ reg = <0x00028000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ }; - }; - }; + /* USB 2.0 Controller */ + <0x00021000 0 &gic GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>, + diff --git a/target/linux/bcm53xx/patches-3.14/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch b/target/linux/bcm53xx/patches-3.14/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch index 84e6c06f5f..1b6149f20f 100644 --- a/target/linux/bcm53xx/patches-3.14/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch +++ b/target/linux/bcm53xx/patches-3.14/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch @@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig -@@ -46,6 +46,7 @@ config ARCH_BCM_5301X +@@ -45,6 +45,7 @@ config ARCH_BCM_5301X select ARM_GLOBAL_TIMER select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK select MIGHT_HAVE_PCI @@ -120,7 +120,7 @@ Signed-off-by: Hauke Mehrtens + struct pci_sys_data *sys = pdev->sysdata; + struct bcma_device *bdev = sys->private_data; + -+ return bdev->irq; ++ return bcma_core_irq(bdev, 5); +} + +static u32 bcma_pcie2_cfg_base(struct bcma_device *bdev, int busno, diff --git a/target/linux/bcm53xx/patches-3.14/304-ARM-BCM5301X-Switch-DT-files-to-gpio-keys-polled.patch b/target/linux/bcm53xx/patches-3.14/304-ARM-BCM5301X-Switch-DT-files-to-gpio-keys-polled.patch index ca7582d168..b107fe378c 100644 --- a/target/linux/bcm53xx/patches-3.14/304-ARM-BCM5301X-Switch-DT-files-to-gpio-keys-polled.patch +++ b/target/linux/bcm53xx/patches-3.14/304-ARM-BCM5301X-Switch-DT-files-to-gpio-keys-polled.patch @@ -17,8 +17,6 @@ Signed-off-by: Rafał Miłecki arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) -diff --git a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts -index 5fc0fae..583720e 100644 --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts @@ -24,7 +24,7 @@ @@ -30,8 +28,6 @@ index 5fc0fae..583720e 100644 #address-cells = <1>; #size-cells = <0>; poll-interval = <200>; -diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts -index 05e80b1..70a1093 100644 --- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts @@ -68,7 +68,7 @@ @@ -43,8 +39,6 @@ index 05e80b1..70a1093 100644 #address-cells = <1>; #size-cells = <0>; poll-interval = <200>; -diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts -index 12fc2a0..ac299a2 100644 --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts @@ -58,7 +58,7 @@ @@ -56,8 +50,6 @@ index 12fc2a0..ac299a2 100644 #address-cells = <1>; #size-cells = <0>; poll-interval = <200>; -diff --git a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts -index fb76378..934b244 100644 --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts @@ -58,7 +58,7 @@ @@ -69,8 +61,6 @@ index fb76378..934b244 100644 #address-cells = <1>; #size-cells = <0>; poll-interval = <200>; -diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts -index bbb414f..d2aefef 100644 --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts @@ -24,7 +24,7 @@ @@ -82,6 +72,3 @@ index bbb414f..d2aefef 100644 #address-cells = <1>; #size-cells = <0>; poll-interval = <200>; --- -1.8.4.5 - diff --git a/target/linux/bcm53xx/patches-3.14/305-ARM-BCM5301X-Enable-ChipCommon-UART-serial-console.patch b/target/linux/bcm53xx/patches-3.14/305-ARM-BCM5301X-Enable-ChipCommon-UART-serial-console.patch index 7d90697c6c..c81e20ff4a 100644 --- a/target/linux/bcm53xx/patches-3.14/305-ARM-BCM5301X-Enable-ChipCommon-UART-serial-console.patch +++ b/target/linux/bcm53xx/patches-3.14/305-ARM-BCM5301X-Enable-ChipCommon-UART-serial-console.patch @@ -14,8 +14,6 @@ Signed-off-by: Rafał Miłecki arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 10 ++++++++++ 4 files changed, 40 insertions(+) -diff --git a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts -index 583720e..d472c36 100644 --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts @@ -23,6 +23,16 @@ @@ -35,8 +33,6 @@ index 583720e..d472c36 100644 gpio-keys { compatible = "gpio-keys-polled"; #address-cells = <1>; -diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts -index ac299a2..257d6da 100644 --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts @@ -23,6 +23,16 @@ @@ -56,8 +52,6 @@ index ac299a2..257d6da 100644 leds { compatible = "gpio-leds"; -diff --git a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts -index 934b244..cad0e85 100644 --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts @@ -23,6 +23,16 @@ @@ -77,8 +71,6 @@ index 934b244..cad0e85 100644 leds { compatible = "gpio-leds"; -diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts -index d2aefef..f3a0326 100644 --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts @@ -23,6 +23,16 @@ @@ -98,6 +90,3 @@ index d2aefef..f3a0326 100644 gpio-keys { compatible = "gpio-keys-polled"; #address-cells = <1>; --- -1.8.4.5 - diff --git a/target/linux/bcm53xx/patches-3.14/320-ARM-BCM5301X-Add-DT-for-Buffalo-WZR-900DHP.patch b/target/linux/bcm53xx/patches-3.14/320-ARM-BCM5301X-Add-DT-for-Buffalo-WZR-900DHP.patch index 96c728dfb0..197869745d 100644 --- a/target/linux/bcm53xx/patches-3.14/320-ARM-BCM5301X-Add-DT-for-Buffalo-WZR-900DHP.patch +++ b/target/linux/bcm53xx/patches-3.14/320-ARM-BCM5301X-Add-DT-for-Buffalo-WZR-900DHP.patch @@ -13,8 +13,6 @@ Signed-off-by: Rafał Miłecki 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts -diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 64c8f3f..41e8455 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -55,7 +55,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ @@ -27,9 +25,6 @@ index 64c8f3f..41e8455 100644 dtb-$(CONFIG_ARCH_BERLIN) += \ berlin2-sony-nsz-gs7.dtb \ berlin2cd-google-chromecast.dtb -diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts -new file mode 100644 -index 0000000..5e4b3a9 --- /dev/null +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts @@ -0,0 +1,35 @@ @@ -68,6 +63,3 @@ index 0000000..5e4b3a9 + }; + }; +}; --- -1.8.4.5 - diff --git a/target/linux/bcm53xx/patches-3.14/420-mtd-bcm5301x_nand.patch b/target/linux/bcm53xx/patches-3.14/420-mtd-bcm5301x_nand.patch index 86c288d41e..0e03870883 100644 --- a/target/linux/bcm53xx/patches-3.14/420-mtd-bcm5301x_nand.patch +++ b/target/linux/bcm53xx/patches-3.14/420-mtd-bcm5301x_nand.patch @@ -22,7 +22,7 @@ nand-objs := nand_base.o nand_bbt.o --- /dev/null +++ b/drivers/mtd/nand/bcm_nand.c -@@ -0,0 +1,1591 @@ +@@ -0,0 +1,1590 @@ +/* + * Nortstar NAND controller driver + * for Linux NAND library and MTD interface @@ -1527,15 +1527,9 @@ +static int bcmnand_probe(struct bcma_device *core) +{ + struct device *dev = &core->dev; -+ struct device_node *np = dev->of_node; + struct bcmnand_ctrl *ctrl; + int res, i, irq; + -+ if (!np) { -+ pr_err("%s: no device tree node found\n", DRV_NAME); -+ return -ENOENT; -+ } -+ + ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return -ENOMEM; @@ -1546,8 +1540,13 @@ + ctrl->core = core; + + /* Acquire all interrupt lines */ -+ for (i = 0; i < of_irq_count(np); i++) { -+ irq = irq_of_parse_and_map(np, i); ++ for (i = 0; i < NANDC_IRQ_NUM; i++) { ++ irq = bcma_core_irq(core, i); ++ if (!irq) { ++ pr_err("%s: IRQ no available irq: %i (idx: %i)\n", ++ DRV_NAME, irq, i); ++ return res; ++ } + res = devm_request_irq(dev, irq, bcmnand_isr, 0, DRV_NAME, ctrl); + if (res < 0) { + pr_err("%s: problem requesting irq: %i (idx: %i)\n", diff --git a/target/linux/bcm53xx/patches-3.18/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch b/target/linux/bcm53xx/patches-3.18/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch new file mode 100644 index 0000000000..35cd0ca90a --- /dev/null +++ b/target/linux/bcm53xx/patches-3.18/046-ARM-BCM5301X-Add-IRQs-to-Broadcom-s-bus-axi-in-DTS-f.patch @@ -0,0 +1,58 @@ +From dec378827c4aaab6c46ecdd5fc2c3b3155d68743 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 24 Sep 2014 23:50:07 +0200 +Subject: [PATCH] ARM: BCM5301X: Add IRQs to Broadcom's bus-axi in DTS file + +IRQ support for Broadcom's bus-axi driver bcma was merged into John +Linville's wireless tree and will show up in 3.19. This patch makes use +of this feature in the DTS file for the the BCM5301X SoCs. I left the +PCIe controller out, because this still needs some discussion. + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/boot/dts/bcm5301x.dtsi | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -101,6 +101,40 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0x000fffff 0xffff>; ++ interrupt-map = ++ /* ChipCommon */ ++ <0x00000000 0 &gic GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* USB 2.0 Controller */ ++ <0x00021000 0 &gic GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* USB 3.0 Controller */ ++ <0x00023000 0 &gic GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 0 */ ++ <0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 1 */ ++ <0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 2 */ ++ <0x00026000 0 &gic GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 3 */ ++ <0x00027000 0 &gic GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* NAND Controller */ ++ <0x00028000 0 &gic GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 1 &gic GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 2 &gic GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 3 &gic GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 4 &gic GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 5 &gic GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 6 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00028000 7 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; ++ + chipcommon: chipcommon@0 { + reg = <0x00000000 0x1000>; + diff --git a/target/linux/bcm53xx/patches-3.18/060-bcma-make-it-possible-to-specify-a-IRQ-num-in-bcma_c.patch b/target/linux/bcm53xx/patches-3.18/060-bcma-make-it-possible-to-specify-a-IRQ-num-in-bcma_c.patch deleted file mode 100644 index d030b86ac2..0000000000 --- a/target/linux/bcm53xx/patches-3.18/060-bcma-make-it-possible-to-specify-a-IRQ-num-in-bcma_c.patch +++ /dev/null @@ -1,162 +0,0 @@ -From f3bbc921543ad8098617a5a6a8054fab11878a25 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Wed, 1 Oct 2014 00:30:37 +0200 -Subject: [PATCH 1/3] bcma: make it possible to specify a IRQ num in - bcma_core_irq() - -This moves bcma_core_irq() to main.c and add a extra parameter with a -number so that we can return different irq number for devices with more -than one. - -Signed-off-by: Hauke Mehrtens ---- - drivers/bcma/driver_chipcommon.c | 2 +- - drivers/bcma/driver_gpio.c | 4 ++-- - drivers/bcma/driver_mips.c | 11 ++--------- - drivers/bcma/driver_pci_host.c | 4 ++-- - drivers/bcma/main.c | 22 ++++++++++++++++++++++ - include/linux/bcma/bcma.h | 2 ++ - include/linux/bcma/bcma_driver_mips.h | 4 ++-- - 7 files changed, 33 insertions(+), 16 deletions(-) - ---- 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,6 +169,28 @@ static void bcma_of_fill_device(struct p - } - #endif /* CONFIG_OF */ - -+unsigned int bcma_core_irq(struct bcma_device *core, int num) -+{ -+ 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; -+ } -+ break; -+ 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; ---- 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; - } diff --git a/target/linux/bcm53xx/patches-3.18/061-bcma-get-IRQ-numbers-from-dt.patch b/target/linux/bcm53xx/patches-3.18/061-bcma-get-IRQ-numbers-from-dt.patch deleted file mode 100644 index 886f6fb9c9..0000000000 --- a/target/linux/bcm53xx/patches-3.18/061-bcma-get-IRQ-numbers-from-dt.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 4eb6a1fd46965ed6c3fb9327276eb53a3021eaaa Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 9 Jan 2014 19:40:14 +0100 -Subject: [PATCH 3/3] bcma: get IRQ numbers from dt - -It is not possible to auto detect the irq numbers used by the cores on -an arm SoC. If bcma was registered with device tree it will search for -some device tree nodes with the irq number and add it to the core -configuration. - -Signed-off-by: Hauke Mehrtens ---- - Documentation/devicetree/bindings/bus/bcma.txt | 21 +++++++++++ - drivers/bcma/main.c | 52 +++++++++++++++++++++++++- - 2 files changed, 72 insertions(+), 1 deletion(-) - ---- a/Documentation/devicetree/bindings/bus/bcma.txt -+++ b/Documentation/devicetree/bindings/bus/bcma.txt -@@ -8,6 +8,11 @@ Required properties: - - The cores on the AXI bus are automatically detected by bcma with the - memory ranges they are using and they get registered afterwards. -+Automatic detection of the IRQ number is not working on -+BCM47xx/BCM53xx ARM SoCs. To assign IRQ numbers to the cores, provide -+them manually through device tree. Use an interrupt-map to specify the -+IRQ used by the devices on the bus. The first address is just an index, -+because we do not have any special register. - - The top-level axi bus may contain children representing attached cores - (devices). This is needed since some hardware details can't be auto -@@ -22,6 +27,22 @@ Example: - ranges = <0x00000000 0x18000000 0x00100000>; - #address-cells = <1>; - #size-cells = <1>; -+ #interrupt-cells = <1>; -+ interrupt-map-mask = <0x000fffff 0xffff>; -+ interrupt-map = -+ /* Ethernet Controller 0 */ -+ <0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>, -+ -+ /* Ethernet Controller 1 */ -+ <0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; -+ -+ /* PCIe Controller 0 */ -+ <0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, -+ <0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, -+ <0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, -+ <0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, -+ <0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, -+ <0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; - - chipcommon { - reg = <0x00000000 0x1000>; ---- a/drivers/bcma/main.c -+++ b/drivers/bcma/main.c -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - 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,12 +202,19 @@ 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 */ - - unsigned int bcma_core_irq(struct bcma_device *core, int num) -@@ -182,7 +230,9 @@ unsigned int bcma_core_irq(struct bcma_d - mips_irq = bcma_core_mips_irq(core); - return mips_irq <= 4 ? mips_irq + 2 : 0; - } -- break; -+ if (bus->host_pdev) -+ return bcma_of_get_irq(bus->host_pdev, core, num); -+ return 0; - case BCMA_HOSTTYPE_SDIO: - return 0; - } diff --git a/target/linux/bcm53xx/patches-3.18/130-ARM-BCM5301X-register-bcma-bus.patch b/target/linux/bcm53xx/patches-3.18/130-ARM-BCM5301X-register-bcma-bus.patch index c6dbf7bf7e..4044b44ff2 100644 --- a/target/linux/bcm53xx/patches-3.18/130-ARM-BCM5301X-register-bcma-bus.patch +++ b/target/linux/bcm53xx/patches-3.18/130-ARM-BCM5301X-register-bcma-bus.patch @@ -9,7 +9,7 @@ Subject: [PATCH 07/17] ARM: BCM5301X: register bcma bus --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -95,18 +95,102 @@ +@@ -95,12 +95,23 @@ }; }; @@ -31,84 +31,36 @@ Subject: [PATCH 07/17] ARM: BCM5301X: register bcma bus #size-cells = <1>; + sprom = <&sprom0>; - chipcommon: chipcommon@0 { - reg = <0x00000000 0x1000>; -+ interrupts = ; + #interrupt-cells = <1>; + interrupt-map-mask = <0x000fffff 0xffff>; +@@ -108,6 +119,30 @@ + /* ChipCommon */ + <0x00000000 0 &gic GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>, - gpio-controller; - #gpio-cells = <2>; - }; -+ -+ pcie@12000 { -+ reg = <0x00012000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ ; -+ }; -+ -+ pcie@13000 { -+ reg = <0x00013000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ ; -+ }; -+ -+ pcie@14000 { -+ reg = <0x00014000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ ; -+ }; -+ -+ usb2@21000 { -+ reg = <0x00021000 0x1000>; -+ interrupts = ; -+ }; ++ /* PCIe Controller 0 */ ++ <0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + -+ usb3@23000 { -+ reg = <0x00023000 0x1000>; -+ interrupts = ; -+ }; ++ /* PCIe Controller 1 */ ++ <0x00013000 0 &gic GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 1 &gic GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 2 &gic GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 3 &gic GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 4 &gic GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00013000 5 &gic GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>, + -+ ethernet@24000 { -+ reg = <0x00024000 0x1000>; -+ interrupts = ; -+ }; ++ /* PCIe Controller 2 */ ++ <0x00014000 0 &gic GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 1 &gic GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 2 &gic GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 3 &gic GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 4 &gic GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00014000 5 &gic GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>, + -+ ethernet@25000 { -+ reg = <0x00025000 0x1000>; -+ interrupts = ; -+ }; -+ -+ ethernet@26000 { -+ reg = <0x00026000 0x1000>; -+ interrupts = ; -+ }; -+ -+ ethernet@27000 { -+ reg = <0x00027000 0x1000>; -+ interrupts = ; -+ }; -+ -+ nand@28000 { -+ reg = <0x00028000 0x1000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ }; - }; - }; + /* USB 2.0 Controller */ + <0x00021000 0 &gic GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>, + diff --git a/target/linux/bcm53xx/patches-3.18/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch b/target/linux/bcm53xx/patches-3.18/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch index 9254089c95..3efdeea218 100644 --- a/target/linux/bcm53xx/patches-3.18/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch +++ b/target/linux/bcm53xx/patches-3.18/170-pcie2-bcma-add-new-PCIe2-driver-for-bcma.patch @@ -120,7 +120,7 @@ Signed-off-by: Hauke Mehrtens + struct pci_sys_data *sys = pdev->sysdata; + struct bcma_device *bdev = sys->private_data; + -+ return bdev->irq; ++ return bcma_core_irq(bdev, 5); +} + +static u32 bcma_pcie2_cfg_base(struct bcma_device *bdev, int busno, diff --git a/target/linux/bcm53xx/patches-3.18/420-mtd-bcm5301x_nand.patch b/target/linux/bcm53xx/patches-3.18/420-mtd-bcm5301x_nand.patch index 0b549f842c..d51ce04962 100644 --- a/target/linux/bcm53xx/patches-3.18/420-mtd-bcm5301x_nand.patch +++ b/target/linux/bcm53xx/patches-3.18/420-mtd-bcm5301x_nand.patch @@ -22,7 +22,7 @@ nand-objs := nand_base.o nand_bbt.o nand_timings.o --- /dev/null +++ b/drivers/mtd/nand/bcm_nand.c -@@ -0,0 +1,1591 @@ +@@ -0,0 +1,1590 @@ +/* + * Nortstar NAND controller driver + * for Linux NAND library and MTD interface @@ -1527,15 +1527,9 @@ +static int bcmnand_probe(struct bcma_device *core) +{ + struct device *dev = &core->dev; -+ struct device_node *np = dev->of_node; + struct bcmnand_ctrl *ctrl; + int res, i, irq; + -+ if (!np) { -+ pr_err("%s: no device tree node found\n", DRV_NAME); -+ return -ENOENT; -+ } -+ + ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return -ENOMEM; @@ -1546,8 +1540,13 @@ + ctrl->core = core; + + /* Acquire all interrupt lines */ -+ for (i = 0; i < of_irq_count(np); i++) { -+ irq = irq_of_parse_and_map(np, i); ++ for (i = 0; i < NANDC_IRQ_NUM; i++) { ++ irq = bcma_core_irq(core, i); ++ if (!irq) { ++ pr_err("%s: IRQ no available irq: %i (idx: %i)\n", ++ DRV_NAME, irq, i); ++ return res; ++ } + res = devm_request_irq(dev, irq, bcmnand_isr, 0, DRV_NAME, ctrl); + if (res < 0) { + pr_err("%s: problem requesting irq: %i (idx: %i)\n", diff --git a/target/linux/generic/patches-3.10/020-ssb_update.patch b/target/linux/generic/patches-3.10/020-ssb_update.patch index 6e93b9a91d..a85ab10967 100644 --- a/target/linux/generic/patches-3.10/020-ssb_update.patch +++ b/target/linux/generic/patches-3.10/020-ssb_update.patch @@ -179,7 +179,7 @@ static int ssb_gpio_chipco_get_value(struct gpio_chip *chip, unsigned gpio) { struct ssb_bus *bus = ssb_gpio_get_bus(chip); -@@ -74,19 +98,129 @@ static void ssb_gpio_chipco_free(struct +@@ -74,19 +98,129 @@ static void ssb_gpio_chipco_free(struct ssb_chipco_gpio_pullup(&bus->chipco, 1 << gpio, 0); } @@ -526,6 +526,16 @@ int ssb_gpio_init(struct ssb_bus *bus) { if (ssb_chipco_available(&bus->chipco)) +@@ -201,7 +475,8 @@ int ssb_gpio_unregister(struct ssb_bus * + { + if (ssb_chipco_available(&bus->chipco) || + ssb_extif_available(&bus->extif)) { +- return gpiochip_remove(&bus->gpio); ++ gpiochip_remove(&bus->gpio); ++ return 0; + } else { + SSB_WARN_ON(1); + } --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c @@ -553,6 +553,14 @@ static int ssb_devices_register(struct s @@ -726,15 +736,82 @@ for (i = 0; i < ARRAY_SIZE(pwr_info_offset); i++) { --- a/drivers/ssb/pcihost_wrapper.c +++ b/drivers/ssb/pcihost_wrapper.c -@@ -38,7 +38,7 @@ static int ssb_pcihost_resume(struct pci +@@ -11,15 +11,17 @@ + * Licensed under the GNU/GPL. See COPYING for details. + */ + ++#include + #include + #include + #include + #include + + +-#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, 0); -+ 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); + } --- a/drivers/ssb/sprom.c +++ b/drivers/ssb/sprom.c @@ -54,7 +54,7 @@ static int hex2sprom(u16 *sprom, const c diff --git a/target/linux/generic/patches-3.10/025-bcma_backport.patch b/target/linux/generic/patches-3.10/025-bcma_backport.patch index f752b0b0a1..3ae8fd54a2 100644 --- a/target/linux/generic/patches-3.10/025-bcma_backport.patch +++ b/target/linux/generic/patches-3.10/025-bcma_backport.patch @@ -48,16 +48,17 @@ bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h -@@ -22,6 +22,8 @@ +@@ -22,6 +22,9 @@ struct bcma_bus; /* main.c */ +bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, + int timeout); ++void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core); 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, -@@ -31,8 +33,6 @@ int __init bcma_bus_early_register(struc +@@ -31,8 +34,6 @@ int __init bcma_bus_early_register(struc int bcma_bus_suspend(struct bcma_bus *bus); int bcma_bus_resume(struct bcma_bus *bus); #endif @@ -66,7 +67,7 @@ /* scan.c */ int bcma_bus_scan(struct bcma_bus *bus); -@@ -50,6 +50,10 @@ void bcma_chipco_serial_init(struct bcma +@@ -50,6 +51,10 @@ void bcma_chipco_serial_init(struct bcma extern struct platform_device bcma_pflash_dev; #endif /* CONFIG_BCMA_DRIVER_MIPS */ @@ -77,7 +78,7 @@ /* driver_chipcommon_pmu.c */ u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc); u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc); -@@ -84,6 +88,20 @@ extern int __init bcma_host_pci_init(voi +@@ -84,6 +89,20 @@ extern int __init bcma_host_pci_init(voi extern void __exit bcma_host_pci_exit(void); #endif /* CONFIG_BCMA_HOST_PCI */ @@ -145,7 +146,7 @@ } EXPORT_SYMBOL_GPL(bcma_core_disable); -@@ -43,6 +64,7 @@ int bcma_core_enable(struct bcma_device +@@ -43,6 +64,7 @@ int bcma_core_enable(struct bcma_device bcma_aread32(core, BCMA_IOCTL); bcma_awrite32(core, BCMA_RESET_CTL, 0); @@ -173,6 +174,15 @@ } if (cc->capabilities & BCMA_CC_CAP_PMU) +@@ -332,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_chipcommon_pmu.c +++ b/drivers/bcma/driver_chipcommon_pmu.c @@ -56,6 +56,109 @@ void bcma_chipco_regctl_maskset(struct b @@ -374,7 +384,7 @@ }; static void bcma_sflash_cmd(struct bcma_drv_cc *cc, u32 opcode) -@@ -89,7 +89,7 @@ int bcma_sflash_init(struct bcma_drv_cc +@@ -89,7 +89,7 @@ int bcma_sflash_init(struct bcma_drv_cc { struct bcma_bus *bus = cc->core->bus; struct bcma_sflash *sflash = &cc->sflash; @@ -476,7 +486,7 @@ + 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) @@ -507,7 +517,7 @@ + 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); + @@ -557,7 +567,7 @@ /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get * a random base number. */ -@@ -105,10 +239,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c +@@ -105,10 +239,22 @@ int bcma_gpio_init(struct bcma_drv_cc *c else chip->base = -1; @@ -577,8 +587,10 @@ int bcma_gpio_unregister(struct bcma_drv_cc *cc) { +- return gpiochip_remove(&cc->gpio); + bcma_gpio_irq_domain_exit(cc); - return gpiochip_remove(&cc->gpio); ++ gpiochip_remove(&cc->gpio); ++ return 0; } --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c @@ -609,7 +621,7 @@ u8 address, u16 data) { int max_retries = 10; -@@ -137,6 +137,13 @@ static void bcma_pcie_mdio_write(struct +@@ -137,6 +137,13 @@ static void bcma_pcie_mdio_write(struct pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0); } @@ -706,8 +718,12 @@ if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) { /* This is not a device on the PCI-core bridge. */ -@@ -595,6 +596,11 @@ int bcma_core_pci_plat_dev_init(struct p - dev->irq = bcma_core_irq(pc_host->pdev->core); +@@ -592,9 +593,14 @@ 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); @@ -718,6 +734,14 @@ return 0; } EXPORT_SYMBOL(bcma_core_pci_plat_dev_init); +@@ -611,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); --- /dev/null +++ b/drivers/bcma/driver_pcie2.c @@ -0,0 +1,175 @@ @@ -922,7 +946,7 @@ /* Register */ err = bcma_bus_register(bus); if (err) -@@ -235,7 +241,6 @@ static void bcma_host_pci_remove(struct +@@ -235,7 +241,6 @@ static void bcma_host_pci_remove(struct pci_release_regions(dev); pci_disable_device(dev); kfree(bus); @@ -930,15 +954,16 @@ } #ifdef CONFIG_PM_SLEEP -@@ -267,15 +272,20 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bc +@@ -267,15 +272,21 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bc #endif /* CONFIG_PM_SLEEP */ -static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = { +static const struct pci_device_id bcma_pci_bridge_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) }, +- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) }, + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) }, - { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) }, /* 0xa8d8 */ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) }, @@ -948,21 +973,23 @@ + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) }, + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) }, -+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xA8DB */ ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */ ++ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */ { 0, }, }; MODULE_DEVICE_TABLE(pci, bcma_pci_bridge_tbl); --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c -@@ -10,6 +10,7 @@ +@@ -10,6 +10,8 @@ #include #include #include +#include ++#include MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); MODULE_LICENSE("GPL"); -@@ -69,28 +70,36 @@ static u16 bcma_cc_core_id(struct bcma_b +@@ -69,28 +71,36 @@ static u16 bcma_cc_core_id(struct bcma_b return BCMA_CORE_CHIPCOMMON; } @@ -1010,7 +1037,7 @@ } static void bcma_release_core_dev(struct device *dev) -@@ -103,55 +112,121 @@ static void bcma_release_core_dev(struct +@@ -103,55 +113,195 @@ static void bcma_release_core_dev(struct kfree(core); } @@ -1026,7 +1053,7 @@ + return false; +} + -+#ifdef CONFIG_OF ++#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS) +static struct device_node *bcma_of_find_child_device(struct platform_device *parent, + struct bcma_device *core) +{ @@ -1047,6 +1074,46 @@ + 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) +{ @@ -1055,18 +1122,47 @@ + 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) ++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); @@ -1090,6 +1186,11 @@ + case BCMA_HOSTTYPE_SDIO: + break; + } ++} ++ ++static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) ++{ ++ int err; + + err = device_register(&core->dev); + if (err) { @@ -1161,7 +1262,7 @@ } #ifdef CONFIG_BCMA_DRIVER_MIPS -@@ -218,7 +293,7 @@ int bcma_bus_register(struct bcma_bus *b +@@ -218,7 +368,7 @@ int bcma_bus_register(struct bcma_bus *b err = bcma_bus_scan(bus); if (err) { bcma_err(bus, "Failed to scan: %d\n", err); @@ -1170,7 +1271,7 @@ } /* Early init CC core */ -@@ -228,6 +303,12 @@ int bcma_bus_register(struct bcma_bus *b +@@ -228,6 +378,12 @@ int bcma_bus_register(struct bcma_bus *b bcma_core_chipcommon_early_init(&bus->drv_cc); } @@ -1183,7 +1284,7 @@ /* Try to get SPROM */ err = bcma_sprom_get(bus); if (err == -ENOENT) { -@@ -242,6 +323,13 @@ int bcma_bus_register(struct bcma_bus *b +@@ -242,6 +398,13 @@ int bcma_bus_register(struct bcma_bus *b bcma_core_chipcommon_init(&bus->drv_cc); } @@ -1197,7 +1298,7 @@ /* Init MIPS core */ core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); if (core) { -@@ -263,6 +351,13 @@ int bcma_bus_register(struct bcma_bus *b +@@ -263,6 +426,13 @@ int bcma_bus_register(struct bcma_bus *b bcma_core_pci_init(&bus->drv_pci[1]); } @@ -1211,7 +1312,7 @@ /* Init GBIT MAC COMMON core */ core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); if (core) { -@@ -271,7 +366,7 @@ int bcma_bus_register(struct bcma_bus *b +@@ -271,7 +441,7 @@ int bcma_bus_register(struct bcma_bus *b } /* Register found cores */ @@ -1220,7 +1321,7 @@ bcma_info(bus, "Bus registered\n"); -@@ -289,6 +384,8 @@ void bcma_bus_unregister(struct bcma_bus +@@ -289,6 +459,8 @@ void bcma_bus_unregister(struct bcma_bus else if (err) bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); @@ -1229,7 +1330,7 @@ cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); cores[2] = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); -@@ -308,8 +405,6 @@ int __init bcma_bus_early_register(struc +@@ -308,8 +480,6 @@ int __init bcma_bus_early_register(struc struct bcma_device *core; struct bcma_device_id match; @@ -1238,7 +1339,7 @@ match.manuf = BCMA_MANUF_BCM; match.id = bcma_cc_core_id(bus); match.class = BCMA_CL_SIM; -@@ -468,6 +563,11 @@ static int __init bcma_modinit(void) +@@ -468,6 +638,11 @@ static int __init bcma_modinit(void) if (err) return err; @@ -1250,7 +1351,7 @@ #ifdef CONFIG_BCMA_HOST_PCI err = bcma_host_pci_init(); if (err) { -@@ -485,6 +585,7 @@ static void __exit bcma_modexit(void) +@@ -485,6 +660,7 @@ static void __exit bcma_modexit(void) #ifdef CONFIG_BCMA_HOST_PCI bcma_host_pci_exit(); #endif @@ -1260,7 +1361,7 @@ module_exit(bcma_modexit) --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c -@@ -32,6 +32,18 @@ static const struct bcma_device_id_name +@@ -32,6 +32,18 @@ static const struct bcma_device_id_name { BCMA_CORE_4706_CHIPCOMMON, "BCM4706 ChipCommon" }, { BCMA_CORE_4706_SOC_RAM, "BCM4706 SOC RAM" }, { BCMA_CORE_4706_MAC_GBIT, "BCM4706 GBit MAC" }, @@ -1431,6 +1532,14 @@ erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM); if (bus->hosttype == BCMA_HOSTTYPE_SOC) { eromptr = ioremap_nocache(erombase, BCMA_CORE_SIZE); +@@ -489,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus) + bus->nr_cores++; + other_core = bcma_find_core_reverse(bus, core->id.id); + core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1; ++ bcma_prepare_core(bus, core); + + 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/drivers/bcma/sprom.c +++ b/drivers/bcma/sprom.c @@ -72,12 +72,12 @@ fail: @@ -1760,6 +1869,13 @@ extern bool bcma_core_is_enabled(struct bcma_device *core); extern void bcma_core_disable(struct bcma_device *core, u32 flags); extern int bcma_core_enable(struct bcma_device *core, u32 flags); +@@ -415,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_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h @@ -330,6 +330,8 @@ @@ -1869,6 +1985,23 @@ +void bcma_chipco_b_mii_write(struct bcma_drv_cc_b *ccb, u32 offset, u32 value); + #endif /* LINUX_BCMA_DRIVER_CC_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; + } --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h @@ -181,10 +181,31 @@ struct pci_dev; @@ -2169,7 +2302,30 @@ static const char * const part_probes[] = { "bcm47xxpart", NULL }; static struct physmap_flash_data bcma_pflash_data = { -@@ -229,11 +237,51 @@ u32 bcma_cpu_clock(struct bcma_drv_mips +@@ -107,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; +@@ -125,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); +@@ -229,11 +230,51 @@ u32 bcma_cpu_clock(struct bcma_drv_mips } EXPORT_SYMBOL(bcma_cpu_clock); @@ -2221,7 +2377,7 @@ switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { case BCMA_CC_FLASHT_STSER: -@@ -269,6 +317,20 @@ static void bcma_core_mips_flash_detect( +@@ -269,6 +310,20 @@ static void bcma_core_mips_flash_detect( bcma_nflash_init(cc); } } @@ -2242,6 +2398,15 @@ } void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) +@@ -361,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/host_soc.c +++ b/drivers/bcma/host_soc.c @@ -7,6 +7,9 @@ @@ -2495,7 +2660,7 @@ bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL); --- /dev/null +++ b/Documentation/devicetree/bindings/bus/bcma.txt -@@ -0,0 +1,32 @@ +@@ -0,0 +1,53 @@ +Driver for ARM AXI Bus with Broadcom Plugins (bcma) + +Required properties: @@ -2506,6 +2671,11 @@ + +The cores on the AXI bus are automatically detected by bcma with the +memory ranges they are using and they get registered afterwards. ++Automatic detection of the IRQ number is not working on ++BCM47xx/BCM53xx ARM SoCs. To assign IRQ numbers to the cores, provide ++them manually through device tree. Use an interrupt-map to specify the ++IRQ used by the devices on the bus. The first address is just an index, ++because we do not have any special register. + +The top-level axi bus may contain children representing attached cores +(devices). This is needed since some hardware details can't be auto @@ -2520,6 +2690,22 @@ + ranges = <0x00000000 0x18000000 0x00100000>; + #address-cells = <1>; + #size-cells = <1>; ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0x000fffff 0xffff>; ++ interrupt-map = ++ /* Ethernet Controller 0 */ ++ <0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 1 */ ++ <0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; ++ ++ /* PCIe Controller 0 */ ++ <0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; + + chipcommon { + reg = <0x00000000 0x1000>; diff --git a/target/linux/generic/patches-3.14/020-ssb_update.patch b/target/linux/generic/patches-3.14/020-ssb_update.patch index 8367b69fb6..e1fd275af0 100644 --- a/target/linux/generic/patches-3.14/020-ssb_update.patch +++ b/target/linux/generic/patches-3.14/020-ssb_update.patch @@ -8,6 +8,18 @@ { 0, }, }; MODULE_DEVICE_TABLE(pci, b43_pci_bridge_tbl); +--- a/drivers/ssb/driver_gpio.c ++++ b/drivers/ssb/driver_gpio.c +@@ -475,7 +475,8 @@ int ssb_gpio_unregister(struct ssb_bus * + { + if (ssb_chipco_available(&bus->chipco) || + ssb_extif_available(&bus->extif)) { +- return gpiochip_remove(&bus->gpio); ++ gpiochip_remove(&bus->gpio); ++ return 0; + } else { + SSB_WARN_ON(1); + } --- a/drivers/ssb/pci.c +++ b/drivers/ssb/pci.c @@ -326,13 +326,13 @@ err_ctlreg: @@ -163,6 +175,84 @@ /* Extract cores power info info */ for (i = 0; i < ARRAY_SIZE(pwr_info_offset); i++) { +--- 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 + #include + #include + #include + #include + + +-#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); + } --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h @@ -33,6 +33,7 @@ struct ssb_sprom { diff --git a/target/linux/generic/patches-3.14/025-bcma_backport.patch b/target/linux/generic/patches-3.14/025-bcma_backport.patch index a27cc8545e..2791ce1bb6 100644 --- a/target/linux/generic/patches-3.14/025-bcma_backport.patch +++ b/target/linux/generic/patches-3.14/025-bcma_backport.patch @@ -11,6 +11,17 @@ bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o +--- 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_chipcommon_pmu.c +++ b/drivers/bcma/driver_chipcommon_pmu.c @@ -603,6 +603,8 @@ void bcma_pmu_spuravoid_pllupdate(struct @@ -33,6 +44,24 @@ static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) { struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip); +@@ -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); + @@ -215,10 +215,22 @@ int bcma_gpio_init(struct bcma_drv_cc *c chip->set = bcma_gpio_set_value; chip->direction_input = bcma_gpio_direction_input; @@ -58,6 +87,33 @@ /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get * a random base number. */ +@@ -243,5 +255,6 @@ int bcma_gpio_init(struct bcma_drv_cc *c + int bcma_gpio_unregister(struct bcma_drv_cc *cc) + { + bcma_gpio_irq_domain_exit(cc); +- return gpiochip_remove(&cc->gpio); ++ gpiochip_remove(&cc->gpio); ++ return 0; + } +--- 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); --- /dev/null +++ b/drivers/bcma/driver_pcie2.c @@ -0,0 +1,175 @@ @@ -270,15 +326,16 @@ MODULE_DEVICE_TABLE(pci, bcma_pci_bridge_tbl); --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c -@@ -10,6 +10,7 @@ +@@ -10,6 +10,8 @@ #include #include #include +#include ++#include MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); MODULE_LICENSE("GPL"); -@@ -120,56 +121,124 @@ static void bcma_release_core_dev(struct +@@ -120,56 +122,195 @@ static void bcma_release_core_dev(struct kfree(core); } @@ -315,6 +372,46 @@ + 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) +{ @@ -323,14 +420,45 @@ + 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 */ + ++unsigned int bcma_core_irq(struct bcma_device *core, int num) ++{ ++ 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; @@ -433,7 +561,7 @@ } #ifdef CONFIG_BCMA_DRIVER_MIPS -@@ -246,6 +315,12 @@ int bcma_bus_register(struct bcma_bus *b +@@ -246,6 +387,12 @@ int bcma_bus_register(struct bcma_bus *b bcma_core_chipcommon_early_init(&bus->drv_cc); } @@ -446,7 +574,7 @@ /* Try to get SPROM */ err = bcma_sprom_get(bus); if (err == -ENOENT) { -@@ -260,6 +335,13 @@ int bcma_bus_register(struct bcma_bus *b +@@ -260,6 +407,13 @@ int bcma_bus_register(struct bcma_bus *b bcma_core_chipcommon_init(&bus->drv_cc); } @@ -460,7 +588,7 @@ /* Init MIPS core */ core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); if (core) { -@@ -281,6 +363,13 @@ int bcma_bus_register(struct bcma_bus *b +@@ -281,6 +435,13 @@ int bcma_bus_register(struct bcma_bus *b bcma_core_pci_init(&bus->drv_pci[1]); } @@ -474,7 +602,7 @@ /* Init GBIT MAC COMMON core */ core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); if (core) { -@@ -289,7 +378,7 @@ int bcma_bus_register(struct bcma_bus *b +@@ -289,7 +450,7 @@ int bcma_bus_register(struct bcma_bus *b } /* Register found cores */ @@ -483,7 +611,7 @@ bcma_info(bus, "Bus registered\n"); -@@ -307,6 +396,8 @@ void bcma_bus_unregister(struct bcma_bus +@@ -307,6 +468,8 @@ void bcma_bus_unregister(struct bcma_bus else if (err) bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); @@ -492,7 +620,7 @@ cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); cores[2] = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); -@@ -326,8 +417,6 @@ int __init bcma_bus_early_register(struc +@@ -326,8 +489,6 @@ int __init bcma_bus_early_register(struc struct bcma_device *core; struct bcma_device_id match; @@ -501,7 +629,7 @@ match.manuf = BCMA_MANUF_BCM; match.id = bcma_cc_core_id(bus); match.class = BCMA_CL_SIM; -@@ -486,6 +575,11 @@ static int __init bcma_modinit(void) +@@ -486,6 +647,11 @@ static int __init bcma_modinit(void) if (err) return err; @@ -513,7 +641,7 @@ #ifdef CONFIG_BCMA_HOST_PCI err = bcma_host_pci_init(); if (err) { -@@ -503,6 +597,7 @@ static void __exit bcma_modexit(void) +@@ -503,6 +669,7 @@ static void __exit bcma_modexit(void) #ifdef CONFIG_BCMA_HOST_PCI bcma_host_pci_exit(); #endif @@ -668,6 +796,30 @@ struct bcma_drv_mips drv_mips; struct bcma_drv_gmac_cmn drv_gmac_cmn; +@@ -440,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; + } --- /dev/null +++ b/include/linux/bcma/bcma_driver_pcie2.h @@ -0,0 +1,158 @@ @@ -1115,7 +1267,30 @@ static const char * const part_probes[] = { "bcm47xxpart", NULL }; static struct physmap_flash_data bcma_pflash_data = { -@@ -229,11 +237,51 @@ u32 bcma_cpu_clock(struct bcma_drv_mips +@@ -107,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; +@@ -125,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); +@@ -229,11 +230,51 @@ u32 bcma_cpu_clock(struct bcma_drv_mips } EXPORT_SYMBOL(bcma_cpu_clock); @@ -1167,7 +1342,7 @@ switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { case BCMA_CC_FLASHT_STSER: -@@ -269,6 +317,20 @@ static void bcma_core_mips_flash_detect( +@@ -269,6 +310,20 @@ static void bcma_core_mips_flash_detect( bcma_nflash_init(cc); } } @@ -1188,6 +1363,15 @@ } void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) +@@ -361,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/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h @@ -39,6 +39,11 @@ @@ -1366,7 +1550,7 @@ --- /dev/null +++ b/Documentation/devicetree/bindings/bus/bcma.txt -@@ -0,0 +1,32 @@ +@@ -0,0 +1,53 @@ +Driver for ARM AXI Bus with Broadcom Plugins (bcma) + +Required properties: @@ -1377,6 +1561,11 @@ + +The cores on the AXI bus are automatically detected by bcma with the +memory ranges they are using and they get registered afterwards. ++Automatic detection of the IRQ number is not working on ++BCM47xx/BCM53xx ARM SoCs. To assign IRQ numbers to the cores, provide ++them manually through device tree. Use an interrupt-map to specify the ++IRQ used by the devices on the bus. The first address is just an index, ++because we do not have any special register. + +The top-level axi bus may contain children representing attached cores +(devices). This is needed since some hardware details can't be auto @@ -1391,6 +1580,22 @@ + ranges = <0x00000000 0x18000000 0x00100000>; + #address-cells = <1>; + #size-cells = <1>; ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0x000fffff 0xffff>; ++ interrupt-map = ++ /* Ethernet Controller 0 */ ++ <0x00024000 0 &gic GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>, ++ ++ /* Ethernet Controller 1 */ ++ <0x00025000 0 &gic GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; ++ ++ /* PCIe Controller 0 */ ++ <0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, ++ <0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; + + chipcommon { + reg = <0x00000000 0x1000>; diff --git a/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index f97a442cb1..67600ae972 100644 --- a/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1209,6 +1209,48 @@ +@@ -1209,6 +1209,48 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -60,7 +60,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1298,6 +1340,12 @@ +@@ -1298,6 +1340,12 @@ static int __init ubi_init(void) } } 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 + #include + #include + #include + #include + + +-#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 + #include + #include ++#include + + 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; + } -- 2.30.2