From 50fa63ad687063f05b451dfb3cdd4e6c2e326350 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Thu, 31 Oct 2024 15:02:36 +0800 Subject: [PATCH] PCI: dw: rockchip: Disable RC's BAR into rk_pcie_host_config() To fix the unnecessary RC's bar allocation warning: [ 2.226288] pci 0000:00:00.0: BAR 0: no space for [mem size 0x40000000] [ 2.226305] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x40000000] [ 2.226317] pci 0000:00:00.0: BAR 1: no space for [mem size 0x40000000] [ 2.226327] pci 0000:00:00.0: BAR 1: failed to assign [mem size 0x40000000] Signed-off-by: Shawn Lin Change-Id: I617cfa3408115d7c73190c6b9816d48ae82a37c8 --- drivers/pci/controller/dwc/pcie-dw-rockchip.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c index 537e69dfb894..cdc9c5dc6d77 100644 --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c @@ -628,10 +628,6 @@ static int rk_add_pcie_port(struct rk_pcie *rk_pcie, struct platform_device *pde return ret; } - /* Disable BAR0 BAR1 */ - dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_0, 0x0); - dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_1, 0x0); - return 0; } @@ -1566,6 +1562,10 @@ static int rk_pcie_host_config(struct rk_pcie *rk_pcie) rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_INTR_MASK_LEGACY, rk_pcie->intx | 0xffff0000); + /* Disable BAR0 BAR1 */ + dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_0, 0x0); + dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_1, 0x0); + return 0; } @@ -1993,10 +1993,6 @@ static int __maybe_unused rockchip_dw_pcie_resume(struct device *dev) goto unconfig_host; } - /* Disable BAR0 BAR1 */ - dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_0, 0x0); - dw_pcie_writel_dbi2(pci, PCI_BASE_ADDRESS_1, 0x0); - dw_pcie_dbi_ro_wr_dis(pci); rk_pcie->in_suspend = false; if (rk_pcie->skip_scan_in_resume)