blob: 8e44ea8749a313f16616cf3cf8a72fbd22e2a8b7 [file] [log] [blame]
Vadim Bendeburyc7b3f722014-09-02 13:20:47 -07001/*
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 Bendeburyc7b3f722014-09-02 13:20:47 -070015 */
16
Ionela Voinescu11f33e42015-05-26 13:51:31 +010017#include <cbmem.h>
Vadim Bendeburyc7b3f722014-09-02 13:20:47 -070018#include <console/console.h>
Ionela Voinescud6aaca92015-01-19 01:03:44 +000019#include <halt.h>
Ionela Voinescu1d4c3052015-06-07 23:22:34 +010020#include <program_loading.h>
Ionela Voinescud6aaca92015-01-19 01:03:44 +000021#include <soc/ddr_init.h>
Vadim Bendeburyc7b3f722014-09-02 13:20:47 -070022
23void main(void)
24{
Ionela Voinescud6aaca92015-01-19 01:03:44 +000025 int error;
Vadim Bendeburyc7b3f722014-09-02 13:20:47 -070026 console_init();
Ionela Voinescud6aaca92015-01-19 01:03:44 +000027 error = init_ddr2();
28
29 if (!error) {
Ionela Voinescu11f33e42015-05-26 13:51:31 +010030 /*
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 Voinescud6aaca92015-01-19 01:03:44 +000036 run_ramstage();
37 }
38 halt();
Vadim Bendeburyc7b3f722014-09-02 13:20:47 -070039}