Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 1 | /* |
| 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 Dawson | a102a02 | 2017-08-10 15:17:26 -0600 | [diff] [blame] | 16 | #include <arch/cpu.h> |
Aaron Durbin | 1e9a914 | 2016-09-16 16:23:21 -0500 | [diff] [blame] | 17 | #include <cbmem.h> |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 18 | #include <console/console.h> |
Nico Huber | d67edca | 2018-11-13 19:28:07 +0100 | [diff] [blame] | 19 | #include <cpu/x86/mtrr.h> |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 20 | #include <main_decl.h> |
| 21 | #include <program_loading.h> |
Subrata Banik | 4f42eea | 2019-03-05 16:45:14 +0530 | [diff] [blame] | 22 | #include <timestamp.h> |
Marshall Dawson | a102a02 | 2017-08-10 15:17:26 -0600 | [diff] [blame] | 23 | |
| 24 | /* |
| 25 | * Systems without a native coreboot cache-as-ram teardown may implement |
| 26 | * this to use an alternate method. |
| 27 | */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 28 | __weak void late_car_teardown(void) { /* do nothing */ } |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 29 | |
| 30 | void main(void) |
| 31 | { |
Marshall Dawson | a102a02 | 2017-08-10 15:17:26 -0600 | [diff] [blame] | 32 | late_car_teardown(); |
Brenton Dong | 0a5971c | 2016-10-18 11:35:15 -0700 | [diff] [blame] | 33 | |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 34 | console_init(); |
| 35 | |
Aaron Durbin | 1e9a914 | 2016-09-16 16:23:21 -0500 | [diff] [blame] | 36 | /* Recover cbmem so infrastruture using it is functional. */ |
| 37 | cbmem_initialize(); |
| 38 | |
Subrata Banik | 4f42eea | 2019-03-05 16:45:14 +0530 | [diff] [blame] | 39 | timestamp_add_now(TS_START_POSTCAR); |
| 40 | |
Nico Huber | d67edca | 2018-11-13 19:28:07 +0100 | [diff] [blame] | 41 | display_mtrrs(); |
Aaron Durbin | 6b0cebc | 2016-09-16 16:15:14 -0500 | [diff] [blame] | 42 | |
| 43 | /* Load and run ramstage. */ |
| 44 | run_ramstage(); |
| 45 | } |