int board_late_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; #ifdef CONFIG_SERIAL_TAG struct tag_serialnr serialnr; char serial_string[0x20]; #endif imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads)); set_wdog_reset(wdog); /* * Do not assert internal WDOG_RESET_B_DEB(controlled by bit 4), * since we use PMIC_PWRON to reset the board. */ clrsetbits_le16(&wdog->wcr, 0, 0x10); #ifdef CONFIG_SERIAL_TAG /* Set serial# standard environment variable based on OTP settings */ get_board_serial(&serialnr); snprintf(serial_string, sizeof(serial_string), "WaRP7-0x%08x%08x", serialnr.low, serialnr.high); env_set("serial#", serial_string); #endif return 0; }
/* * cl_som_imx7_setup_wdog() - watchdog configuration. * - Output WDOG_B signal to reset external pmic. * - Suspend the watchdog timer during low-power modes. */ void cl_som_imx7_setup_wdog(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; cl_som_imx7_wdog_pads_set(); set_wdog_reset(wdog); /* * Do not assert internal WDOG_RESET_B_DEB(controlled by bit 4), * since we use PMIC_PWRON to reset the board. */ clrsetbits_le16(&wdog->wcr, 0, 0x10); }
void __attribute__((weak)) reset_cpu(ulong addr) { struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE); writew(0x5555, &wdog->wsr); writew(0xaaaa, &wdog->wsr); /* load minimum 1/2 second timeout */ while (1) { /* * spin for .5 seconds before reset */ } }
int board_late_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; #ifdef CONFIG_ENV_IS_IN_MMC mmc_late_init(); #endif imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads)); set_wdog_reset(wdog); /* * Do not assert internal WDOG_RESET_B_DEB(controlled by bit 4), * since we use PMIC_PWRON to reset the board. */ clrsetbits_le16(&wdog->wcr, 0, 0x10); return 0; }