static void msm_power_off(void) { printk(KERN_NOTICE "Powering off the SoC\n"); pm8058_reset_pwr_off(0); writel(0, PSHOLD_CTL_SU); mdelay(10000); printk(KERN_ERR "Powering off has failed\n"); return; }
void shutdown_device() { gpio_config_pshold(); pm8058_reset_pwr_off(0); pm8901_reset_pwr_off(0); writel(0, MSM_PSHOLD_CTL_SU); mdelay(10000); dprintf(CRITICAL, "Shutdown failed\n"); }
void reboot_device(uint32_t reboot_reason) { /* TBD - set download mode? */ pm8058_reset_pwr_off(1); writel(reboot_reason, RESTART_REASON_ADDR); dmb(); writel(0, MSM_WDT0_EN); writel(0, PSHOLD_CTL_SU); mdelay(5000); writel(0x31F3, MSM_WDT0_BARK_TIME); writel(0x31F3, MSM_WDT0_BITE_TIME); writel(3, MSM_WDT0_EN); dmb(); secure_writel(3, MSM_TCSR_WDOG_CFG); mdelay(10000); dprintf(CRITICAL, "Shutdown failed\n"); }