soc/mediatek: Rename mtk_wdt_preinit() to mtk_wdt_set_req()
To simplify the calling sequence for mtk_wdt_preinit() and we always adjust request setting in mtk_wdt_preinit(), we rename mtk_wdt_preinit() to mtk_wdt_set_req() and call it in mtk_wdt_init(). From this modification, we can also enable thermal hardware reset feature (CB:64676, CB:64675) in MT8192 and MT8195. BUG=none TEST=build pass Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com> Change-Id: I1904ff9387f7677a077068f2c3df923bd642ea3d Reviewed-on: https://review.coreboot.org/c/coreboot/+/64861 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
cdc1de7e92
commit
f0604afa02
|
@ -41,8 +41,8 @@ enum {
|
|||
|
||||
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);
|
||||
void mtk_wdt_set_req(void);
|
||||
|
||||
#endif /* SOC_MEDIATEK_COMMON_WDT_H */
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <vendorcode/google/chromeos/chromeos.h>
|
||||
|
||||
__weak void mtk_wdt_clr_status(void) { /* do nothing */ }
|
||||
__weak void mtk_wdt_set_req(void) { /* do nothing */ }
|
||||
|
||||
static inline void mtk_wdt_swreset(void)
|
||||
{
|
||||
|
@ -32,6 +33,8 @@ int mtk_wdt_init(void)
|
|||
{
|
||||
uint32_t wdt_sta;
|
||||
|
||||
mtk_wdt_set_req();
|
||||
|
||||
/* Writing mode register will clear status register */
|
||||
wdt_sta = read32(&mtk_wdt->wdt_status);
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ void bootblock_soc_init(void)
|
|||
{
|
||||
mtk_mmu_init();
|
||||
bustracker_init();
|
||||
mtk_wdt_preinit();
|
||||
mtk_wdt_init();
|
||||
mt_pll_init();
|
||||
unmask_eint_event_mask();
|
||||
|
|
|
@ -20,7 +20,7 @@ DEFINE_BIT(MTK_WDT_SPM_THERMAL_EN, 0)
|
|||
DEFINE_BIT(MTK_WDT_THERMAL_EN, 18)
|
||||
DEFINE_BIT(MTK_WDT_THERMAL_IRQ, 18)
|
||||
|
||||
void mtk_wdt_preinit(void)
|
||||
void mtk_wdt_set_req(void)
|
||||
{
|
||||
SET32_BITFIELDS(&mtk_wdt->wdt_req_mode,
|
||||
MTK_WDT_SPM_THERMAL_EN, 0,
|
||||
|
|
|
@ -12,7 +12,7 @@ DEFINE_BITFIELD(MTK_WDT_REQ_IRQ_KEY, 31, 24)
|
|||
DEFINE_BIT(MTK_WDT_THERMAL_EN, 18)
|
||||
DEFINE_BIT(MTK_WDT_THERMAL_IRQ, 18)
|
||||
|
||||
void mtk_wdt_preinit(void)
|
||||
void mtk_wdt_set_req(void)
|
||||
{
|
||||
SET32_BITFIELDS(&mtk_wdt->wdt_req_mode,
|
||||
MTK_WDT_THERMAL_EN, 1,
|
||||
|
|
|
@ -13,7 +13,7 @@ DEFINE_BITFIELD(MTK_WDT_REQ_IRQ_KEY, 31, 24)
|
|||
DEFINE_BIT(MTK_WDT_THERMAL_EN, 18)
|
||||
DEFINE_BIT(MTK_WDT_THERMAL_IRQ, 18)
|
||||
|
||||
void mtk_wdt_preinit(void)
|
||||
void mtk_wdt_set_req(void)
|
||||
{
|
||||
SET32_BITFIELDS(&mtk_wdt->wdt_req_mode,
|
||||
MTK_WDT_THERMAL_EN, 1,
|
||||
|
|
Loading…
Reference in New Issue