From e6409f218c2278bfe3b64004478968f0b6207fdc Mon Sep 17 00:00:00 2001 From: Rudolf Marek Date: Sat, 3 Nov 2007 12:50:26 +0000 Subject: This patch adds support for MCFG table, which allows OS to find the MMCONFIG for memory mapped PCIe config. However this patch is not enough to enable it on Linux, Linux do not trust BIOSes too much, so a small patch to kernel to disable the check if this region is e820 reserved. PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved PCI: Not using MMCONFIG. Signed-off-by: Rudolf Marek Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2936 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/arch/i386/boot/acpi.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/arch/i386/boot') diff --git a/src/arch/i386/boot/acpi.c b/src/arch/i386/boot/acpi.c index e1734d80e7..b437e85229 100644 --- a/src/arch/i386/boot/acpi.c +++ b/src/arch/i386/boot/acpi.c @@ -65,6 +65,15 @@ void acpi_add_table(acpi_rsdt_t *rsdt, void *table) printk_warning("ACPI: could not add ACPI table to RSDT. failed.\n"); } +int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base, u16 seg_nr, u8 start, u8 end) { + mmconfig->base_address = base; + mmconfig->base_reserved = 0; + mmconfig->pci_segment_group_number = seg_nr; + mmconfig->start_bus_number = start; + mmconfig->end_bus_number = end; + return (sizeof(acpi_mcfg_mmconfig_t)); +} + int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic) { @@ -146,6 +155,31 @@ void acpi_create_madt(acpi_madt_t *madt) header->checksum = acpi_checksum((void *)madt, header->length); } +void acpi_create_mcfg(acpi_mcfg_t *mcfg) +{ + + acpi_header_t *header=&(mcfg->header); + unsigned long current=(unsigned long)mcfg+sizeof(acpi_mcfg_t); + + memset((void *)mcfg, 0, sizeof(acpi_mcfg_t)); + + /* fill out header fields */ + memcpy(header->signature, MCFG_NAME, 4); + memcpy(header->oem_id, OEM_ID, 6); + memcpy(header->oem_table_id, MCFG_TABLE, 8); + memcpy(header->asl_compiler_id, ASLC, 4); + + header->length = sizeof(acpi_mcfg_t); + header->revision = 1; + + current = acpi_fill_mcfg(current); + + /* recalculate length */ + header->length= current - (unsigned long)mcfg; + + header->checksum = acpi_checksum((void *)mcfg, header->length); +} + int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic) { lapic->type=0; -- cgit v1.2.3