Rex-BC Chen | db8442b | 2022-07-01 17:37:37 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <arch/stages.h> |
Rex-BC Chen | 5f9395c | 2022-08-16 11:04:49 +0800 | [diff] [blame] | 4 | #include <console/console.h> |
| 5 | #include <delay.h> |
Rex-BC Chen | d699de0 | 2022-07-25 20:26:52 +0800 | [diff] [blame] | 6 | #include <soc/clkbuf.h> |
Xi Chen | bcaa87d | 2022-07-28 13:45:18 +0800 | [diff] [blame] | 7 | #include <soc/emi.h> |
Bo-Chen Chen | 9d11cd7 | 2022-06-30 13:40:49 +0800 | [diff] [blame] | 8 | #include <soc/mt6315.h> |
| 9 | #include <soc/mt6359p.h> |
Rex-BC Chen | 5f9395c | 2022-08-16 11:04:49 +0800 | [diff] [blame] | 10 | #include <soc/pll_common.h> |
Bo-Chen Chen | 9d11cd7 | 2022-06-30 13:40:49 +0800 | [diff] [blame] | 11 | #include <soc/pmif.h> |
Rex-BC Chen | 5f9395c | 2022-08-16 11:04:49 +0800 | [diff] [blame] | 12 | #include <soc/regulator.h> |
Rex-BC Chen | d699de0 | 2022-07-25 20:26:52 +0800 | [diff] [blame] | 13 | #include <soc/rtc.h> |
Rex-BC Chen | db8442b | 2022-07-01 17:37:37 +0800 | [diff] [blame] | 14 | |
Rex-BC Chen | 5f9395c | 2022-08-16 11:04:49 +0800 | [diff] [blame] | 15 | static 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 Chen | db8442b | 2022-07-01 17:37:37 +0800 | [diff] [blame] | 28 | void platform_romstage_main(void) |
| 29 | { |
Bo-Chen Chen | 9d11cd7 | 2022-06-30 13:40:49 +0800 | [diff] [blame] | 30 | mtk_pmif_init(); |
| 31 | mt6315_init(); |
| 32 | mt6359p_init(); |
Rex-BC Chen | 5f9395c | 2022-08-16 11:04:49 +0800 | [diff] [blame] | 33 | raise_little_cpu_freq(); |
Rex-BC Chen | d699de0 | 2022-07-25 20:26:52 +0800 | [diff] [blame] | 34 | clk_buf_init(); |
| 35 | rtc_boot(); |
Xi Chen | bcaa87d | 2022-07-28 13:45:18 +0800 | [diff] [blame] | 36 | mtk_dram_init(); |
Rex-BC Chen | db8442b | 2022-07-01 17:37:37 +0800 | [diff] [blame] | 37 | } |