Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80466?usp=email )
Change subject: device/pci_device.c: Avoid adding invalid resources ......................................................................
device/pci_device.c: Avoid adding invalid resources
Avoid adding invalid domain resources on 32-bit only systems.
Signed-off-by: Arthur Heymans arthur@aheymans.xyz Change-Id: I60d1f34178a491e66e4e935fd1a3d02451d6ca23 --- M src/device/pci_device.c 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/80466/1
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 8ead8a5..8b488fb 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -576,9 +576,13 @@ IORESOURCE_ASSIGNED;
/* Initialize 64-bit memory resource constraints above 4G. */ + const int addr_bits = soc_phys_address_size(); + if (addr_bits <= 32) + return; // Avoid limit <= base + res = new_resource(dev, IOINDEX_SUBTRACTIVE(2, 0)); res->base = 4ULL * GiB; - res->limit = (1ULL << soc_phys_address_size()) - 1; + res->limit = (1ULL << addr_bits) - 1; res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED; }