blob: b7fdac2552577edd887fd3a68b4781ea12d11d2e [file] [log] [blame]
Gerd Hoffmannee941b382013-06-07 16:03:44 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2004 Stefan Reinauer
Patrick Rudolph1af89232018-11-11 12:50:51 +01005 * Copyright (C) 2018 Patrick Rudolph <siro@das-labor.org>
Gerd Hoffmannee941b382013-06-07 16:03:44 +02006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Gerd Hoffmannee941b382013-06-07 16:03:44 +020015 */
16
Kyösti Mälkkia963acd2019-08-16 20:34:25 +030017#include <arch/romstage.h>
Patrick Rudolph69d5ef92018-11-11 12:43:48 +010018#include <cbmem.h>
Gerd Hoffmannee941b382013-06-07 16:03:44 +020019#include <console/console.h>
Patrick Rudolph1af89232018-11-11 12:50:51 +010020#include <southbridge/intel/i82801ix/i82801ix.h>
Patrick Rudolphfbdeb4a2019-02-14 19:47:03 +010021#include <device/pci_ops.h>
22
23#define D0F0_PCIEXBAR_LO 0x60
24
25static void mainboard_machine_check(void)
26{
27 /* Check that MCFG is active. If it's not qemu was started for machine PC */
28 if (!CONFIG(BOOTBLOCK_CONSOLE) &&
29 (pci_read_config32(PCI_DEV(0, 0, 0), D0F0_PCIEXBAR_LO) !=
30 (CONFIG_MMCONF_BASE_ADDRESS | 1)))
31 die("You must run qemu for machine Q35 (-M q35)");
32}
Gerd Hoffmannee941b382013-06-07 16:03:44 +020033
Kyösti Mälkkif0a3d442019-08-18 08:02:23 +030034void mainboard_romstage_entry(void)
Gerd Hoffmannee941b382013-06-07 16:03:44 +020035{
Gerd Hoffmannee941b382013-06-07 16:03:44 +020036 i82801ix_early_init();
Gerd Hoffmannee941b382013-06-07 16:03:44 +020037
Patrick Rudolphfbdeb4a2019-02-14 19:47:03 +010038 mainboard_machine_check();
39
Patrick Rudolph1af89232018-11-11 12:50:51 +010040 cbmem_recovery(0);
Gerd Hoffmannee941b382013-06-07 16:03:44 +020041}