aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2016-06-26 00:19:37 -0400
committerOlof Johansson <olof@lixom.net>2016-06-26 00:19:37 -0400
commited749a53b2d7b9287ee57c17dc29385c89104744 (patch)
tree4d40714c295a9fe5015062a10f025481247df2ce
parent33688abb2802ff3a230bd2441f765477b94cc89e (diff)
parent929e604efa3dc0522214e0dc18984be23993e9f0 (diff)
Merge tag 'mvebu-fixes-4.7-1' of git://git.infradead.org/linux-mvebu into fixes
mvebu fixes for 4.7 (part 1) Various I/O memory fix for Cortex A9 based SoCs * tag 'mvebu-fixes-4.7-1' of git://git.infradead.org/linux-mvebu: ARM: dts: armada-38x: fix MBUS_ID for crypto SRAM on Armada 385 Linksys ARM: mvebu: map PCI I/O regions strongly ordered ARM: mvebu: fix HW I/O coherency related deadlocks Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/boot/dts/armada-385-linksys.dtsi4
-rw-r--r--arch/arm/mach-mvebu/coherency.c23
2 files changed, 11 insertions, 16 deletions
diff --git a/arch/arm/boot/dts/armada-385-linksys.dtsi b/arch/arm/boot/dts/armada-385-linksys.dtsi
index 8450944b28e6..22f7a13e20b4 100644
--- a/arch/arm/boot/dts/armada-385-linksys.dtsi
+++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
@@ -58,8 +58,8 @@
58 soc { 58 soc {
59 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 59 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
60 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 60 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
61 MBUS_ID(0x09, 0x09) 0 0xf1100000 0x10000 61 MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
62 MBUS_ID(0x09, 0x05) 0 0xf1110000 0x10000>; 62 MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
63 63
64 internal-regs { 64 internal-regs {
65 65
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 7e989d61159c..e80f0dde2189 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -162,22 +162,16 @@ exit:
162} 162}
163 163
164/* 164/*
165 * This ioremap hook is used on Armada 375/38x to ensure that PCIe 165 * This ioremap hook is used on Armada 375/38x to ensure that all MMIO
166 * memory areas are mapped as MT_UNCACHED instead of MT_DEVICE. This 166 * areas are mapped as MT_UNCACHED instead of MT_DEVICE. This is
167 * is needed as a workaround for a deadlock issue between the PCIe 167 * needed for the HW I/O coherency mechanism to work properly without
168 * interface and the cache controller. 168 * deadlock.
169 */ 169 */
170static void __iomem * 170static void __iomem *
171armada_pcie_wa_ioremap_caller(phys_addr_t phys_addr, size_t size, 171armada_wa_ioremap_caller(phys_addr_t phys_addr, size_t size,
172 unsigned int mtype, void *caller) 172 unsigned int mtype, void *caller)
173{ 173{
174 struct resource pcie_mem; 174 mtype = MT_UNCACHED;
175
176 mvebu_mbus_get_pcie_mem_aperture(&pcie_mem);
177
178 if (pcie_mem.start <= phys_addr && (phys_addr + size) <= pcie_mem.end)
179 mtype = MT_UNCACHED;
180
181 return __arm_ioremap_caller(phys_addr, size, mtype, caller); 175 return __arm_ioremap_caller(phys_addr, size, mtype, caller);
182} 176}
183 177
@@ -186,7 +180,8 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
186 struct device_node *cache_dn; 180 struct device_node *cache_dn;
187 181
188 coherency_cpu_base = of_iomap(np, 0); 182 coherency_cpu_base = of_iomap(np, 0);
189 arch_ioremap_caller = armada_pcie_wa_ioremap_caller; 183 arch_ioremap_caller = armada_wa_ioremap_caller;
184 pci_ioremap_set_mem_type(MT_UNCACHED);
190 185
191 /* 186 /*
192 * We should switch the PL310 to I/O coherency mode only if 187 * We should switch the PL310 to I/O coherency mode only if