Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 1 | /* |
| 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 Georgi | b890a12 | 2015-03-26 15:17:45 +0100 | [diff] [blame] | 18 | * Foundation, Inc. |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 19 | */ |
| 20 | |
Julius Werner | 85620db | 2013-11-13 18:22:15 -0800 | [diff] [blame] | 21 | #include <arch/exception.h> |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 22 | #include <arch/stages.h> |
| 23 | #include <bootblock_common.h> |
| 24 | #include <cbfs.h> |
| 25 | #include <console/console.h> |
Julius Werner | 44cf870 | 2014-12-08 13:39:14 -0800 | [diff] [blame] | 26 | #include <delay.h> |
Aaron Durbin | f5d7f60 | 2015-03-17 13:20:02 -0500 | [diff] [blame] | 27 | #include <program_loading.h> |
Julius Werner | 44cf870 | 2014-12-08 13:39:14 -0800 | [diff] [blame] | 28 | #include <timestamp.h> |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 29 | |
Julius Werner | f1e3210 | 2014-11-25 13:22:20 -0800 | [diff] [blame] | 30 | __attribute__((weak)) void bootblock_mainboard_early_init(void) { /* no-op */ } |
Vadim Bendebury | 0b341b3 | 2014-04-23 11:09:44 -0700 | [diff] [blame] | 31 | __attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ } |
| 32 | __attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ } |
| 33 | |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 34 | void main(void) |
| 35 | { |
Julius Werner | 44cf870 | 2014-12-08 13:39:14 -0800 | [diff] [blame] | 36 | init_timer(); |
| 37 | if (IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION)) |
| 38 | timestamp_init(timestamp_get()); |
| 39 | |
Julius Werner | f1e3210 | 2014-11-25 13:22:20 -0800 | [diff] [blame] | 40 | bootblock_mainboard_early_init(); |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 41 | |
Julius Werner | 85620db | 2013-11-13 18:22:15 -0800 | [diff] [blame] | 42 | if (CONFIG_BOOTBLOCK_CONSOLE) { |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 43 | console_init(); |
Julius Werner | 85620db | 2013-11-13 18:22:15 -0800 | [diff] [blame] | 44 | exception_init(); |
| 45 | } |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 46 | |
Julius Werner | f1e3210 | 2014-11-25 13:22:20 -0800 | [diff] [blame] | 47 | bootblock_soc_init(); |
| 48 | bootblock_mainboard_init(); |
| 49 | |
Aaron Durbin | f5d7f60 | 2015-03-17 13:20:02 -0500 | [diff] [blame] | 50 | run_romstage(); |
Gabe Black | f2f817e | 2013-10-01 05:20:17 -0700 | [diff] [blame] | 51 | } |