soc/mediatek/mt8196: Add vcore DVFS settings

Add vcore settings, so that other tinysys (such as mcupm, spm, etc.)
will reference these value during initialization.

BUG=b:343878736
TEST=Build pass, boot successful. Check log with:
[INFO]	Vcore DVFS settings done

Change-Id: I0d3e1d6ea648af938d41a5c9461cdd2972371177
Signed-off-by: Kunlong Wang <kunlong.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86070
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
Jarried Lin 2025-01-21 00:59:40 +08:00 committed by Yidi Lin
commit 097376c150
4 changed files with 25 additions and 0 deletions

View file

@ -29,6 +29,7 @@ romstage-y += clkbuf_ctl.c
romstage-y += ../common/dram_init.c
romstage-y += ../common/dramc_param.c
romstage-y += dvfs.c
romstage-y += dvfsrc.c
romstage-$(CONFIG_PCI) += ../common/early_init.c ../common/pcie.c
romstage-y += ../common/emi.c
romstage-y += irq2axi.c

View file

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#include <console/console.h>
#include <device/mmio.h>
#include <soc/addressmap.h>
#include <soc/dvfsrc.h>
void dvfsrc_opp_level_mapping(void)
{
setbits32p(DVFSRC_RSRV_4, BIT(VCORE_B0_SHIFT));
printk(BIOS_INFO, "Vcore DVFS settings done\n");
}

View file

@ -156,6 +156,7 @@ enum {
SPM_PBUS_BASE = IO_PHYS + 0x0C00D000,
RGU_BASE = IO_PHYS + 0x0C010000,
RC_BASE = IO_PHYS + 0x0C011000,
DVFSRC_BASE = IO_PHYS + 0x0C013000,
GPT_BASE = IO_PHYS + 0x0C015000,
VLP_CKSYS_BASE = IO_PHYS + 0x0C016000,
PMIF_SPMI_P_BASE = IO_PHYS + 0x0C018000,

View file

@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#ifndef SOC_MEDIATEK_MT8196_MTK_VCORE
#define SOC_MEDIATEK_MT8196_MTK_VCORE
#define DVFSRC_RSRV_4 (DVFSRC_BASE + 0x290)
#define VCORE_B0_SHIFT 23
void dvfsrc_opp_level_mapping(void);
#endif