Debian Codegraph @

src/soc/mediatek/mt8189/wdt.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2
3 /*
4 * This file is created based on MT8189 Functional Specification
5 * Chapter number: 8.2
6 */
7
8 #include <device/mmio.h>
9 #include <soc/addressmap.h>
10 #include <soc/efuse.h>
11 #include <soc/wdt.h>
12
13 #define MTK_WDT_CLR_STATUS 0x230001FF
14 #define MTK_WDT_CLR_EFUSE_ECC_ERR 0x2300000A
15 #define MTK_WDT_STA_EFUSE_ECC_ERR BIT(23)
16
17 void mtk_wdt_clr_status(void)
18 {
19 write32(&mtk_wdt->wdt_mode, MTK_WDT_CLR_STATUS);
20 }
21
22 void mtk_wdt_clear_efuse_ecc(void)
23 {
24 if ((read32(&mtk_wdt->wdt_status) & MTK_WDT_STA_EFUSE_ECC_ERR) &&
25 !mtk_efuse_ecc_has_error())
26 write32(&mtk_wdt->wdt_mode, MTK_WDT_CLR_EFUSE_ECC_ERR);
27 }