Rex-BC Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62890 )
Change subject: soc/mediatek/mt8186: Disable spm_thermal which is not used ......................................................................
soc/mediatek/mt8186: Disable spm_thermal which is not used
In MT8186, we need to disable spm_thermal to prevent it to influence other wdt status. For hardware path from thermal to wdt, there is another path directly from thermal to wdt. This bit is a flexibility for software control, and the hardware designer suggests that we can disable it if we don't use it.
BUG=none TEST=build pass
Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Change-Id: I0ffde6bad3000a64e3b5782edaa72c62da034302 --- M src/soc/mediatek/common/include/soc/wdt.h M src/soc/mediatek/mt8186/bootblock.c M src/soc/mediatek/mt8186/wdt.c 3 files changed, 13 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/62890/1
diff --git a/src/soc/mediatek/common/include/soc/wdt.h b/src/soc/mediatek/common/include/soc/wdt.h index cd43134..157bed3 100644 --- a/src/soc/mediatek/common/include/soc/wdt.h +++ b/src/soc/mediatek/common/include/soc/wdt.h @@ -14,9 +14,12 @@ u32 wdt_interval; u32 wdt_swrst; u32 wdt_swsysrst; - u32 reserved[9]; + u32 reserved0[5]; + u32 wdt_req_mode; + u32 reserved1[3]; u32 wdt_debug_ctrl; }; +check_member(mtk_wdt_regs, wdt_debug_ctrl, 0x40);
/* WDT_MODE */ enum { @@ -38,6 +41,7 @@
static struct mtk_wdt_regs *const mtk_wdt = (void *)RGU_BASE;
+void mtk_wdt_preinit(void); int mtk_wdt_init(void); void mtk_wdt_clr_status(void);
diff --git a/src/soc/mediatek/mt8186/bootblock.c b/src/soc/mediatek/mt8186/bootblock.c index e5d1e73..29de7fb 100644 --- a/src/soc/mediatek/mt8186/bootblock.c +++ b/src/soc/mediatek/mt8186/bootblock.c @@ -12,6 +12,7 @@ { mtk_mmu_init(); bustracker_init(); + mtk_wdt_preinit(); mtk_wdt_init(); mt_pll_init(); unmask_eint_event_mask(); diff --git a/src/soc/mediatek/mt8186/wdt.c b/src/soc/mediatek/mt8186/wdt.c index fbc9bb9..ff93129 100644 --- a/src/soc/mediatek/mt8186/wdt.c +++ b/src/soc/mediatek/mt8186/wdt.c @@ -10,9 +10,16 @@ #include <soc/wdt.h>
#define MTK_WDT_CLR_STATUS_VAL 0x22 +#define MTK_WDT_REQ_MOD_KEY 0x33000000 +#define MTK_WDT_SPM_THERMAL_EN BIT(0)
DEFINE_BITFIELD(MTK_WDT_CLR_STATUS, 31, 24)
+void mtk_wdt_preinit(void) +{ + clrsetbits32(&mtk_wdt->wdt_req_mode, MTK_WDT_SPM_THERMAL_EN, MTK_WDT_REQ_MOD_KEY); +} + void mtk_wdt_clr_status(void) { SET32_BITFIELDS(&mtk_wdt->wdt_mode,