blob: ef0bd48850856070b4e2462e5807863b74644f99 [file] [log] [blame]
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -07001/*
2 * This file is part of the coreboot project.
3 *
Aaron Durbin588ad7b2015-09-29 17:56:59 -05004 * Copyright 2015 Google Inc.
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -07005 *
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
Aaron Durbin588ad7b2015-09-29 17:56:59 -050012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -070013 * GNU General Public License for more details.
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -070014 */
15
Julius Wernerb5995b52014-12-01 13:28:47 -080016#include <arch/exception.h>
Aaron Durbin588ad7b2015-09-29 17:56:59 -050017#include <arch/hlt.h>
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070018#include <console/console.h>
Aaron Durbin588ad7b2015-09-29 17:56:59 -050019#include <program_loading.h>
Philipp Deppenwiesefea24292017-10-17 17:02:29 +020020#include <security/vboot/vboot_common.h>
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070021
Aaron Durbin64031672018-04-21 14:45:32 -060022void __weak verstage_mainboard_init(void)
Daisuke Nojiri1989a532014-06-30 08:28:17 -070023{
Aaron Durbin588ad7b2015-09-29 17:56:59 -050024 /* Default empty implementation. */
Daisuke Nojiri1989a532014-06-30 08:28:17 -070025}
26
Julius Werner94d94112017-03-16 19:21:51 -070027void main(void)
Julius Wernerb5995b52014-12-01 13:28:47 -080028{
29 console_init();
30 exception_init();
Aaron Durbin588ad7b2015-09-29 17:56:59 -050031 verstage_mainboard_init();
32
Julius Wernercd49cce2019-03-05 16:53:33 -080033 if (CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) {
Aaron Durbin588ad7b2015-09-29 17:56:59 -050034 verstage_main();
35 } else {
36 run_romstage();
37 hlt();
38 }
Julius Wernerb5995b52014-12-01 13:28:47 -080039}