blob: 5e00890266a2ee93aff455d1b76421e60cc78c74 [file] [log] [blame]
Furquan Shaikh2af76f42014-04-28 16:39:40 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2014 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.
Furquan Shaikh2af76f42014-04-28 16:39:40 -070019 */
20
21#include <bootblock_common.h>
22#include <arch/cache.h>
Furquan Shaikh2af76f42014-04-28 16:39:40 -070023#include <arch/stages.h>
24#include <arch/exception.h>
25#include <cbfs.h>
26#include <console/console.h>
Aaron Durbinf5d7f602015-03-17 13:20:02 -050027#include <program_loading.h>
Furquan Shaikh2af76f42014-04-28 16:39:40 -070028
29static int boot_cpu(void)
30{
31 /*
32 * FIXME: This is a stub for now. All non-boot CPUs should be
33 * waiting for an interrupt. We could move the chunk of assembly
34 * which puts them to sleep in here...
35 */
36 return 1;
37}
38
39void main(void)
40{
Furquan Shaikh2af76f42014-04-28 16:39:40 -070041 /* Globally disable MMU, caches, and branch prediction (these should
42 * be disabled by default on reset) */
43 dcache_mmu_disable();
44
45 /*
46 * Re-enable icache and branch prediction. MMU and dcache will be
47 * set up later.
48 *
49 * Note: If booting from USB, we need to disable branch prediction
50 * before copying from USB into RAM (FIXME: why?)
51 */
52
53 if (boot_cpu()) {
54 //bootblock_cpu_init();
55 //bootblock_mainboard_init();
56 }
57
58#ifdef CONFIG_BOOTBLOCK_CONSOLE
59 console_init();
60 exception_init();
61#endif
62
Aaron Durbinf5d7f602015-03-17 13:20:02 -050063 run_romstage();
Furquan Shaikh2af76f42014-04-28 16:39:40 -070064}