Skip to contentSkip to conversation

hw/arm/virt-acpi - reserve ECAM space as PNP0C02 device

PATCH Superseded Ard Biesheuvel 1 participant 2 messages Jan 13, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/virt-acpi - reserve ECAM space as PNP0C02 device

Linux for arm64 v4.10 and later will complain if the ECAM config space is not reserved in the ACPI namespace:

acpi PNP0A08:00: [Firmware Bug]: ECAM area [mem 0x3f000000-0x3fffffff] not reserved in ACPI namespace

The rationale is that OSes that don't consume the MCFG table should still be able to infer that the PCI config space MMIO region is occupied.

So update the ACPI table generation routine to add this reservation.

---
 hw/arm/virt-acpi-build.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/arm/virt-acpi-build.c +6 -0
index 085a61117378..e8769dc6288f 100644
@@ -310,6 +310,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
     Aml *dev_rp0 = aml_device("%s", "RP0");
     aml_append(dev_rp0, aml_name_decl("_ADR", aml_int(0)));
     aml_append(dev, dev_rp0);
+
+    Aml *dev_res0 = aml_device("%s", "RES0");
+    crs = aml_resource_template();
+    aml_append(crs, aml_memory32_fixed(base_ecam, size_ecam, AML_READ_WRITE));
+    aml_append(dev_res0, aml_name_decl("_CRS", crs));
+    aml_append(dev, dev_res0);
     aml_append(scope, dev);
 }
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 11 lines · Ard Biesheuvel

Linux for arm64 v4.10 and later will complain if the ECAM config space is not reserved in the ACPI namespace:

acpi PNP0A08:00: [Firmware Bug]: ECAM area [mem 0x3f000000-0x3fffffff] not reserved in ACPI namespace

The rationale is that OSes that don't consume the MCFG table should still be able to infer that the PCI config space MMIO region is occupied.

So update the ACPI table generation routine to add this reservation.

Please disregard -- I failed to add the PNP0C02 HID

Quoted 24 lines
---
 hw/arm/virt-acpi-build.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/arm/virt-acpi-build.c +6 -1
index 085a61117378..e8769dc6288f 100644
@@ -310,6 +310,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
     Aml *dev_rp0 = aml_device("%s", "RP0");
     aml_append(dev_rp0, aml_name_decl("_ADR", aml_int(0)));
     aml_append(dev, dev_rp0);
+
+    Aml *dev_res0 = aml_device("%s", "RES0");
+    crs = aml_resource_template();
+    aml_append(crs, aml_memory32_fixed(base_ecam, size_ecam, AML_READ_WRITE));
+    aml_append(dev_res0, aml_name_decl("_CRS", crs));
+    aml_append(dev, dev_res0);
     aml_append(scope, dev);
 }
 
--

2.7.4