diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-01-28 11:56:45 +0100 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2021-01-31 11:12:25 +0000 |
commit | cba669cd959299f2f4fe44f9adee6a8ddaebd448 (patch) | |
tree | 6013479bb29cadde838efa46f086f280d9913940 /src/mainboard/emulation/qemu-q35/acpi_tables.c | |
parent | 338d670beb6bb9a9ab667e97f9775de9d21bfa15 (diff) |
mb/emulation/qemu-q35: Define and use MMCONF_BUS_NUMBER
Also refactor the machine type checks to avoid code duplication.
Tested, still boots to payload with 256, 128 and 64 busses.
Change-Id: Ib394ba605bbfeee75aa645e989c23034cceff348
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50025
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/emulation/qemu-q35/acpi_tables.c')
-rw-r--r-- | src/mainboard/emulation/qemu-q35/acpi_tables.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mainboard/emulation/qemu-q35/acpi_tables.c b/src/mainboard/emulation/qemu-q35/acpi_tables.c index 03d357cbfc..90bab2f77e 100644 --- a/src/mainboard/emulation/qemu-q35/acpi_tables.c +++ b/src/mainboard/emulation/qemu-q35/acpi_tables.c @@ -10,7 +10,6 @@ #include "../qemu-i440fx/fw_cfg.h" #include "../qemu-i440fx/acpi.h" -#include "q35.h" void mainboard_fill_fadt(acpi_fadt_t *fadt) { @@ -40,18 +39,8 @@ unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_mcfg(unsigned long current) { - struct device *dev; - u32 reg; - - dev = dev_find_device(0x8086, 0x29c0, 0); - if (!dev) - return current; - - reg = pci_read_config32(dev, D0F0_PCIEXBAR_LO); - if ((reg & 0x07) != 0x01) /* require enabled + 256MB size */ - return current; - - current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current, - reg & 0xf0000000, 0x0, 0x0, 255); + current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *)current, + CONFIG_MMCONF_BASE_ADDRESS, 0, 0, + CONFIG_MMCONF_BUS_NUMBER - 1); return current; } |