]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: intel-gw: Fix ATU base address setup and add optional DT 'atu' region
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 17 Apr 2026 08:35:50 +0000 (10:35 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 11 May 2026 23:23:58 +0000 (18:23 -0500)
commit19f90be49c117db2d70c49f5d73ec428c84dbb1e
tree36cdb67d568d5c0239a4fbac519a8e4bb53ac8d4
parent1eedabe7c6170b5c73c7d801f427c127be74916e
PCI: intel-gw: Fix ATU base address setup and add optional DT 'atu' region

The ATU base address was set in intel_pcie_host_setup(), which is called
via pp->ops->init(). However, dw_pcie_get_resources() runs before this
callback and sets a default atu_base of 0x300000, which then gets
overwritten by the driver's value of 0xC0000.

But this ordering is broken because atu_base must be set before
dw_pcie_get_resources() runs, not after. So move the atu_base assignment
from intel_pcie_host_setup() to intel_pcie_probe() to fix the
initialization order.

The call stack is:

  intel_pcie_probe
    dw_pcie_host_init
      dw_pcie_host_get_resources
        dw_pcie_get_resources       <- sets atu_base = 0x300000
      pp->ops->init
        intel_pcie_rc_init
          intel_pcie_host_setup     <- was overwriting atu_base here

Additionally, add support for parsing the ATU region from the device tree.
If an 'atu' region is present in DT, the DWC core parses it via
dw_pcie_get_resources() and the driver does not set atu_base explicitly.
If 'atu' is absent, the driver falls back to the hardcoded offset (0xC0000
from DBI base) for backwards compatibility, with a warning to the user.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[mani: commit log]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260417-pcie-intel-gw-v5-6-0a2b933fe04f@dev.tdt.de
drivers/pci/controller/dwc/pcie-intel-gw.c