Jonathan Neuschäfer | 1c09cfa | 2018-04-19 16:23:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google, Inc. |
| 5 | * |
Martin Roth | b28f466 | 2018-05-26 17:58:47 -0600 | [diff] [blame] | 6 | * 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äfer | 1c09cfa | 2018-04-19 16:23:55 +0200 | [diff] [blame] | 9 | * |
| 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 Hug | 374d992 | 2018-09-13 22:16:36 +0200 | [diff] [blame] | 16 | #include <cbmem.h> |
Jonathan Neuschäfer | 1c09cfa | 2018-04-19 16:23:55 +0200 | [diff] [blame] | 17 | #include <console/console.h> |
Philipp Hug | 374d992 | 2018-09-13 22:16:36 +0200 | [diff] [blame] | 18 | #include <console/streams.h> |
| 19 | #include <console/uart.h> |
Jonathan Neuschäfer | 1c09cfa | 2018-04-19 16:23:55 +0200 | [diff] [blame] | 20 | #include <program_loading.h> |
Philipp Hug | 374d992 | 2018-09-13 22:16:36 +0200 | [diff] [blame] | 21 | #include <soc/clock.h> |
| 22 | #include <soc/sdram.h> |
Jonathan Neuschäfer | 1c09cfa | 2018-04-19 16:23:55 +0200 | [diff] [blame] | 23 | |
| 24 | void main(void) |
| 25 | { |
| 26 | console_init(); |
| 27 | |
| 28 | /* TODO: Follow Section 6.3 (FSBL) of the FU540 manual */ |
| 29 | |
Philipp Hug | 374d992 | 2018-09-13 22:16:36 +0200 | [diff] [blame] | 30 | clock_init(); |
| 31 | |
| 32 | // re-initialize UART |
Jonathan Neuschäfer | b1343da | 2018-10-29 15:30:53 +0100 | [diff] [blame] | 33 | if (IS_ENABLED(CONFIG_CONSOLE_SERIAL)) |
Philipp Hug | 374d992 | 2018-09-13 22:16:36 +0200 | [diff] [blame] | 34 | uart_init(CONFIG_UART_FOR_CONSOLE); |
Philipp Hug | 374d992 | 2018-09-13 22:16:36 +0200 | [diff] [blame] | 35 | |
Philipp Hug | 9159572 | 2018-09-13 22:18:06 +0200 | [diff] [blame] | 36 | sdram_init(); |
| 37 | |
Philipp Hug | 4e7a473 | 2018-09-15 15:34:53 +0200 | [diff] [blame] | 38 | cbmem_initialize_empty(); |
| 39 | |
Jonathan Neuschäfer | 1c09cfa | 2018-04-19 16:23:55 +0200 | [diff] [blame] | 40 | run_ramstage(); |
| 41 | } |