/** * booke_wdt_disable - disable the watchdog on the given CPU * * This function is called on each CPU. It disables the watchdog on that CPU. * * TCR[WRC] cannot be changed once it has been set to non-zero, but we can * effectively disable the watchdog by setting its period to the maximum value. */ static void __booke_wdt_disable(void *data) { u32 val; val = mfspr(SPRN_TCR); val &= ~(TCR_WIE | WDTP_MASK); mtspr(SPRN_TCR, val); /* clear status to make sure nothing is pending */ __booke_wdt_ping(NULL); }
static void __booke_wdt_enable(void *data) { u32 val; /* clear status before enabling watchdog */ __booke_wdt_ping(NULL); val = mfspr(SPRN_TCR); val &= ~WDTP_MASK; val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); mtspr(SPRN_TCR, val); }
static void __booke_wdt_enable(void *data) { u32 val; /* clear status before enabling watchdog */ __booke_wdt_ping(NULL); val = mfspr(SPRN_TCR); val &= ~WDTP_MASK; val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); #ifdef CONFIG_PPC_BOOK3E_64 /* * Crit ints are currently broken on PPC64 Book-E, so * just disable them for now. */ val &= ~TCR_WIE; #endif mtspr(SPRN_TCR, val); }