From b9a1e6453864309bffeb9a096d9142c04da47f53 Mon Sep 17 00:00:00 2001 From: Jarried Lin Date: Thu, 16 Jan 2025 16:56:38 +0800 Subject: [PATCH] soc/mediatek/common: Fix wrong write API for protect_key_setting Fix the issue where the DUT cannot power on during S5. When writing key_protect_setting to PMIC, PMIC expects receiving 1 byte per write. PMIC would receive unexpected zero byte if using mt6363_write16. Fix the write operation by using mt6363_write8. TEST=Build pass, DUT can power on during S5. BUG=b:388666377 Change-Id: I0a7c0d2fa1f93a55731b4b58923d6f80a4c4be89 Signed-off-by: Jarried Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/86034 Reviewed-by: Yidi Lin Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/common/mt6363.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/soc/mediatek/common/mt6363.c b/src/soc/mediatek/common/mt6363.c index 220a7ce729..e675ef2c9c 100644 --- a/src/soc/mediatek/common/mt6363.c +++ b/src/soc/mediatek/common/mt6363.c @@ -50,12 +50,6 @@ void mt6363_write8(u32 reg, u8 data) pmif_arb->write(pmif_arb, SPMI_SLAVE_4, reg, data); } -static void mt6363_write16(u32 reg, u16 data) -{ - assert(pmif_arb); - pmif_arb->write16(pmif_arb, SPMI_SLAVE_4, reg, data); -} - static u32 mt6363_read_field(u32 reg, u32 mask, u32 shift) { assert(pmif_arb); @@ -101,7 +95,7 @@ static void pmic_protect_key_setting(bool lock) for (int i = 0; i < ARRAY_SIZE(key_protect_setting); i++) { entry = &key_protect_setting[i]; - mt6363_write16(entry->addr, lock ? 0 : entry->val); + mt6363_write8(entry->addr, lock ? 0 : entry->val); } printk(BIOS_INFO, "%s done\n", __func__); }