Skip to content

Commit 42e8a4e

Browse files
committed
Merge branch 'pci/controller/dwc-rockchip'
- Disable unused BAR 0 and BAR 1 for Root Port (Shawn Lin) * pci/controller/dwc-rockchip: PCI: dw-rockchip: Disable BAR 0 and BAR 1 for Root Port
2 parents a1dd5e7 + b5d712e commit 42e8a4e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
#define PCIE_LINKUP_MASK GENMASK(17, 16)
8686
#define PCIE_LTSSM_STATUS_MASK GENMASK(5, 0)
8787

88+
#define PCIE_TYPE0_HDR_DBI2_OFFSET 0x100000
89+
8890
struct rockchip_pcie {
8991
struct dw_pcie pci;
9092
void __iomem *apb_base;
@@ -312,6 +314,8 @@ static int rockchip_pcie_host_init(struct dw_pcie_rp *pp)
312314
if (irq < 0)
313315
return irq;
314316

317+
pci->dbi_base2 = pci->dbi_base + PCIE_TYPE0_HDR_DBI2_OFFSET;
318+
315319
ret = rockchip_pcie_init_irq_domain(rockchip);
316320
if (ret < 0)
317321
dev_err(dev, "failed to init irq domain\n");
@@ -322,6 +326,10 @@ static int rockchip_pcie_host_init(struct dw_pcie_rp *pp)
322326
rockchip_pcie_configure_l1ss(pci);
323327
rockchip_pcie_enable_l0s(pci);
324328

329+
/* Disable Root Ports BAR0 and BAR1 as they report bogus size */
330+
dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_0, 0x0);
331+
dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_1, 0x0);
332+
325333
return 0;
326334
}
327335

0 commit comments

Comments
 (0)