summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayuresh Chitale <[email protected]>2023-11-16 22:21:03 +0530
committerMichal Simek <[email protected]>2023-12-13 08:58:06 +0100
commita62b01ded171415e0278bfc951a31895e63d166f (patch)
tree13a32680d0aca22a8004ab0c231c37794ede0dce
parent891b4814800bd3ad5d16c5d45e0cd05709f64721 (diff)
pci: xilinx: Enable MMIO region
The host bridge MMIO region is disabled by default due to which MMIO accesses cause an exception. Fix it by setting the bridge enable bit. This change is ported from the linux pcie-xilinx driver. Signed-off-by: Mayuresh Chitale <[email protected]> Reviewed-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
-rw-r--r--drivers/pci/pcie_xilinx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c
index fdc9b08c10b..3db460b5f93 100644
--- a/drivers/pci/pcie_xilinx.c
+++ b/drivers/pci/pcie_xilinx.c
@@ -24,6 +24,8 @@ struct xilinx_pcie {
/* Register definitions */
#define XILINX_PCIE_REG_PSCR 0x144
#define XILINX_PCIE_REG_PSCR_LNKUP BIT(11)
+#define XILINX_PCIE_REG_RPSC 0x148
+#define XILINX_PCIE_REG_RPSC_BEN BIT(0)
/**
* pcie_xilinx_link_up() - Check whether the PCIe link is up
@@ -141,6 +143,7 @@ static int pcie_xilinx_of_to_plat(struct udevice *dev)
struct xilinx_pcie *pcie = dev_get_priv(dev);
fdt_addr_t addr;
fdt_size_t size;
+ u32 rpsc;
addr = dev_read_addr_size(dev, &size);
if (addr == FDT_ADDR_T_NONE)
@@ -150,6 +153,11 @@ static int pcie_xilinx_of_to_plat(struct udevice *dev)
if (IS_ERR(pcie->cfg_base))
return PTR_ERR(pcie->cfg_base);
+ /* Enable the Bridge enable bit */
+ rpsc = __raw_readl(pcie->cfg_base + XILINX_PCIE_REG_RPSC);
+ rpsc |= XILINX_PCIE_REG_RPSC_BEN;
+ __raw_writel(rpsc, pcie->cfg_base + XILINX_PCIE_REG_RPSC);
+
return 0;
}