blob: 1265640dbbf616415bb420ec0592f8cc87604c32 [file] [log] [blame]
Rex-BC Chendb8442b2022-07-01 17:37:37 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <arch/stages.h>
Rex-BC Chen5f9395c2022-08-16 11:04:49 +08004#include <console/console.h>
5#include <delay.h>
Rex-BC Chend699de02022-07-25 20:26:52 +08006#include <soc/clkbuf.h>
Xi Chenbcaa87d2022-07-28 13:45:18 +08007#include <soc/emi.h>
Bo-Chen Chen9d11cd72022-06-30 13:40:49 +08008#include <soc/mt6315.h>
9#include <soc/mt6359p.h>
Rex-BC Chen5f9395c2022-08-16 11:04:49 +080010#include <soc/pll_common.h>
Bo-Chen Chen9d11cd72022-06-30 13:40:49 +080011#include <soc/pmif.h>
Rex-BC Chen5f9395c2022-08-16 11:04:49 +080012#include <soc/regulator.h>
Rex-BC Chend699de02022-07-25 20:26:52 +080013#include <soc/rtc.h>
Rex-BC Chendb8442b2022-07-01 17:37:37 +080014
Rex-BC Chen5f9395c2022-08-16 11:04:49 +080015static void raise_little_cpu_freq(void)
16{
17 mainboard_set_regulator_voltage(MTK_REGULATOR_VPROC11, 900000);
18 mainboard_set_regulator_voltage(MTK_REGULATOR_VSRAM_PROC11, 1000000);
19 udelay(200);
20 mt_pll_raise_little_cpu_freq(2000 * MHz);
21 mt_pll_raise_cci_freq(1600 * MHz);
22
23 printk(BIOS_INFO, "Check CPU freq: %u KHz, cci: %u KHz\n",
24 mt_fmeter_get_freq_khz(FMETER_ABIST, 1),
25 mt_fmeter_get_freq_khz(FMETER_ABIST, 3));
26}
27
Rex-BC Chendb8442b2022-07-01 17:37:37 +080028void platform_romstage_main(void)
29{
Bo-Chen Chen9d11cd72022-06-30 13:40:49 +080030 mtk_pmif_init();
31 mt6315_init();
32 mt6359p_init();
Rex-BC Chen5f9395c2022-08-16 11:04:49 +080033 raise_little_cpu_freq();
Rex-BC Chend699de02022-07-25 20:26:52 +080034 clk_buf_init();
35 rtc_boot();
Xi Chenbcaa87d2022-07-28 13:45:18 +080036 mtk_dram_init();
Rex-BC Chendb8442b2022-07-01 17:37:37 +080037}