Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2004 Stefan Reinauer |
Patrick Rudolph | 1af8923 | 2018-11-11 12:50:51 +0100 | [diff] [blame] | 5 | * Copyright (C) 2018 Patrick Rudolph <siro@das-labor.org> |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 6 | * |
| 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 Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
Kyösti Mälkki | a963acd | 2019-08-16 20:34:25 +0300 | [diff] [blame] | 17 | #include <arch/romstage.h> |
Patrick Rudolph | 69d5ef9 | 2018-11-11 12:43:48 +0100 | [diff] [blame] | 18 | #include <cbmem.h> |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 19 | #include <console/console.h> |
Patrick Rudolph | 1af8923 | 2018-11-11 12:50:51 +0100 | [diff] [blame] | 20 | #include <southbridge/intel/i82801ix/i82801ix.h> |
Patrick Rudolph | fbdeb4a | 2019-02-14 19:47:03 +0100 | [diff] [blame] | 21 | #include <device/pci_ops.h> |
| 22 | |
| 23 | #define D0F0_PCIEXBAR_LO 0x60 |
| 24 | |
| 25 | static 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 Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 33 | |
Kyösti Mälkki | f0a3d44 | 2019-08-18 08:02:23 +0300 | [diff] [blame^] | 34 | void mainboard_romstage_entry(void) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 35 | { |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 36 | i82801ix_early_init(); |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 37 | |
Patrick Rudolph | fbdeb4a | 2019-02-14 19:47:03 +0100 | [diff] [blame] | 38 | mainboard_machine_check(); |
| 39 | |
Patrick Rudolph | 1af8923 | 2018-11-11 12:50:51 +0100 | [diff] [blame] | 40 | cbmem_recovery(0); |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 41 | } |