blob: 0611a6d9591240c45fa8e752b4b89a62c021cebf [file] [log] [blame]
Jonathan Neuschäfer1c09cfa2018-04-19 16:23:55 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google, Inc.
5 *
Martin Rothb28f4662018-05-26 17:58:47 -06006 * 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.
Jonathan Neuschäfer1c09cfa2018-04-19 16:23:55 +02009 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
Philipp Hug374d9922018-09-13 22:16:36 +020016#include <cbmem.h>
Jonathan Neuschäfer1c09cfa2018-04-19 16:23:55 +020017#include <console/console.h>
Philipp Hug374d9922018-09-13 22:16:36 +020018#include <console/streams.h>
19#include <console/uart.h>
Jonathan Neuschäfer1c09cfa2018-04-19 16:23:55 +020020#include <program_loading.h>
Philipp Hug374d9922018-09-13 22:16:36 +020021#include <soc/clock.h>
22#include <soc/sdram.h>
Jonathan Neuschäfer1c09cfa2018-04-19 16:23:55 +020023
24void main(void)
25{
26 console_init();
27
28 /* TODO: Follow Section 6.3 (FSBL) of the FU540 manual */
29
Philipp Hug374d9922018-09-13 22:16:36 +020030 clock_init();
31
32 // re-initialize UART
Jonathan Neuschäferb1343da2018-10-29 15:30:53 +010033 if (IS_ENABLED(CONFIG_CONSOLE_SERIAL))
Philipp Hug374d9922018-09-13 22:16:36 +020034 uart_init(CONFIG_UART_FOR_CONSOLE);
Philipp Hug374d9922018-09-13 22:16:36 +020035
Philipp Hug91595722018-09-13 22:18:06 +020036 sdram_init();
37
Philipp Hug4e7a4732018-09-15 15:34:53 +020038 cbmem_initialize_empty();
39
Jonathan Neuschäfer1c09cfa2018-04-19 16:23:55 +020040 run_ramstage();
41}