Vadim Bendebury | c7b3f72 | 2014-09-02 13:20:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Imagination Technologies |
| 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. |
Vadim Bendebury | c7b3f72 | 2014-09-02 13:20:47 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Ionela Voinescu | 11f33e4 | 2015-05-26 13:51:31 +0100 | [diff] [blame] | 17 | #include <cbmem.h> |
Vadim Bendebury | c7b3f72 | 2014-09-02 13:20:47 -0700 | [diff] [blame] | 18 | #include <console/console.h> |
Ionela Voinescu | d6aaca9 | 2015-01-19 01:03:44 +0000 | [diff] [blame] | 19 | #include <halt.h> |
Ionela Voinescu | 1d4c305 | 2015-06-07 23:22:34 +0100 | [diff] [blame] | 20 | #include <program_loading.h> |
Ionela Voinescu | d6aaca9 | 2015-01-19 01:03:44 +0000 | [diff] [blame] | 21 | #include <soc/ddr_init.h> |
Vadim Bendebury | c7b3f72 | 2014-09-02 13:20:47 -0700 | [diff] [blame] | 22 | |
| 23 | void main(void) |
| 24 | { |
Ionela Voinescu | d6aaca9 | 2015-01-19 01:03:44 +0000 | [diff] [blame] | 25 | int error; |
Vadim Bendebury | c7b3f72 | 2014-09-02 13:20:47 -0700 | [diff] [blame] | 26 | console_init(); |
Ionela Voinescu | d6aaca9 | 2015-01-19 01:03:44 +0000 | [diff] [blame] | 27 | error = init_ddr2(); |
| 28 | |
| 29 | if (!error) { |
Ionela Voinescu | 11f33e4 | 2015-05-26 13:51:31 +0100 | [diff] [blame] | 30 | /* |
| 31 | * When romstage is running it's always on the reboot path and |
| 32 | * never a resume path where cbmem recovery is required. |
| 33 | * Therefore, always initialize the cbmem area to be empty. |
| 34 | */ |
| 35 | cbmem_initialize_empty(); |
Ionela Voinescu | d6aaca9 | 2015-01-19 01:03:44 +0000 | [diff] [blame] | 36 | run_ramstage(); |
| 37 | } |
| 38 | halt(); |
Vadim Bendebury | c7b3f72 | 2014-09-02 13:20:47 -0700 | [diff] [blame] | 39 | } |