From: Ansuel Smith Date: Tue, 11 May 2021 22:13:04 +0000 (+0200) Subject: ipq806x: reduce pci IO space to 64k X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e5d50f69e81a95193aa09285f9edb99bc69c249f;p=openwrt%2Fstaging%2Fnbd.git ipq806x: reduce pci IO space to 64k With some talk with the ARM maintainer, it was notice that enlarging the limit to the current value is VERY wrong and clash with other memory. A better solution would be to reduce the IO space from 1MB to 64K as probably it's a long lasting typo and even x86 arch doesn't have a IO space that big. Signed-off-by: Ansuel Smith --- diff --git a/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch b/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch new file mode 100644 index 0000000000..050360ad21 --- /dev/null +++ b/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch @@ -0,0 +1,46 @@ +From 84909e85881d67244240c9f40974ce12a51e3886 Mon Sep 17 00:00:00 2001 +From: Ansuel Smith +Date: Tue, 11 May 2021 23:09:45 +0200 +Subject: [PATCH] ARM: dts: qcom: reduce pci IO size to 64K + +The current value is probably a typo and is actually uncommon to find +1MB IO space even on a x86 arch. Also with recent changes to the pci +driver, pci1 and pci2 now fails to function as any connected device +fails any reg read/write. Reduce this to 64K as it should be more than +enough and 3 * 64K of total IO space doesn't exceed the IO_SPACE_LIMIT +hardcoded for the ARM arch. + +Signed-off-by: Ansuel Smith +--- + arch/arm/boot/dts/qcom-ipq8064.dtsi | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi +@@ -1085,7 +1085,7 @@ + #address-cells = <3>; + #size-cells = <2>; + +- ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00100000 /* downstream I/O */ ++ ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00010000 /* downstream I/O */ + 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */ + + interrupts = ; +@@ -1136,7 +1136,7 @@ + #address-cells = <3>; + #size-cells = <2>; + +- ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00100000 /* downstream I/O */ ++ ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00010000 /* downstream I/O */ + 0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */ + + interrupts = ; +@@ -1187,7 +1187,7 @@ + #address-cells = <3>; + #size-cells = <2>; + +- ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00100000 /* downstream I/O */ ++ ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00010000 /* downstream I/O */ + 0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */ + + interrupts = ; diff --git a/target/linux/ipq806x/patches-5.10/103-arm-Enlarge-IO_SPACE_LIMIT-needed-for-some-SoC.patch b/target/linux/ipq806x/patches-5.10/103-arm-Enlarge-IO_SPACE_LIMIT-needed-for-some-SoC.patch deleted file mode 100644 index 64a0eaf8ed..0000000000 --- a/target/linux/ipq806x/patches-5.10/103-arm-Enlarge-IO_SPACE_LIMIT-needed-for-some-SoC.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9a894b0e5d3e6ed3c435b89fe96794ec9ddf5925 Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -Date: Sun, 28 Feb 2021 15:22:24 +0100 -Subject: [PATCH] arm: Enlarge IO_SPACE_LIMIT needed for some SoC - -Ipq8064 SoC requires larger IO_SPACE_LIMIT or second and third pci port -fails to register the IO addresses and connected device doesn't work. - -Cc: # 4.9+ -Signed-off-by: Ansuel Smith ---- - arch/arm/include/asm/io.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/include/asm/io.h -+++ b/arch/arm/include/asm/io.h -@@ -197,7 +197,7 @@ void __iomem *pci_remap_cfgspace(resourc - #ifdef CONFIG_NEED_MACH_IO_H - #include - #elif defined(CONFIG_PCI) --#define IO_SPACE_LIMIT ((resource_size_t)0xfffff) -+#define IO_SPACE_LIMIT ((resource_size_t)0xffffff) - #define __io(a) __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT)) - #else - #define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT)