Tristan Shieh | cfd8929 | 2018-05-31 09:22:53 +0800 | [diff] [blame] | 1 | /* |
| 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 Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 16 | #include <arch/stages.h> |
Junzhi Zhao | 66ee65f | 2018-06-13 16:20:00 +0800 | [diff] [blame] | 17 | #include <soc/emi.h> |
Tristan Shieh | bb684e0 | 2018-06-19 16:07:54 +0800 | [diff] [blame] | 18 | #include <soc/mmu_operations.h> |
Hsin-Hsiung Wang | 23b1afe | 2018-10-24 19:18:28 +0800 | [diff] [blame] | 19 | #include <soc/mt6358.h> |
Ran Bi | a198c9d | 2019-02-20 10:25:09 +0800 | [diff] [blame] | 20 | #include <soc/rtc.h> |
Tristan Shieh | cfd8929 | 2018-05-31 09:22:53 +0800 | [diff] [blame] | 21 | |
You-Cheng Syu | fff2ad9 | 2019-01-29 20:04:59 +0800 | [diff] [blame] | 22 | #include "early_init.h" |
| 23 | |
Julius Werner | 5d6593a | 2018-08-10 16:13:26 -0700 | [diff] [blame] | 24 | void platform_romstage_main(void) |
Tristan Shieh | cfd8929 | 2018-05-31 09:22:53 +0800 | [diff] [blame] | 25 | { |
You-Cheng Syu | fff2ad9 | 2019-01-29 20:04:59 +0800 | [diff] [blame] | 26 | /* This will be done in verstage if CONFIG_VBOOT is enabled. */ |
| 27 | if (!IS_ENABLED(CONFIG_VBOOT)) |
| 28 | mainboard_early_init(); |
| 29 | |
Hsin-Hsiung Wang | 23b1afe | 2018-10-24 19:18:28 +0800 | [diff] [blame] | 30 | mt6358_init(); |
Ran Bi | a198c9d | 2019-02-20 10:25:09 +0800 | [diff] [blame] | 31 | rtc_boot(); |
Junzhi Zhao | 66ee65f | 2018-06-13 16:20:00 +0800 | [diff] [blame] | 32 | mt_mem_init(get_sdram_config()); |
Tristan Shieh | bb684e0 | 2018-06-19 16:07:54 +0800 | [diff] [blame] | 33 | mtk_mmu_after_dram(); |
Tristan Shieh | cfd8929 | 2018-05-31 09:22:53 +0800 | [diff] [blame] | 34 | } |