From e15097537d3c1cd8437bb41b28ce06a141ba2430 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Tue, 10 Dec 2024 10:55:29 +0800 Subject: [PATCH] PCI: rockchip: dw: Move dw_pcie_dbi_ro_wr_en() forward Need to set dbi writable in the front of rk_pcie_host_config(), otherwise the test settings couldn't be applied. Fixes: c54772e75b0d ("PCI: rockchip: dw: Reorder and document steps of rk_pcie_really_probe()") Signed-off-by: Shawn Lin Change-Id: Icb62ef01ab5c16b7a7dba9cb82c9b0cfae5c40d6 --- drivers/pci/controller/dwc/pcie-dw-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c index d08aa7fbf031..759983225f20 100644 --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c @@ -1536,6 +1536,8 @@ static int rk_pcie_host_config(struct rk_pcie *rk_pcie) struct dw_pcie *pci = rk_pcie->pci; u32 val; + dw_pcie_dbi_ro_wr_en(pci); + if (rk_pcie->is_lpbk) { val = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL); val |= PORT_LINK_LPBK_ENABLE; @@ -1558,8 +1560,6 @@ static int rk_pcie_host_config(struct rk_pcie *rk_pcie) dw_pcie_writel_dbi(pci, rk_pcie->rasdes_off + 8, 0x3); } - dw_pcie_dbi_ro_wr_en(pci); - rk_pcie_fast_link_setup(rk_pcie); rk_pcie_set_power_limit(rk_pcie);