On Fri, 23 Oct 2026 at 14:59, Marcelo Manzo <[email protected]> wrote: > > Add the BCM2838 PCIe host bridge model: config space, MMIO window, > and register access for the root port. > > Per Peter Maydell's review of a later follow-up series, fold in what > was originally a separate bugfix here, since this device isn't in > upstream git yet and the bug was in code this patch itself introduces. > Two defects fixed, both on the enumeration path (none of this was > exercised until a later patch actually attaches a PCI device): > > 1. bcm2838_pcie_host_read/write computed > "offset - PCIE_CONFIG_SPACE_SIZE" on an unsigned hwaddr, which > underflows for every offset below 4KB. The root port's own config > space -- including vendor/device ID at offset 0 -- therefore always > fell into the out-of-range branch and read back as all-ones, i.e. > "no device present", so the guest stopped scanning immediately. > > 2. The root port overrode PCIDeviceClass::config_read/config_write with > plain pci_default_*_config(). That bypasses rp_write_config() -> > pci_bridge_write_config(), so programming the bridge's memory window > never updated the bridge's address space and BARs behind the root > port stayed unreachable. Drop the overrides and dispatch through > pci_host_config_{read,write}_common() so the device's real handlers > run. > > Accesses to the EXT_CFG_DATA window are passed on to > pci_host_config_{read,write}_common() for the function that EXT_CFG_INDEX > selects. > > Signed-off-by: Marcelo Manzo <[email protected]> > ---
Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
