blob: d7d0bb56f46d44ef5ec57e3feb0f28c4c3a7df20 [file] [log] [blame]
Stefan Reinauer52db0b92012-12-07 17:15:04 -08001/*
2 * This file is part of the coreboot project.
3 *
Stefan Reinauer08dc3572013-05-14 16:57:50 -07004 * Copyright 2010 Google Inc.
Stefan Reinauer52db0b92012-12-07 17:15:04 -08005 *
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.
Stefan Reinauer52db0b92012-12-07 17:15:04 -080015 */
16
Julius Werner85620db2013-11-13 18:22:15 -080017#include <arch/exception.h>
Gabe Black8b685392013-09-29 03:02:55 -070018#include <bootblock_common.h>
Hung-Te Linb868d402013-02-06 22:01:18 +080019#include <console/console.h>
Julius Werner44cf8702014-12-08 13:39:14 -080020#include <delay.h>
Aaron Durbinf5d7f602015-03-17 13:20:02 -050021#include <program_loading.h>
Julius Werner44cf8702014-12-08 13:39:14 -080022#include <timestamp.h>
David Hendricks50c0a502013-01-31 17:05:50 -080023
Julius Wernerf1e32102014-11-25 13:22:20 -080024__attribute__((weak)) void bootblock_mainboard_early_init(void) { /* no-op */ }
Vadim Bendebury0b341b32014-04-23 11:09:44 -070025__attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
26__attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
27
David Hendricks50c0a502013-01-31 17:05:50 -080028void main(void)
Stefan Reinauer52db0b92012-12-07 17:15:04 -080029{
Julius Werner44cf8702014-12-08 13:39:14 -080030 init_timer();
31 if (IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION))
32 timestamp_init(timestamp_get());
33
Julius Wernerf1e32102014-11-25 13:22:20 -080034 bootblock_mainboard_early_init();
David Hendricks3d7344a2013-01-08 21:05:06 -080035
Julius Werner86fc11d2015-10-09 13:37:58 -070036 if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
37 console_init();
38 exception_init();
39 }
Stefan Reinauer919c8042013-05-16 10:57:15 -070040
Julius Wernerf1e32102014-11-25 13:22:20 -080041 bootblock_soc_init();
42 bootblock_mainboard_init();
43
Aaron Durbinf5d7f602015-03-17 13:20:02 -050044 run_romstage();
Stefan Reinauer52db0b92012-12-07 17:15:04 -080045}