blob: 7d0e9c2d735bbbc82e90a7b0b30009ee85929576 [file] [log] [blame]
Tristan Shiehcfd89292018-05-31 09:22:53 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2018 MediaTek Inc.
5 *
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.
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
Julius Werner5d6593a2018-08-10 16:13:26 -070016#include <arch/stages.h>
Junzhi Zhao66ee65f2018-06-13 16:20:00 +080017#include <soc/emi.h>
Tristan Shiehbb684e02018-06-19 16:07:54 +080018#include <soc/mmu_operations.h>
Hsin-Hsiung Wang23b1afe2018-10-24 19:18:28 +080019#include <soc/mt6358.h>
Ran Bia198c9d2019-02-20 10:25:09 +080020#include <soc/rtc.h>
Tristan Shiehcfd89292018-05-31 09:22:53 +080021
You-Cheng Syufff2ad92019-01-29 20:04:59 +080022#include "early_init.h"
23
Julius Werner5d6593a2018-08-10 16:13:26 -070024void platform_romstage_main(void)
Tristan Shiehcfd89292018-05-31 09:22:53 +080025{
You-Cheng Syufff2ad92019-01-29 20:04:59 +080026 /* This will be done in verstage if CONFIG_VBOOT is enabled. */
27 if (!IS_ENABLED(CONFIG_VBOOT))
28 mainboard_early_init();
29
Hsin-Hsiung Wang23b1afe2018-10-24 19:18:28 +080030 mt6358_init();
Ran Bia198c9d2019-02-20 10:25:09 +080031 rtc_boot();
Junzhi Zhao66ee65f2018-06-13 16:20:00 +080032 mt_mem_init(get_sdram_config());
Tristan Shiehbb684e02018-06-19 16:07:54 +080033 mtk_mmu_after_dram();
Tristan Shiehcfd89292018-05-31 09:22:53 +080034}