Patrick Georgi | 0a3d4e0 | 2020-03-04 14:39:09 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 2 | |
| 3 | #include <arch/exception.h> |
| 4 | #include <arch/stages.h> |
| 5 | #include <cbmem.h> |
| 6 | #include <console/console.h> |
| 7 | #include <program_loading.h> |
Arthur Heymans | 3e914d3 | 2022-04-06 22:25:50 +0200 | [diff] [blame] | 8 | #include <romstage_common.h> |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 9 | #include <timestamp.h> |
| 10 | |
| 11 | __weak void platform_romstage_main(void) { /* no-op, for bring-up */ } |
| 12 | __weak void platform_romstage_postram(void) { /* no-op */ } |
| 13 | |
Arthur Heymans | a2bc254 | 2021-05-29 08:10:49 +0200 | [diff] [blame^] | 14 | #if CONFIG(SEPARATE_ROMSTAGE) |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 15 | void main(void) |
| 16 | { |
Jakub Czapiga | ad6157e | 2022-02-15 11:50:31 +0100 | [diff] [blame] | 17 | timestamp_add_now(TS_ROMSTAGE_START); |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 18 | |
| 19 | console_init(); |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 20 | |
Arthur Heymans | 3e914d3 | 2022-04-06 22:25:50 +0200 | [diff] [blame] | 21 | exception_init(); |
| 22 | romstage_main(); |
| 23 | } |
Arthur Heymans | a2bc254 | 2021-05-29 08:10:49 +0200 | [diff] [blame^] | 24 | #endif |
Arthur Heymans | 3e914d3 | 2022-04-06 22:25:50 +0200 | [diff] [blame] | 25 | |
| 26 | void __noreturn romstage_main(void) |
| 27 | { |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 28 | platform_romstage_main(); |
| 29 | cbmem_initialize_empty(); |
| 30 | platform_romstage_postram(); |
| 31 | |
| 32 | run_ramstage(); |
| 33 | } |