Angel Pons | 986d50e | 2020-04-02 23:48:53 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Daisuke Nojiri | efddcfb | 2014-09-04 09:55:34 -0700 | [diff] [blame] | 2 | |
Julius Werner | b5995b5 | 2014-12-01 13:28:47 -0800 | [diff] [blame] | 3 | #include <arch/exception.h> |
Aaron Durbin | 588ad7b | 2015-09-29 17:56:59 -0500 | [diff] [blame] | 4 | #include <arch/hlt.h> |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 5 | #include <console/console.h> |
Aaron Durbin | 588ad7b | 2015-09-29 17:56:59 -0500 | [diff] [blame] | 6 | #include <program_loading.h> |
Philipp Deppenwiese | fea2429 | 2017-10-17 17:02:29 +0200 | [diff] [blame] | 7 | #include <security/vboot/vboot_common.h> |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 8 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 9 | void __weak verstage_mainboard_init(void) |
Daisuke Nojiri | 1989a53 | 2014-06-30 08:28:17 -0700 | [diff] [blame] | 10 | { |
Aaron Durbin | 588ad7b | 2015-09-29 17:56:59 -0500 | [diff] [blame] | 11 | /* Default empty implementation. */ |
Daisuke Nojiri | 1989a53 | 2014-06-30 08:28:17 -0700 | [diff] [blame] | 12 | } |
13 | |||||
Julius Werner | 94d9411 | 2017-03-16 19:21:51 -0700 | [diff] [blame] | 14 | void main(void) |
Julius Werner | b5995b5 | 2014-12-01 13:28:47 -0800 | [diff] [blame] | 15 | { |
16 | console_init(); | ||||
17 | exception_init(); | ||||
Aaron Durbin | 588ad7b | 2015-09-29 17:56:59 -0500 | [diff] [blame] | 18 | verstage_mainboard_init(); |
19 | |||||
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 20 | if (CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) { |
Aaron Durbin | 588ad7b | 2015-09-29 17:56:59 -0500 | [diff] [blame] | 21 | verstage_main(); |
Julius Werner | 5a090bf | 2021-04-02 17:24:34 -0700 | [diff] [blame] | 22 | printk(BIOS_DEBUG, "VBOOT: Returning from verstage.\n"); |
Aaron Durbin | 588ad7b | 2015-09-29 17:56:59 -0500 | [diff] [blame] | 23 | } else { |
24 | run_romstage(); | ||||
25 | hlt(); | ||||
26 | } | ||||
Julius Werner | b5995b5 | 2014-12-01 13:28:47 -0800 | [diff] [blame] | 27 | } |