qemu-cr16/include/hw/pci-host
Jamin Lin ba6fb09048 hw/pci-host/aspeed: Add AST2700 PCIe config with dedicated H2X blocks
Introduce PCIe config (H2X) support for the AST2700 SoC.

Unlike the AST2600, the AST2700 provides three independent Root Complexes,
each with its own H2X (AHB to PCIe bridge) register block of size 0x100.
All RCs use the same MSI address (0x000000F0). The H2X block includes
two different access paths:

1. CFGI (internal bridge): used to access the host bridge itself, always
   with BDF=0. The AST2700 controller simplifies the design by exposing
   only one register (H2X_CFGI_TLP) with fields for ADDR[15:0], BEN[19:16],
   and WR[20]. This is not a full TLP descriptor as in the external case.
   For QEMU readability and code reuse, the model converts H2X_CFGI_TLP
   into a standard TLP TX descriptor with BDF forced to 0 and then calls
   the existing helpers aspeed_pcie_cfg_readwrite() and
   aspeed_pcie_cfg_translate_write().

2. CFGE (external EP access): used to access external endpoints. The
   AST2700 design provides H2X_CFGE_TLP1 and a small FIFO at H2X_CFGE_TLPN.
   For reads, TX DESC0 is stored in TLP1 and DESC1/DESC2 in TLPN FIFO
   slots. For writes, TX DESC0 is stored in TLP1, DESC1/DESC2 in TLPN
   FIFO[0..1], and TX write data in TLPN FIFO[2].

The implementation extends AspeedPCIECfgState with a small FIFO and index,
wires up new register definitions for AST2700, and adds a specific ops
table and class (TYPE_ASPEED_2700_PCIE_CFG). The reset handler clears the
FIFO state. Interrupt and MSI status registers are also supported.

This provides enough modeling for firmware and drivers to use any of the
three PCIe RCs on AST2700 with their own dedicated H2X config window,
while reusing existing TLP decode helpers in QEMU.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250919093017.338309-11-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-09-29 18:00:20 +02:00
..
articia.h hw/pci-host: Add emulation of Mai Logic Articia S 2023-11-07 12:59:29 -03:00
aspeed_pcie.h hw/pci-host/aspeed: Add AST2700 PCIe config with dedicated H2X blocks 2025-09-29 18:00:20 +02:00
astro.h hw/pci-host/astro: Add LMMIO range support 2025-02-04 22:57:34 +01:00
bonito.h hw/pci-host/bonito: Declare TYPE_BONITO_PCI_HOST_BRIDGE in header 2023-01-13 16:22:57 +01:00
designware.h hw/pci-host/designware: Prevent device attachment on internal PCIe root bus 2025-02-25 15:32:58 +00:00
dino.h hw/pci-host: Remove unused pci_host_data_be_ops 2025-05-20 08:04:18 +02:00
fsl_imx8m_phy.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
gpex.h hw/pci-host/gpex-acpi: Use GED acpi pcihp property 2025-07-15 02:56:40 -04:00
grackle.h hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header 2022-10-31 18:48:23 +00:00
i440fx.h hw/pci-host/i440fx: Resolve i440fx_init() 2023-07-10 16:29:17 -04:00
ls7a.h hw/loongarch: DINTC add a MemoryRegion 2025-09-28 17:31:04 +08:00
mv64361.h hw/pci-host: Add emulation of Marvell MV64361 PPC system controller 2021-05-04 11:41:25 +10:00
pam.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
pnv_phb3.h hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info() 2024-06-19 12:40:49 +02:00
pnv_phb3_regs.h ppc: Define SETFIELD for the ppc target 2022-07-06 10:22:38 -03:00
pnv_phb4.h ppc/pnv/phb4: Add pervasive chiplet support to PHB4/5 2025-03-11 22:43:30 +10:00
pnv_phb4_regs.h hw/pci-host: Update PHB5 XSCOM registers 2023-11-07 15:49:41 -03:00
ppc4xx.h hw/ppc/ppc4xx_pci: Extract PCI host definitions to hw/pci-host/ppc4xx.h 2024-02-22 12:47:40 +01:00
ppce500.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
q35.h q35: Remove unused mch_mcfg_base 2024-10-03 17:26:05 +03:00
remote.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
sabre.h include/hw/pci: Split pci_device.h off pci.h 2023-01-08 01:54:22 -05:00
spapr.h ppc/spapr: remove deprecated machine pseries-2.7 2024-11-04 09:10:27 +10:00
uninorth.h uninorth: use qdev gpios for PCI IRQs 2020-10-18 16:21:42 +01:00
xilinx-pcie.h include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h 2023-01-08 01:54:22 -05:00