blob: fd75250bb4aeb27b0d40fef8ddf4e0e60b19414d [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>
Aaron Durbin64031672018-04-21 14:45:32 -060018#include <compiler.h>
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070019#include <console/console.h>
Aaron Durbin588ad7b2015-09-29 17:56:59 -050020#include <program_loading.h>
Philipp Deppenwiesefea24292017-10-17 17:02:29 +020021#include <security/vboot/vboot_common.h>
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070022
Aaron Durbin64031672018-04-21 14:45:32 -060023void __weak verstage_mainboard_init(void)
Daisuke Nojiri1989a532014-06-30 08:28:17 -070024{
Aaron Durbin588ad7b2015-09-29 17:56:59 -050025 /* Default empty implementation. */
Daisuke Nojiri1989a532014-06-30 08:28:17 -070026}
27
Julius Werner94d94112017-03-16 19:21:51 -070028void main(void)
Julius Wernerb5995b52014-12-01 13:28:47 -080029{
30 console_init();
31 exception_init();
Aaron Durbin588ad7b2015-09-29 17:56:59 -050032 verstage_mainboard_init();
33
Julius Werner58c39382017-02-13 17:53:29 -080034 if (IS_ENABLED(CONFIG_VBOOT_RETURN_FROM_VERSTAGE)) {
Aaron Durbin588ad7b2015-09-29 17:56:59 -050035 verstage_main();
36 } else {
37 run_romstage();
38 hlt();
39 }
Julius Wernerb5995b52014-12-01 13:28:47 -080040}