blob: f878255463dd5cce760d54db6e2de74740dd0b55 [file] [log] [blame]
Gabe Blackf2f817e2013-10-01 05:20:17 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2010 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010018 * Foundation, Inc.
Gabe Blackf2f817e2013-10-01 05:20:17 -070019 */
20
Julius Werner85620db2013-11-13 18:22:15 -080021#include <arch/exception.h>
Gabe Blackf2f817e2013-10-01 05:20:17 -070022#include <arch/stages.h>
23#include <bootblock_common.h>
24#include <cbfs.h>
25#include <console/console.h>
Julius Werner44cf8702014-12-08 13:39:14 -080026#include <delay.h>
Aaron Durbinf5d7f602015-03-17 13:20:02 -050027#include <program_loading.h>
Julius Werner44cf8702014-12-08 13:39:14 -080028#include <timestamp.h>
Gabe Blackf2f817e2013-10-01 05:20:17 -070029
Julius Wernerf1e32102014-11-25 13:22:20 -080030__attribute__((weak)) void bootblock_mainboard_early_init(void) { /* no-op */ }
Vadim Bendebury0b341b32014-04-23 11:09:44 -070031__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
32__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
33
Gabe Blackf2f817e2013-10-01 05:20:17 -070034void main(void)
35{
Julius Werner44cf8702014-12-08 13:39:14 -080036 init_timer();
37 if (IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION))
38 timestamp_init(timestamp_get());
39
Julius Wernerf1e32102014-11-25 13:22:20 -080040 bootblock_mainboard_early_init();
Gabe Blackf2f817e2013-10-01 05:20:17 -070041
Julius Werner85620db2013-11-13 18:22:15 -080042 if (CONFIG_BOOTBLOCK_CONSOLE) {
Gabe Blackf2f817e2013-10-01 05:20:17 -070043 console_init();
Julius Werner85620db2013-11-13 18:22:15 -080044 exception_init();
45 }
Gabe Blackf2f817e2013-10-01 05:20:17 -070046
Julius Wernerf1e32102014-11-25 13:22:20 -080047 bootblock_soc_init();
48 bootblock_mainboard_init();
49
Aaron Durbinf5d7f602015-03-17 13:20:02 -050050 run_romstage();
Gabe Blackf2f817e2013-10-01 05:20:17 -070051}