aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-11-28 10:17:35 +0100
committerKevin O'Connor <kevin@koconnor.net>2012-12-01 23:39:08 -0500
commit7e269b47cb46a16baa03a184553f780b4eb3dc2b (patch)
tree3ea5a370698e08cbba285d9a597d7eb41414e89c
parent3d11108f45818d75140530a184c05680f1be51ad (diff)
downloadseabios-hppa-7e269b47cb46a16baa03a184553f780b4eb3dc2b.zip
seabios-hppa-7e269b47cb46a16baa03a184553f780b4eb3dc2b.tar.gz
seabios-hppa-7e269b47cb46a16baa03a184553f780b4eb3dc2b.tar.bz2
acpi: add mcfg table for mmconfig
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/acpi.c23
-rw-r--r--src/acpi.h17
2 files changed, 40 insertions, 0 deletions
diff --git a/src/acpi.c b/src/acpi.c
index 72c8fe8..6267d7b 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -764,6 +764,27 @@ build_srat(void)
return srat;
}
+static void *
+build_mcfg_q35(void)
+{
+ struct acpi_table_mcfg *mcfg;
+
+ int len = sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]);
+ mcfg = malloc_high(len);
+ if (!mcfg) {
+ warn_noalloc();
+ return NULL;
+ }
+ memset(mcfg, 0, len);
+ mcfg->allocation[0].address = Q35_HOST_BRIDGE_PCIEXBAR_ADDR;
+ mcfg->allocation[0].pci_segment = Q35_HOST_PCIE_PCI_SEGMENT;
+ mcfg->allocation[0].start_bus_number = Q35_HOST_PCIE_START_BUS_NUMBER;
+ mcfg->allocation[0].end_bus_number = Q35_HOST_PCIE_END_BUS_NUMBER;
+
+ build_header((void *)mcfg, MCFG_SIGNATURE, len, 1);
+ return mcfg;
+}
+
static const struct pci_device_id acpi_find_tbl[] = {
/* PIIX4 Power Management device. */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL),
@@ -804,6 +825,8 @@ acpi_bios_init(void)
ACPI_INIT_TABLE(build_madt());
ACPI_INIT_TABLE(build_hpet());
ACPI_INIT_TABLE(build_srat());
+ if (pci->device == PCI_DEVICE_ID_INTEL_ICH9_LPC)
+ ACPI_INIT_TABLE(build_mcfg_q35());
u16 i, external_tables = qemu_cfg_acpi_additional_tables();
diff --git a/src/acpi.h b/src/acpi.h
index cb21561..715d19d 100644
--- a/src/acpi.h
+++ b/src/acpi.h
@@ -107,4 +107,21 @@ struct bfld {
u64 p1l; /* pci window 1 (above 4g) - length */
} PACKED;
+/* PCI fw r3.0 MCFG table. */
+/* Subtable */
+struct acpi_mcfg_allocation {
+ u64 address; /* Base address, processor-relative */
+ u16 pci_segment; /* PCI segment group number */
+ u8 start_bus_number; /* Starting PCI Bus number */
+ u8 end_bus_number; /* Final PCI Bus number */
+ u32 reserved;
+} PACKED;
+
+#define MCFG_SIGNATURE 0x4746434d // MCFG
+struct acpi_table_mcfg {
+ ACPI_TABLE_HEADER_DEF;
+ u8 reserved[8];
+ struct acpi_mcfg_allocation allocation[0];
+} PACKED;
+
#endif // acpi.h