From f21969acb25b0587ded2a859c31c539fe65a12e4 Mon Sep 17 00:00:00 2001 From: Lu Tang Date: Tue, 11 Feb 2025 17:36:52 +0800 Subject: [PATCH] soc/mediatek/mt8196: Set MT6316 deglitch time from 2ns to 4ns To fix the SPMI-P glitch, set the mt6316 deglitch time from 2ns to 4ns. Additionally, a hardware solution of SPMI damping to 0 ohm is needed. BRANCH=rauru TEST=Build passed and booted successfully. 10 platforms have passed CPU stress tests over multiple iterations. BUG=b:386438329 Signed-off-by: Lu Tang Change-Id: I77bd50cc6c25d6dcded57d9d65d92a0dd19c3c86 Reviewed-on: https://review.coreboot.org/c/coreboot/+/86371 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu Reviewed-by: Knox Chiou Reviewed-by: Yidi Lin --- src/soc/mediatek/common/include/soc/mt6316.h | 1 + src/soc/mediatek/common/mt6316.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/soc/mediatek/common/include/soc/mt6316.h b/src/soc/mediatek/common/include/soc/mt6316.h index 920cb34af9..ce955f94e3 100644 --- a/src/soc/mediatek/common/include/soc/mt6316.h +++ b/src/soc/mediatek/common/include/soc/mt6316.h @@ -29,6 +29,7 @@ enum { MT6316_PMIC_TEST_CON9 = 0x222, MT6316_PMIC_PLT_DIG_WPK = 0x3B1, MT6316_PMIC_PLT_DIG_WPK_H = 0x3B2, + MT6316_PMIC_SPMI_RSV1 = 0x43A, MT6316_BUCK_TOP_ELR0 = 0x1448, MT6316_BUCK_TOP_ELR1 = 0x1449, MT6316_BUCK_TOP_ELR2 = 0x144A, diff --git a/src/soc/mediatek/common/mt6316.c b/src/soc/mediatek/common/mt6316.c index 89c8c83cb0..9ed5d29c21 100644 --- a/src/soc/mediatek/common/mt6316.c +++ b/src/soc/mediatek/common/mt6316.c @@ -169,6 +169,14 @@ static void mt6316_set_all_test_con9(void) mt6316_write8(mt6316_slave_id[i], MT6316_PMIC_TEST_CON9, 0x20); } +static void mt6316_set_all_deglitch(void) +{ + /* Set deglitch time from 2ns to 4ns */ + for (int i = 0; i < ARRAY_SIZE(mt6316_slave_id); i++) + mt6316_write_field(mt6316_slave_id[i], + MT6316_PMIC_SPMI_RSV1, 0x0A, 0xFF, 0); +} + static void init_pmif_arb(void) { if (pmif_arb) @@ -196,4 +204,5 @@ void mt6316_init(void) mt6316_init_setting(); mt6316_set_all_test_con9(); + mt6316_set_all_deglitch(); }