Jarried Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86069?usp=email )
Change subject: soc/mediatek/mt8196: Fix issue with incomplete modem disable ......................................................................
soc/mediatek/mt8196: Fix issue with incomplete modem disable
If the modem is not completely disabled, it will cause issues with suspend to RAM. Update the condition check in MD1_PWR_STA and increased the MAX_RETRY_COUNT from 200 to 4000 to make sure that the modem has sufficient time to completely disable before proceeding.
TEST=Measure the power and ensure that the DRAM enters self-refresh mode. BUG=b:377628718
Change-Id: I6e915d26e5b3caee36f4726bc2fc1c53cfc17bfc Signed-off-by: Jarried Lin jarried.lin@mediatek.corp-partner.google.com --- M src/soc/mediatek/mt8196/modem_power_ctrl.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/86069/1
diff --git a/src/soc/mediatek/mt8196/modem_power_ctrl.c b/src/soc/mediatek/mt8196/modem_power_ctrl.c index 0fc4653..f849efd 100644 --- a/src/soc/mediatek/mt8196/modem_power_ctrl.c +++ b/src/soc/mediatek/mt8196/modem_power_ctrl.c @@ -10,7 +10,7 @@ #include <soc/spmi.h>
#define SPMI_SLAVE_4_750MV 0x78 -#define MAX_RETRY_COUNT 200 +#define MAX_RETRY_COUNT 4000 #define VSRAM_VOSEL 0x24d #define VMODEM_VOSEL 0x24e #define MD1_PWR_STA_MASK BIT(0) @@ -74,7 +74,7 @@
clrbits32(&mtk_spm->md1_pwr_con, PWR_ON); if (!retry(MAX_RETRY_COUNT, - read32(&mtk_spm->pwr_status) & MD1_PWR_STA_MASK)) { + (read32(&mtk_spm->pwr_status) & MD1_PWR_STA_MASK) == 0)) { printk(BIOS_ERR, "Check MD1_PWR_STA failed\n"); }