From a7477706a096af540a5ee0ef04d0fca921fdab45 Mon Sep 17 00:00:00 2001 From: Zhiyong Tao Date: Thu, 24 Mar 2022 18:57:44 +0800 Subject: soc/mediatek/mt8186: Fix pmif setting for low power mode The current pmif register setting for low power mode is incorrect, which is causing suspend failure. The issue of suspend failure is that SRCLKENA0 will not be pulled down. EC will not be informed AP is suspending now becuase of this. Therefore, add pmif_spmi_set_lp_mode() to correct the setting. This implementation is based on chapter 3.7 in MT8186 Functional Specification. BUG=b:215639203 TEST=test of suspend and resume pass. Signed-off-by: Zhiyong Tao Change-Id: I2d02198f19f9cb052fba612c02404a6af1a10adb Reviewed-on: https://review.coreboot.org/c/coreboot/+/63089 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu Reviewed-by: Paul Menzel --- src/soc/mediatek/mt8186/include/soc/addressmap.h | 1 + src/soc/mediatek/mt8186/include/soc/pmif.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/soc/mediatek/mt8186/include/soc/pmif.h (limited to 'src/soc/mediatek/mt8186/include') diff --git a/src/soc/mediatek/mt8186/include/soc/addressmap.h b/src/soc/mediatek/mt8186/include/soc/addressmap.h index c90e0cda79..069e31d412 100644 --- a/src/soc/mediatek/mt8186/include/soc/addressmap.h +++ b/src/soc/mediatek/mt8186/include/soc/addressmap.h @@ -30,6 +30,7 @@ enum { PWRAP_BASE = IO_PHYS + 0x0000D000, DEVAPC_AO_INFRA_PERI_BASE = IO_PHYS + 0x0000E000, DEVAPC_AO_MM_BASE = IO_PHYS + 0x0000F000, + PMIF_BASE = IO_PHYS + 0x00015000, SYSTIMER_BASE = IO_PHYS + 0x00017000, I2C0_DMA_BASE = IO_PHYS + 0x00200100, I2C1_DMA_BASE = IO_PHYS + 0x00200200, diff --git a/src/soc/mediatek/mt8186/include/soc/pmif.h b/src/soc/mediatek/mt8186/include/soc/pmif.h new file mode 100644 index 0000000000..0e1e1a276d --- /dev/null +++ b/src/soc/mediatek/mt8186/include/soc/pmif.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* + * This file is created based on MT8186 Functional Specification + * Chapter number: 3.7 + */ + +#ifndef __SOC_MEDIATEK_MT8186_PMIF_H__ +#define __SOC_MEDIATEK_MT8186_PMIF_H__ + +#include +#include + +void pmif_spmi_set_lp_mode(void); + +#endif /*__SOC_MEDIATEK_MT8186_PMIF_H__*/ -- cgit v1.2.3