Skip to content

Tags: ipxe/ipxe

Tags

v1.21.1

Toggle v1.21.1's commit message
[efi] Use segment and bus number to identify PCI root bridge I/O prot…

…ocol

There may be multiple instances of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL for
a single PCI segment.  Use the bus number range descriptor from the
ACPI resource list to identify the correct protocol instance.

There is some discrepancy between the ACPI and UEFI specifications
regarding the interpretation of values within the ACPI resource list.

The ACPI specification defines the min/max field values to be within
the secondary (device-side) address space, and defines the offset
field value as "the offset that must be added to the address on the
secondary side to obtain the address on the primary side".

The UEFI specification states instead that the offset field value is
the "offset to apply to the starting address to convert it to a PCI
address", helpfully omitting to clarify whether "to apply" in this
context means "to add" or "to subtract".  The implication of the
wording is also that the "starting address" is not already a "PCI
address" and must therefore be a host-side address rather than the
ACPI-defined device-side address.

Code comments in the EDK2 codebase seem to support the latter
(non-ACPI) interpretation of these ACPI structures.  For example, in
the PciHostBridgeDxe driver there can be found the comment

  Macros to translate device address to host address and vice versa.
  According to UEFI 2.7, device address = host address + translation
  offset.

along with a pair of macros TO_HOST_ADDRESS() and TO_DEVICE_ADDRESS()
which similarly negate the sense of the "translation offset" from the
definition found in the ACPI specification.

The existing logic in efipci_ioremap() (based on a presumed-working
externally contributed patch) applies the non-ACPI interpretation: it
assumes that min/max field values are host-side addresses and that the
offset field value is negated.

Match this existing logic by assuming that min/max field values are
host-side bus numbers.  (The bus number offset value is therefore not
required and so can be ignored.)

As noted in commit 9b25f6e ("[efi] Fall back to assuming identity
mapping of MMIO address space"), some systems seem to fail to provide
MMIO address space descriptors.  Assume that some systems may
similarly fail to provide bus number range descriptors, and fall back
in this situation to assuming that matching on segment number alone is
sufficient.

Testing any of this is unfortunately impossible without access to
esoteric hardware that actually uses non-zero translation offsets.

Originally-implemented-by: Thomas Walker <twalker@twosigma.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>

v1.20.1

Toggle v1.20.1's commit message
[build] Construct full version number automatically from git revision

Signed-off-by: Michael Brown <mcb30@ipxe.org>

v1.0.0

Toggle v1.0.0's commit message
[release] Update version to 1.0.0 for release

Signed-off-by: Marty Connor <mdc@etherboot.org>

v1.0.0-rc1

Toggle v1.0.0-rc1's commit message
[release] Update version to 1.0.0-rc1 for release

v0.9.9

Toggle v0.9.9's commit message
[release] Update version to 0.9.9 for release

v0.9.8

Toggle v0.9.8's commit message
[release] Update version to 0.9.8 for release

v0.9.7

Toggle v0.9.7's commit message
[release] Update version to 0.9.7 for release

v0.9.6

Toggle v0.9.6's commit message
[release] Update version to 0.9.6 for release

v0.9.5

Toggle v0.9.5's commit message
[release] Update version to 0.9.5 for release

v0.9.4

Toggle v0.9.4's commit message
[release] Update version information for 0.9.4 release