ath79: ar7100: remove IRQ code from PCI driver staging
authorDmitry Tunin <hanipouspilot@gmail.com>
Wed, 22 Aug 2018 09:06:34 +0000 (12:06 +0300)
committerJohn Crispin <john@phrozen.org>
Wed, 22 Aug 2018 10:13:51 +0000 (12:13 +0200)
Currently all PCI devices get the same IRQ that affects performance badly.

This commit adresses this problem and cleans the code.

ar7100 has a special PCI interrupt controller@18060018 that works exactly
the same way as misc interrupt controller.

This patch does the following:

1. Removes all IRQ handling code from the PCI driver.
2. Defines pci-intc interrupt controller@18060018 in dtsi.
3. Removes interrupt-controller property from PCI node.
4. Sets a correct interrupt mask for PCI devices.

Run tested on DIR-825 B1.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
target/linux/ath79/dts/ar7100.dtsi
target/linux/ath79/patches-4.14/0036-MIPS-ath79-remove-irq-code-from-pci.patch [new file with mode: 0644]

index 6402657841fd88f739ed207e06bd42efc704c546..c342cb20e70ad4ad092dacd90a0dca778eaaeb95 100644 (file)
                                clock-names = "wdt";
                        };
 
+                       pci_intc: interrupt-controller@18060018 {
+                               compatible = "qca,ar7240-misc-intc";
+                               reg = <0x18060018 0x4>;
+                               interrupt-parent = <&cpuintc>;
+                               interrupts = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                       };
 
                        rst: reset-controller@18060024 {
                                compatible = "qca,ar7100-reset";
                                reg-names = "cfg_base";
                                ranges = <0x2000000 0 0x10000000 0x10000000 0 0x07000000        /* pci memory */
                                          0x1000000 0 0x00000000 0x0000000 0 0x000001>;         /* io space */
-                               interrupt-parent = <&cpuintc>;
-                               interrupts = <2>;
 
-                               interrupt-controller;
+                               interrupt-parent = <&pci_intc>;
+                               interrupts = <4>;
+
                                #interrupt-cells = <1>;
 
-                               interrupt-map-mask = <0 0 0 1>;
-                               interrupt-map = <0 0 0 0 &pcie0 0>;
+                               interrupt-map-mask = <0xf800 0 0 0>;
+                               interrupt-map = <0x8800 0 0 0 &pci_intc 0
+                                                0x9000 0 0 0 &pci_intc 1
+                                                0x9800 0 0 0 &pci_intc 2>;
+
                                status = "disabled";
                        };
                };
diff --git a/target/linux/ath79/patches-4.14/0036-MIPS-ath79-remove-irq-code-from-pci.patch b/target/linux/ath79/patches-4.14/0036-MIPS-ath79-remove-irq-code-from-pci.patch
new file mode 100644 (file)
index 0000000..e69de29