mbox series

[v9,0/8] pci_expander_brdige:acpi: Support pxb-pcie for ARM

Message ID 20201103120157.2286-1-cenjiahui@huawei.com (mailing list archive)
Headers show
Series pci_expander_brdige:acpi: Support pxb-pcie for ARM | expand

Message

Jiahui Cen Nov. 3, 2020, 12:01 p.m. UTC
Changes with v8
v8->v9:
Rebase to master

Changes with v7
v7->v8:
Fix the error:no member named 'fw_cfg' in 'struct PCMachineState'

Changes with v6
v6->v7:
Refactor fw_cfg_write_extra_pci_roots
Add API PCI_GET_PCIE_HOST_STATE
Fix typos

Changes with v5
v5->v6: stat crs_range_insert in aml_build.h

Changes with v4
v4->v5: Not using specific resources for PXB.
Instead, the resources for pxb are composed of the bar space of the
pci-bridge/pcie-root-port behined it and the config space of devices
behind it.

Only if the bios(uefi for arm) support multiple roots,
configure space of devices behind pxbs could be obtained.
The uefi work is updated for discussion by the following link:
https://edk2.groups.io/g/devel/message/56901?p=,,,20,0,0,0::Created,,add+extra+roots+for+Arm,20,2,0,72723351
[PATCH] ArmVirtPkg/FdtPciHostBridgeLib: add extra roots for Arm.
This patch will be updated to v2 later.

Currently pxb-pcie is not supported by arm,
the reason for it is pxb-pcie is not described in DSDT table
and only one main host bridge is described in acpi tables,
which means it is not impossible to present different io numas
for different devices.

This series of patches make arm to support PXB-PCIE.

Users can configure pxb-pcie with certain numa, Example command
is:

   -device pxb-pcie,id=pci.7,bus_nr=128,numa_node=0,bus=pcie.0,addr=0x9

Yubo Miao (8):
  acpi: Extract two APIs from acpi_dsdt_add_pci
  fw_cfg: Write the extra roots into the fw_cfg
  acpi: Extract crs build form acpi_build.c
  acpi: Refactor the source of host bridge and build tables for pxb
  acpi: Align the size to 128k
  unit-test: The files changed.
  unit-test: Add testcase for pxb
  unit-test: Add the binary file and clear diff.h

 hw/acpi/aml-build.c            | 273 ++++++++++++++++++++++++++++++
 hw/arm/virt-acpi-build.c       |  30 +++-
 hw/arm/virt.c                  |   8 +
 hw/i386/acpi-build.c           | 293 ---------------------------------
 hw/i386/pc.c                   |  18 +-
 hw/nvram/fw_cfg.c              |  20 +++
 hw/pci-host/gpex-acpi.c        | 205 +++++++++++++++++------
 include/hw/acpi/aml-build.h    |  25 +++
 include/hw/nvram/fw_cfg.h      |   2 +
 include/hw/pci/pcie_host.h     |   4 +
 tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
 tests/qtest/bios-tables-test.c |  58 ++++++-
 12 files changed, 568 insertions(+), 368 deletions(-)
 create mode 100644 tests/data/acpi/virt/DSDT.pxb

Comments

Gerd Hoffmann Nov. 5, 2020, 7:35 a.m. UTC | #1
Hi,

Looking at the whole series for the first time after being Cc'ed on one
of the patches.

> Currently pxb-pcie is not supported by arm,
> the reason for it is pxb-pcie is not described in DSDT table
> and only one main host bridge is described in acpi tables,
> which means it is not impossible to present different io numas
> for different devices.

I'm wondering whenever it would be easier to just have multiple
gpex devices (one per numa node)?

Also I think you don't have to use the x86-style crs handling.
Just pick address ranges for the new pci root.  Linux should
cope just fine.  When adding the pci root to the device tree
edk2 can handle this too (might require some firmware tweaks
though).

take care,
  Gerd