Page MenuHomeFreeBSD

acpica, pci_host_generic_acpi: redo pci_host_generic_acpi.c
AbandonedPublic

Authored by jchandra on Oct 22 2018, 11:54 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Oct 12, 11:18 PM
Unknown Object (File)
Sun, Oct 12, 6:48 PM
Unknown Object (File)
Wed, Oct 8, 4:26 AM
Unknown Object (File)
Sun, Oct 5, 12:41 AM
Unknown Object (File)
Sep 15 2025, 4:45 AM
Unknown Object (File)
Sep 12 2025, 9:42 PM
Unknown Object (File)
Sep 1 2025, 12:19 AM
Unknown Object (File)
Aug 18 2025, 6:21 AM
Subscribers

Details

Reviewers
andrew
jhb
rstone
Group Reviewers
arm64
Summary

This is a major update for pci_host_generic_acpi.c, the current
implementation has quite a few gaps that is better fixed up in one go.
The changes are:

  • Follow x86 method of not adding PCI resources to PCI host bridge in ACPI code. The pci_host_generic_acpi.c code walks thru its resources and is in a better position to set this up.
  • Fixup code in pci_host_generic_acpi.c to read all decoded ranges and update the 'tuples' property. This allows us to share most of the code with generic implementation (and the FDT one). IO ranges and bus ranges are handled here as well. Drop most of the changes related to this from acpica code.
  • Add the ECAM memory area as mem resource 0. Implement the logic to get the ECAM area from MCFG (using bus range which we now decode), or from _CBA (using _BBN/bus range). Drop aarch64 ifdefs from acpica code which did part of this.
  • Switch resource activation to similar code as FDT implementation, this can be moved into generic implementation in a later pass.
  • Drop the mechanism of using the 7th bit of bus number as the domain, this is not correct and will work only in very specific cases. Use _SEG as PCI domain and use the bus ranges of the host bridge to provide start bus number.
  • Do one pass of fixing up legacy interrupt routing, call ACPI_BUS_MAP_INTR to map hardware interrupt returned by acpi common code.

This commit should not make any functional change to sys/dev/acpica/acpi.c
for other architectures, almost all the changes there are to revert
earlier additions in this file done for aarch64.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 20346

Event Timeline

The legacy interrupt routing part is not correct. I will redo this - that needs some changes in acpica code as well.

jchandra added inline comments.
sys/dev/pci/pci_host_generic_acpi.c
346

This is not correct - will be fixed up

Had to redo link interrupts - dropping this rev. Will post a commit to fixup link interrupts and a new version of this change to use the new interrupt routing.