PCI: dwc: Advertise dynamic inbound mapping support
authorKoichiro Den <den@valinux.co.jp>
Sat, 24 Jan 2026 14:50:07 +0000 (23:50 +0900)
committerManivannan Sadhasivam <mani@kernel.org>
Wed, 28 Jan 2026 13:46:06 +0000 (19:16 +0530)
The DesignWare EP core has supported updating the inbound iATU mapping
for an already configured BAR (i.e. allowing pci_epc_set_bar() to be
called again without a prior pci_epc_clear_bar()) since
commit 4284c88fff0e ("PCI: designware-ep: Allow pci_epc_set_bar() update
inbound map address").

Now that this capability is exposed via the dynamic_inbound_mapping EPC
feature bit, set it for DWC-based EP glue drivers using a common
initializer macro to avoid duplicating the same flag in each driver.

Note that pci-layerscape-ep.c is untouched. It currently constructs the
feature struct dynamically in ls_pcie_ep_init(). Once converted to a
static feature definition, it will use DWC_EPC_COMMON_FEATURES as well.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260124145012.2794108-4-den@valinux.co.jp
13 files changed:
drivers/pci/controller/dwc/pci-dra7xx.c
drivers/pci/controller/dwc/pci-imx6.c
drivers/pci/controller/dwc/pci-keystone.c
drivers/pci/controller/dwc/pcie-artpec6.c
drivers/pci/controller/dwc/pcie-designware-plat.c
drivers/pci/controller/dwc/pcie-designware.h
drivers/pci/controller/dwc/pcie-dw-rockchip.c
drivers/pci/controller/dwc/pcie-keembay.c
drivers/pci/controller/dwc/pcie-qcom-ep.c
drivers/pci/controller/dwc/pcie-rcar-gen4.c
drivers/pci/controller/dwc/pcie-stm32-ep.c
drivers/pci/controller/dwc/pcie-tegra194.c
drivers/pci/controller/dwc/pcie-uniphier-ep.c

index 01cfd9a..d5d2622 100644 (file)
@@ -424,6 +424,7 @@ static int dra7xx_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features dra7xx_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .linkup_notifier = true,
        .msi_capable = true,
 };
index dfe8144..06f45e0 100644 (file)
@@ -1388,6 +1388,7 @@ static int imx_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features imx8m_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .bar[BAR_1] = { .type = BAR_RESERVED, },
        .bar[BAR_3] = { .type = BAR_RESERVED, },
@@ -1397,6 +1398,7 @@ static const struct pci_epc_features imx8m_pcie_epc_features = {
 };
 
 static const struct pci_epc_features imx8q_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .bar[BAR_1] = { .type = BAR_RESERVED, },
        .bar[BAR_3] = { .type = BAR_RESERVED, },
@@ -1417,6 +1419,7 @@ static const struct pci_epc_features imx8q_pcie_epc_features = {
  * BAR5        | Enable   | 32-bit  | 64 KB   | Programmable Size
  */
 static const struct pci_epc_features imx95_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .bar[BAR_1] = { .type = BAR_FIXED, .fixed_size = SZ_64K, },
        .align = SZ_4K,
index f86d911..20fa4da 100644 (file)
@@ -930,6 +930,7 @@ static int ks_pcie_am654_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features ks_pcie_am654_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .msix_capable = true,
        .bar[BAR_0] = { .type = BAR_RESERVED, },
index f4a136e..e994b75 100644 (file)
@@ -370,6 +370,7 @@ static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features artpec6_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
 };
 
index 12f4188..8530746 100644 (file)
@@ -61,6 +61,7 @@ static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features dw_plat_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .msix_capable = true,
 };
index c3301b3..7ca9d0f 100644 (file)
 /* Default eDMA LLP memory size */
 #define DMA_LLP_MEM_SIZE               PAGE_SIZE
 
+/* Common struct pci_epc_feature bits among DWC EP glue drivers */
+#define DWC_EPC_COMMON_FEATURES                .dynamic_inbound_mapping = true
+
 struct dw_pcie;
 struct dw_pcie_rp;
 struct dw_pcie_ep;
index 77c4e6a..03ad8c2 100644 (file)
@@ -382,6 +382,7 @@ static int rockchip_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features rockchip_pcie_epc_features_rk3568 = {
+       DWC_EPC_COMMON_FEATURES,
        .linkup_notifier = true,
        .msi_capable = true,
        .msix_capable = true,
@@ -402,6 +403,7 @@ static const struct pci_epc_features rockchip_pcie_epc_features_rk3568 = {
  * BARs) would be overwritten, resulting in (all other BARs) no longer working.
  */
 static const struct pci_epc_features rockchip_pcie_epc_features_rk3588 = {
+       DWC_EPC_COMMON_FEATURES,
        .linkup_notifier = true,
        .msi_capable = true,
        .msix_capable = true,
index 60e74ac..2666a9c 100644 (file)
@@ -309,6 +309,7 @@ static int keembay_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features keembay_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable            = true,
        .msix_capable           = true,
        .bar[BAR_0]             = { .only_64bit = true, },
index f1bc0ac..5e990c7 100644 (file)
@@ -820,6 +820,7 @@ static void qcom_pcie_ep_init_debugfs(struct qcom_pcie_ep *pcie_ep)
 }
 
 static const struct pci_epc_features qcom_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .linkup_notifier = true,
        .msi_capable = true,
        .align = SZ_4K,
index 8077891..a6912e8 100644 (file)
@@ -420,6 +420,7 @@ static int rcar_gen4_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features rcar_gen4_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .bar[BAR_1] = { .type = BAR_RESERVED, },
        .bar[BAR_3] = { .type = BAR_RESERVED, },
index 2cecf32..c1944b4 100644 (file)
@@ -70,6 +70,7 @@ static int stm32_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features stm32_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .msi_capable = true,
        .align = SZ_64K,
 };
index 0ddeef7..06571d8 100644 (file)
@@ -1988,6 +1988,7 @@ static int tegra_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 }
 
 static const struct pci_epc_features tegra_pcie_epc_features = {
+       DWC_EPC_COMMON_FEATURES,
        .linkup_notifier = true,
        .msi_capable = true,
        .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = SZ_1M,
index d6e7381..d527530 100644 (file)
@@ -420,6 +420,7 @@ static const struct uniphier_pcie_ep_soc_data uniphier_pro5_data = {
        .init = uniphier_pcie_pro5_init_ep,
        .wait = NULL,
        .features = {
+               DWC_EPC_COMMON_FEATURES,
                .linkup_notifier = false,
                .msi_capable = true,
                .msix_capable = false,
@@ -438,6 +439,7 @@ static const struct uniphier_pcie_ep_soc_data uniphier_nx1_data = {
        .init = uniphier_pcie_nx1_init_ep,
        .wait = uniphier_pcie_nx1_wait_ep,
        .features = {
+               DWC_EPC_COMMON_FEATURES,
                .linkup_notifier = false,
                .msi_capable = true,
                .msix_capable = false,