From 6a4a931b9ed0ad5da4347f6e6653c7a3b4fb181c Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 30 Sep 2019 16:44:53 +0100 Subject: [PATCH] arch: acpi: Reserve the PCI MMCONFIG region The PCI Express Firmware spec says that the region to be used for PCI MMCONFIG should be reserved as part of the motherboard's resources in the ACPI tables. Signed-off-by: Rob Bradford --- arch/src/x86_64/acpi.rs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/arch/src/x86_64/acpi.rs b/arch/src/x86_64/acpi.rs index 5968af3e5..c9f866a04 100644 --- a/arch/src/x86_64/acpi.rs +++ b/arch/src/x86_64/acpi.rs @@ -62,7 +62,7 @@ pub fn create_dsdt_table( The hex tables in this file are generated from the ASL below with: "iasl -tc " - As the output contains a table header that is not required the first 40 bytes + As the output contains a table header that is not required the first 36 bytes should be disregarded. */ @@ -166,6 +166,35 @@ pub fn create_dsdt_table( &(end_of_device_area.unchecked_offset_from(start_of_device_area) + 1).to_le_bytes(), ); + /* + Device (_SB.MBRD) + { + Name (_HID, EisaId ("PNP0C02") /* PNP Motherboard Resources */) // _HID: Hardware ID + Name (_UID, Zero) // _UID: Unique ID + } + + Scope (_SB.MBRD) + { + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + Memory32Fixed (ReadWrite, + 0xE8000000, // Address Base + 0x10000000, // Address Length + ) + }) + } + */ + let mut mbrd_dsdt_data = [ + 0x5Bu8, 0x82, 0x1A, 0x2E, 0x5F, 0x53, 0x42, 0x5F, 0x4D, 0x42, 0x52, 0x44, 0x08, 0x5F, 0x48, + 0x49, 0x44, 0x0C, 0x41, 0xD0, 0x0C, 0x02, 0x08, 0x5F, 0x55, 0x49, 0x44, 0x00, 0x10, 0x21, + 0x2E, 0x5F, 0x53, 0x42, 0x5F, 0x4D, 0x42, 0x52, 0x44, 0x08, 0x5F, 0x43, 0x52, 0x53, 0x11, + 0x11, 0x0A, 0x0E, 0x86, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x10, + 0x79, 0x00, + ]; + + mbrd_dsdt_data[52..56].copy_from_slice(&layout::PCI_MMCONFIG_START.0.to_le_bytes()[0..4]); + mbrd_dsdt_data[56..60].copy_from_slice(&layout::PCI_MMCONFIG_SIZE.to_le_bytes()[0..4]); + /* Device (_SB.COM1) { @@ -204,6 +233,7 @@ pub fn create_dsdt_table( // DSDT let mut dsdt = SDT::new(*b"DSDT", 36, 6, *b"CLOUDH", *b"CHDSDT ", 1); dsdt.append(pci_dsdt_data); + dsdt.append(mbrd_dsdt_data); if serial_enabled { dsdt.append(com1_dsdt_data); }