diff --git a/src/soc/mediatek/common/include/soc/symbols.h b/src/soc/mediatek/common/include/soc/symbols.h index 33914678b3..ae0c7932a4 100644 --- a/src/soc/mediatek/common/include/soc/symbols.h +++ b/src/soc/mediatek/common/include/soc/symbols.h @@ -9,6 +9,7 @@ DECLARE_REGION(dram_dma) DECLARE_REGION(resv_mem_optee) DECLARE_REGION(resv_mem_gpu) DECLARE_REGION(resv_mem_gpueb) +DECLARE_REGION(dvfs2_reserved) DECLARE_OPTIONAL_REGION(mcufw_reserved) #endif /* _SOC_MEDIATEK_COMMON_SYMBOLS_H_ */ diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index 2890564792..e00e42cd20 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -20,6 +20,7 @@ romstage-y += ../common/cbmem.c romstage-y += ../common/cpu_id.c ../common/cpu_segment_id.c romstage-y += ../common/dram_init.c romstage-y += ../common/dramc_param.c +romstage-y += dvfs.c romstage-y += ../common/emi.c romstage-y += ../common/memory.c ../common/memory_test.c romstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c diff --git a/src/soc/mediatek/mt8189/dvfs.c b/src/soc/mediatek/mt8189/dvfs.c new file mode 100644 index 0000000000..f34586ea46 --- /dev/null +++ b/src/soc/mediatek/mt8189/dvfs.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#include +#include +#include +#include +#include + +void dvfs_init(void) +{ + u32 id, val; + + id = get_cpu_segment_id(); + val = (id << 8) | BIT(0); + + write32(_dvfs2_reserved + 0x8, 0x55AA55AA); + write32(_dvfs2_reserved + 0xC, val); + + dcache_clean_invalidate_by_mva(_dvfs2_reserved, 0x10); +} diff --git a/src/soc/mediatek/mt8189/include/soc/dvfs.h b/src/soc/mediatek/mt8189/include/soc/dvfs.h new file mode 100644 index 0000000000..aa44b1a2ac --- /dev/null +++ b/src/soc/mediatek/mt8189/include/soc/dvfs.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#ifndef __SOC_MEDIATEK_MT8189_INCLUDE_SOC_DVFS_H__ +#define __SOC_MEDIATEK_MT8189_INCLUDE_SOC_DVFS_H__ + +#include + +#endif /* __SOC_MEDIATEK_MT8189_INCLUDE_SOC_DVFS_H__ */