blob: b4efc949b493197d9211f9bc672db1b704a7827b [file] [log] [blame]
Aaron Durbin6b0cebc2016-09-16 16:15:14 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2016 Google, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
Marshall Dawsona102a022017-08-10 15:17:26 -060016#include <arch/cpu.h>
Aaron Durbin1e9a9142016-09-16 16:23:21 -050017#include <cbmem.h>
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050018#include <console/console.h>
Nico Huberd67edca2018-11-13 19:28:07 +010019#include <cpu/x86/mtrr.h>
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050020#include <main_decl.h>
21#include <program_loading.h>
Subrata Banik4f42eea2019-03-05 16:45:14 +053022#include <timestamp.h>
Marshall Dawsona102a022017-08-10 15:17:26 -060023
24/*
25 * Systems without a native coreboot cache-as-ram teardown may implement
26 * this to use an alternate method.
27 */
Aaron Durbin64031672018-04-21 14:45:32 -060028__weak void late_car_teardown(void) { /* do nothing */ }
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050029
30void main(void)
31{
Marshall Dawsona102a022017-08-10 15:17:26 -060032 late_car_teardown();
Brenton Dong0a5971c2016-10-18 11:35:15 -070033
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050034 console_init();
35
Aaron Durbin1e9a9142016-09-16 16:23:21 -050036 /* Recover cbmem so infrastruture using it is functional. */
37 cbmem_initialize();
38
Subrata Banik4f42eea2019-03-05 16:45:14 +053039 timestamp_add_now(TS_START_POSTCAR);
40
Nico Huberd67edca2018-11-13 19:28:07 +010041 display_mtrrs();
Aaron Durbin6b0cebc2016-09-16 16:15:14 -050042
43 /* Load and run ramstage. */
44 run_ramstage();
45}