]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: dwc: ep: Support BAR subrange inbound mapping via Address Match Mode iATU
authorKoichiro Den <den@valinux.co.jp>
Sat, 24 Jan 2026 14:50:08 +0000 (23:50 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 29 Jan 2026 23:42:01 +0000 (17:42 -0600)
commitcc839bef7727043a66004bba563492957ca3e531
tree84be0aacfbeae09c2889971b11a8023090d4920e
parentc0f1506f63546308e894469ceb0f1fadbdf9d2f9
PCI: dwc: ep: Support BAR subrange inbound mapping via Address Match Mode iATU

Extend dw_pcie_ep_set_bar() to support inbound mappings for BAR
subranges using Address Match Mode IB iATU when pci_epf_bar.num_submap
is non-zero.

Rename the existing BAR-match helper into dw_pcie_ep_ib_atu_bar() and
introduce dw_pcie_ep_ib_atu_addr() for Address Match Mode. When
num_submap is non-zero, read the assigned BAR base address and program
one inbound iATU window per subrange. Validate the submap array before
programming:
- each subrange is aligned to pci->region_align
- subranges cover the whole BAR (no gaps and no overlaps)

Track Address Match Mode mappings and tear them down on clear_bar() and
on set_bar() error paths to avoid leaving half-programmed state or
untranslated BAR holes.

Advertise this capability by extending the common feature bit
initializer macro (DWC_EPC_COMMON_FEATURES).

This enables multiple inbound windows within a single BAR, which is
useful on platforms where usable BARs are scarce but EPFs need multiple
inbound regions.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260124145012.2794108-5-den@valinux.co.jp
drivers/pci/controller/dwc/pcie-designware-ep.c
drivers/pci/controller/dwc/pcie-designware.h