[PATCH v2 1/2] PCI: dwc: Allow drivers to skip MEM outbound iATU setup

From: Xincheng Zhang

Date: Fri Sep 04 2026 - 22:57:53 EST


Some DWC-based controllers do not require outbound iATU windows for MEM
transactions. For those platforms, programming outbound iATU windows for
host bridge MEM ranges is unnecessary and may constrain the available MEM
aperture.

The DWC PCIe RP Controller Databook v6.00a, section 3.12.2, describes the
default outbound no-match behavior as pass-through. Section 3.12.5.6, "No
Address Match Result", says the address is not translated and programmable
TLP header fields come from the application transmit interface.

This no-match path cannot translate between different parent-bus and PCI
addresses, so require skipped MEM ranges to be identity-mapped.

Add dw_pcie_rp::bypass_ob_mem_iatu so drivers can skip generic MEM iATU
setup while using the common DWC host init path.

Existing drivers keep the current behavior because the flag defaults to
false. The I/O iATU setup does not use the MEM resource iterator, and the
iterator may be uninitialized when MEM setup is skipped. Avoid using it in
the I/O iATU error path.

Signed-off-by: Xincheng Zhang <zhangxincheng@xxxxxxxxxxxxx>
---
.../pci/controller/dwc/pcie-designware-host.c | 17 +++++++++++++++--
drivers/pci/controller/dwc/pcie-designware.h | 1 +
2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index f5a38e6fd8d79..b06797b4e31d2 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -918,6 +918,20 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)
atu.parent_bus_addr = entry->res->start - pci->parent_bus_offset;
atu.pci_addr = entry->res->start - entry->offset;

+ if (pp->bypass_ob_mem_iatu) {
+ /*
+ * The no-match pass-through path preserves the correct
+ * PCI address only for identity-mapped MEM ranges.
+ */
+ if (atu.parent_bus_addr != atu.pci_addr) {
+ dev_err(pci->dev,
+ "Cannot bypass outbound iATU for non-identity MEM range %pr\n",
+ entry->res);
+ return -EINVAL;
+ }
+ continue;
+ }
+
/* Adjust iATU size if MSG TLP region was allocated before */
if (pp->msg_res && pp->msg_res->parent == entry->res)
res_size = resource_size(entry->res) -
@@ -964,8 +978,7 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)

ret = dw_pcie_prog_outbound_atu(pci, &atu);
if (ret) {
- dev_err(pci->dev, "Failed to set IO range %pr\n",
- entry->res);
+ dev_err(pci->dev, "Failed to set IO range\n");
return ret;
}
ob_iatu_index++;
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index 0735ae9409240..d89badcca2689 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -469,6 +469,7 @@ struct dw_pcie_rp {
struct pci_config_window *cfg;
bool ecam_enabled;
bool native_ecam;
+ bool bypass_ob_mem_iatu;
bool skip_l23_ready;
bool skip_pwrctrl_off;
};
--
2.34.1