]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
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 01cfd9aeb0b818e91432ce0ac5da01779b2ae21a..d5d26229063f2ad33e6f0279dc59c49cf401aa91 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 dfe814469993134b2f6de5fa2586e4e8ff84ebff..06f45e009d7dd644f8d32d757264729d6b782081 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 f86d9111f863f13bb2f6e40dbdd035555c4eb04d..20fa4dadb82afecc5c3beaf8c64f420e28907c3f 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 f4a136ee2daf38ff5072d7e29c37e62d6eaae52f..e994b75986c34afc25b6e7767220ec1fa4c06025 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 12f41886c65d1e204c319a29c29a124867f58aeb..8530746ec5cbb6f14d6832d443c156c7c9aea4ef 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 c3301b3aedb7ffe9ea2c6edbc374e9f33ea821f5..7ca9d0f6b7f26313862b707b977e435443909489 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 77c4e6a4ddead91fe12eb6c727e77350207ef5fa..03ad8c24236670db354aaa55957f664bd73fdd11 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 60e74ac782af329a870e0e61cd0f9c4e9a67777c..2666a9c3d67e71da1061a485b3dc4d321c43e18d 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 f1bc0ac81a928b928ab3f8cc7bf82558fc430474..5e990c7a5879f4b06aac4cfc9b7cf2f9c299e199 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 80778917d2ddd353b42e4b2defa840a56e80549c..a6912e85e4ddc3791c4e6f4b6d4df8c5f30f1851 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 2cecf32d2b0f36ebe6a182674fdbff1841499a9b..c1944b40ce02f5b03336d76b36904d806d3bbc4a 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 0ddeef70726dda2f14ebf28fdc69aaa9856cc53a..06571d806ab31fa7d6e2866db1c895764220c8a1 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 d6e73811216e2e827dce7bfd2bd43ab1ddc781a7..d52753060970fa41ee5696822ac7bcec36386fb3 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,