Debian Codegraph @

src/mainboard/google/storm/reset.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <console/console.h>
4 #include <device/mmio.h>
5 #include <soc/iomap.h>
6 #include <reset.h>
7
8 /* Watchdog bite time set to default reset value */
9 #define RESET_WDT_BITE_TIME 0x31F3
10
11 /* Watchdog bark time value is kept larger than the watchdog timeout
12 * of 0x31F3, effectively disabling the watchdog bark interrupt
13 */
14 #define RESET_WDT_BARK_TIME (5 * RESET_WDT_BITE_TIME)
15
16 static void wdog_reset(void)
17 {
18 printk(BIOS_DEBUG, "\nResetting with watchdog!\n");
19
20 write32(APCS_WDT0_EN, 0);
21 write32(APCS_WDT0_RST, 1);
22 write32(APCS_WDT0_BARK_TIME, RESET_WDT_BARK_TIME);
23 write32(APCS_WDT0_BITE_TIME, RESET_WDT_BITE_TIME);
24 write32(APCS_WDT0_EN, 1);
25 write32(APCS_WDT0_CPU0_WDOG_EXPIRED_ENABLE, 1);
26 }
27
28 void do_board_reset(void)
29 {
30 wdog_reset();
31 }