Skip to content

Commit a4f632b

Browse files
mariobalanica6by9
authored andcommitted
PCI: dw-rockchip: Disable root port BARs
Root port BARs waste MMIO space, preventing large devices like GPUs from assigning their BARs. Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
1 parent ad1948e commit a4f632b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/pci/controller/dwc/pcie-dw-rockchip.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
#define PCIE_LINKUP_MASK GENMASK(17, 16)
7575
#define PCIE_LTSSM_STATUS_MASK GENMASK(5, 0)
7676

77+
#define PCIE_TYPE0_HDR_DBI2_OFFSET 0x100000
78+
7779
struct rockchip_pcie {
7880
struct dw_pcie pci;
7981
void __iomem *apb_base;
@@ -266,6 +268,12 @@ static int rockchip_pcie_host_init(struct dw_pcie_rp *pp)
266268

267269
rockchip_pcie_enable_l0s(pci);
268270

271+
/* Disable root port BARs to avoid wasting MMIO space */
272+
dw_pcie_dbi_ro_wr_en(pci);
273+
dw_pcie_writel_dbi(pci, PCIE_TYPE0_HDR_DBI2_OFFSET + PCI_BASE_ADDRESS_0, 0);
274+
dw_pcie_writel_dbi(pci, PCIE_TYPE0_HDR_DBI2_OFFSET + PCI_BASE_ADDRESS_1, 0);
275+
dw_pcie_dbi_ro_wr_dis(pci);
276+
269277
return 0;
270278
}
271279

0 commit comments

Comments
 (0)