From 29cad5a59e5f27088e113e6c068967a9da60ce92 Mon Sep 17 00:00:00 2001 From: Rex-BC Chen Date: Thu, 31 Mar 2022 14:46:12 +0800 Subject: soc/mediatek/mt8186: Disable unused power To save the power consumption, we disable the unused power of optional components in coreboot. BUG=none TEST=the value of power consumption is as expected. Signed-off-by: Rex-BC Chen Change-Id: Ic0c7c2d1b6a4c26980a3029b60051ab1406406ea Reviewed-on: https://review.coreboot.org/c/coreboot/+/63247 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/mt8186/include/soc/spm.h | 1 + src/soc/mediatek/mt8186/spm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/soc/mediatek/mt8186/include/soc/spm.h b/src/soc/mediatek/mt8186/include/soc/spm.h index 18a97445fa..56e1c7aea9 100644 --- a/src/soc/mediatek/mt8186/include/soc/spm.h +++ b/src/soc/mediatek/mt8186/include/soc/spm.h @@ -836,6 +836,7 @@ struct pwr_ctrl { check_member(mtk_spm_regs, poweron_config_set, 0x0); check_member(mtk_spm_regs, dis_pwr_con, 0x354); +check_member(mtk_spm_regs, nna_pwr_con, 0x3E0); check_member(mtk_spm_regs, ap_mdsrc_req, 0x430); check_member(mtk_spm_regs, ssusb_top_pwr_con, 0x9F0); check_member(mtk_spm_regs, ssusb_top_p1_pwr_con, 0x9F4); diff --git a/src/soc/mediatek/mt8186/spm.c b/src/soc/mediatek/mt8186/spm.c index a1186ca477..30d56ff1a3 100644 --- a/src/soc/mediatek/mt8186/spm.c +++ b/src/soc/mediatek/mt8186/spm.c @@ -362,6 +362,9 @@ static void spm_set_power_control(const struct pwr_ctrl *pwrctrl) ((pwrctrl->reg_dpmaif_vrf18_req_mask_b & 0x1) << 8) | ((pwrctrl->reg_dpmaif_ddren_req_mask_b & 0x1) << 9)); /* Auto-gen End */ + + /* Disable unused optional components */ + write32(&mtk_spm->nna_pwr_con, BIT(1) | BIT(4) | BIT(8)); } static void spm_hw_s1_state_monitor(int en) -- cgit v1.2.3