From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
For some reason, we need a delay before accessing ATU region after
we programmed it. Otherwise, we'll get erroneous TLP.
There is a code below, which should do this in proper way, by polling
CTRL2 register, but according to documentation, hardware does not
change this ATU_ENABLE bit at all.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
---
xen/arch/arm/pci/pci-host-rcar4.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen/arch/arm/pci/pci-host-rcar4.c b/xen/arch/arm/pci/pci-host-rcar4.c
index df337e3159..3b97bf138a 100644
--- a/xen/arch/arm/pci/pci-host-rcar4.c
+++ b/xen/arch/arm/pci/pci-host-rcar4.c
@@ -289,6 +289,11 @@ static void dw_pcie_prog_outbound_atu_unroll(struct pci_host_bridge *pci,
dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_REGION_CTRL2,
PCIE_ATU_ENABLE);
+ /*
+ * HACK: We need to delay there, because the next code does not
+ * work as expected on S4
+ */
+ mdelay(1);
/*
* Make sure ATU enable takes effect before any subsequent config
* and I/O accesses.
--
2.34.1