Patrick Georgi | 11f0079 | 2020-03-04 15:10:45 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 2 | |
Kyösti Mälkki | a963acd | 2019-08-16 20:34:25 +0300 | [diff] [blame] | 3 | #include <arch/romstage.h> |
Aaron Durbin | 1e9a914 | 2016-09-16 16:23:21 -0500 | [diff] [blame] | 4 | #include <cbmem.h> |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 5 | #include <console/console.h> |
Nico Huber | d67edca | 2018-11-13 19:28:07 +0100 | [diff] [blame] | 6 | #include <cpu/x86/mtrr.h> |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 7 | #include <main_decl.h> |
| 8 | #include <program_loading.h> |
Subrata Banik | 4f42eea | 2019-03-05 16:45:14 +0530 | [diff] [blame] | 9 | #include <timestamp.h> |
Marshall Dawson | a102a02 | 2017-08-10 15:17:26 -0600 | [diff] [blame] | 10 | |
| 11 | /* |
| 12 | * Systems without a native coreboot cache-as-ram teardown may implement |
| 13 | * this to use an alternate method. |
| 14 | */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 15 | __weak void late_car_teardown(void) { /* do nothing */ } |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 16 | |
| 17 | void main(void) |
| 18 | { |
Marshall Dawson | a102a02 | 2017-08-10 15:17:26 -0600 | [diff] [blame] | 19 | late_car_teardown(); |
Brenton Dong | 0a5971c | 2016-10-18 11:35:15 -0700 | [diff] [blame] | 20 | |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 21 | console_init(); |
| 22 | |
Kyösti Mälkki | 8b93689 | 2019-09-12 13:45:15 +0300 | [diff] [blame] | 23 | /* |
| 24 | * CBMEM needs to be recovered because timestamps rely on |
| 25 | * the cbmem infrastructure being around. Explicitly recover it. |
| 26 | */ |
Aaron Durbin | 1e9a914 | 2016-09-16 16:23:21 -0500 | [diff] [blame] | 27 | cbmem_initialize(); |
| 28 | |
Subrata Banik | 4f42eea | 2019-03-05 16:45:14 +0530 | [diff] [blame] | 29 | timestamp_add_now(TS_START_POSTCAR); |
| 30 | |
Nico Huber | d67edca | 2018-11-13 19:28:07 +0100 | [diff] [blame] | 31 | display_mtrrs(); |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 32 | |
| 33 | /* Load and run ramstage. */ |
| 34 | run_ramstage(); |
| 35 | } |