024-mvebu-make-device-IO-strongly-ordered.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. On Cortex-A9 based Marvell SoCs, when HW I/O coherency is enabled, all
  2. non-RAM space needs to be mapped strongly ordered.
  3. In upstream this was added for PCIe I/O only, this change expands it
  4. to cover all device memory. Fixes issues with CESA.
  5. Based on patch from Thomas Petazzoni.
  6. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  7. --- a/arch/arm/mach-mvebu/coherency.c
  8. +++ b/arch/arm/mach-mvebu/coherency.c
  9. @@ -162,22 +162,16 @@ exit:
  10. }
  11. /*
  12. - * This ioremap hook is used on Armada 375/38x to ensure that PCIe
  13. + * This ioremap hook is used on Armada 375/38x to ensure that all non-RAM
  14. * memory areas are mapped as MT_UNCACHED instead of MT_DEVICE. This
  15. - * is needed as a workaround for a deadlock issue between the PCIe
  16. + * is needed as a workaround for a deadlock issue between the bus
  17. * interface and the cache controller.
  18. */
  19. static void __iomem *
  20. -armada_pcie_wa_ioremap_caller(phys_addr_t phys_addr, size_t size,
  21. - unsigned int mtype, void *caller)
  22. +armada_wa_ioremap_caller(phys_addr_t phys_addr, size_t size,
  23. + unsigned int mtype, void *caller)
  24. {
  25. - struct resource pcie_mem;
  26. -
  27. - mvebu_mbus_get_pcie_mem_aperture(&pcie_mem);
  28. -
  29. - if (pcie_mem.start <= phys_addr && (phys_addr + size) <= pcie_mem.end)
  30. - mtype = MT_UNCACHED;
  31. -
  32. + mtype = MT_UNCACHED;
  33. return __arm_ioremap_caller(phys_addr, size, mtype, caller);
  34. }
  35. @@ -186,7 +180,7 @@ static void __init armada_375_380_cohere
  36. struct device_node *cache_dn;
  37. coherency_cpu_base = of_iomap(np, 0);
  38. - arch_ioremap_caller = armada_pcie_wa_ioremap_caller;
  39. + arch_ioremap_caller = armada_wa_ioremap_caller;
  40. /*
  41. * We should switch the PL310 to I/O coherency mode only if