blob: 465edc84c45bd3374640d2bb98701ec5ce0f42ab [file] [log] [blame]
Angel Pons585495e2020-04-03 01:21:38 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Gerd Hoffmannee941b382013-06-07 16:03:44 +02002
Kyösti Mälkkia963acd2019-08-16 20:34:25 +03003#include <arch/romstage.h>
Patrick Rudolph69d5ef92018-11-11 12:43:48 +01004#include <cbmem.h>
Gerd Hoffmannee941b382013-06-07 16:03:44 +02005#include <console/console.h>
Patrick Rudolph1af89232018-11-11 12:50:51 +01006#include <southbridge/intel/i82801ix/i82801ix.h>
Patrick Rudolphfbdeb4a2019-02-14 19:47:03 +01007#include <device/pci_ops.h>
8
Angel Pons899525d2021-01-28 10:57:13 +01009#include "q35.h"
Patrick Rudolphfbdeb4a2019-02-14 19:47:03 +010010
11static void mainboard_machine_check(void)
12{
13 /* Check that MCFG is active. If it's not qemu was started for machine PC */
14 if (!CONFIG(BOOTBLOCK_CONSOLE) &&
15 (pci_read_config32(PCI_DEV(0, 0, 0), D0F0_PCIEXBAR_LO) !=
16 (CONFIG_MMCONF_BASE_ADDRESS | 1)))
17 die("You must run qemu for machine Q35 (-M q35)");
18}
Gerd Hoffmannee941b382013-06-07 16:03:44 +020019
Kyösti Mälkkif0a3d442019-08-18 08:02:23 +030020void mainboard_romstage_entry(void)
Gerd Hoffmannee941b382013-06-07 16:03:44 +020021{
Gerd Hoffmannee941b382013-06-07 16:03:44 +020022 i82801ix_early_init();
Gerd Hoffmannee941b382013-06-07 16:03:44 +020023
Patrick Rudolphfbdeb4a2019-02-14 19:47:03 +010024 mainboard_machine_check();
25
Patrick Rudolph1af89232018-11-11 12:50:51 +010026 cbmem_recovery(0);
Gerd Hoffmannee941b382013-06-07 16:03:44 +020027}