blob: a3a521b3743d549d3d479da780122d888c7ee334 [file] [log] [blame]
Patrick Georgi11f00792020-03-04 15:10:45 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Aaron Durbin6b0cebc2016-09-16 16:15:14 -05003
Kyösti Mälkkia963acd2019-08-16 20:34:25 +03004#include <arch/romstage.h>
Aaron Durbin1e9a9142016-09-16 16:23:21 -05005#include <cbmem.h>
Aaron Durbin6b0cebc2016-09-16 16:15:14 -05006#include <console/console.h>
Nico Huberd67edca2018-11-13 19:28:07 +01007#include <cpu/x86/mtrr.h>
Aaron Durbin6b0cebc2016-09-16 16:15:14 -05008#include <main_decl.h>
9#include <program_loading.h>
Subrata Banik4f42eea2019-03-05 16:45:14 +053010#include <timestamp.h>
Marshall Dawsona102a022017-08-10 15:17:26 -060011
12/*
13 * Systems without a native coreboot cache-as-ram teardown may implement
14 * this to use an alternate method.
15 */
Aaron Durbin64031672018-04-21 14:45:32 -060016__weak void late_car_teardown(void) { /* do nothing */ }
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050017
18void main(void)
19{
Marshall Dawsona102a022017-08-10 15:17:26 -060020 late_car_teardown();
Brenton Dong0a5971c2016-10-18 11:35:15 -070021
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050022 console_init();
23
Kyösti Mälkki8b936892019-09-12 13:45:15 +030024 /*
25 * CBMEM needs to be recovered because timestamps rely on
26 * the cbmem infrastructure being around. Explicitly recover it.
27 */
Aaron Durbin1e9a9142016-09-16 16:23:21 -050028 cbmem_initialize();
29
Subrata Banik4f42eea2019-03-05 16:45:14 +053030 timestamp_add_now(TS_START_POSTCAR);
31
Nico Huberd67edca2018-11-13 19:28:07 +010032 display_mtrrs();
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050033
34 /* Load and run ramstage. */
35 run_ramstage();
36}