Move watchdog reset higher

This commit is contained in:
Jeremy Soller 2020-01-21 14:49:27 -07:00
parent 1b5dc21552
commit a3aff2083a
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 12 additions and 9 deletions

View File

@ -81,6 +81,10 @@ void pmc_event(struct Pmc * pmc) {
state = PMC_STATE_ACPI_WRITE; state = PMC_STATE_ACPI_WRITE;
break; break;
case 0xEC: case 0xEC:
printf_tiny("RESET\n");
// Attempt to trigger watchdog reset
ETWCFG |= (1 << 5);
EWDKEYR = 0;
// Clear processor caches // Clear processor caches
__asm__("mov 0xf7, #1"); __asm__("mov 0xf7, #1");
__asm__("nop"); __asm__("nop");
@ -90,9 +94,6 @@ void pmc_event(struct Pmc * pmc) {
__asm__("nop"); __asm__("nop");
__asm__("mov 0xf7, #1"); __asm__("mov 0xf7, #1");
__asm__("nop"); __asm__("nop");
// Attempt to trigger watchdog reset
ETWCFG |= (1 << 5);
EWDKEYR = 0;
// Exit scratch ROM by going through trampoline // Exit scratch ROM by going through trampoline
__asm__("ljmp 0x1000"); __asm__("ljmp 0x1000");
break; break;

View File

@ -81,6 +81,10 @@ void pmc_event(struct Pmc * pmc) {
state = PMC_STATE_ACPI_WRITE; state = PMC_STATE_ACPI_WRITE;
break; break;
case 0xEC: case 0xEC:
printf_tiny("RESET\n");
// Attempt to trigger watchdog reset
ETWCFG |= (1 << 5);
EWDKEYR = 0;
// Clear processor caches // Clear processor caches
__asm__("mov 0xf7, #1"); __asm__("mov 0xf7, #1");
__asm__("nop"); __asm__("nop");
@ -90,9 +94,6 @@ void pmc_event(struct Pmc * pmc) {
__asm__("nop"); __asm__("nop");
__asm__("mov 0xf7, #1"); __asm__("mov 0xf7, #1");
__asm__("nop"); __asm__("nop");
// Attempt to trigger watchdog reset
ETWCFG |= (1 << 5);
EWDKEYR = 0;
// Exit scratch ROM by going through trampoline // Exit scratch ROM by going through trampoline
__asm__("ljmp 0x1000"); __asm__("ljmp 0x1000");
break; break;

View File

@ -81,6 +81,10 @@ void pmc_event(struct Pmc * pmc) {
state = PMC_STATE_ACPI_WRITE; state = PMC_STATE_ACPI_WRITE;
break; break;
case 0xEC: case 0xEC:
printf_tiny("RESET\n");
// Attempt to trigger watchdog reset
ETWCFG |= (1 << 5);
EWDKEYR = 0;
// Clear processor caches // Clear processor caches
__asm__("mov 0xf7, #1"); __asm__("mov 0xf7, #1");
__asm__("nop"); __asm__("nop");
@ -90,9 +94,6 @@ void pmc_event(struct Pmc * pmc) {
__asm__("nop"); __asm__("nop");
__asm__("mov 0xf7, #1"); __asm__("mov 0xf7, #1");
__asm__("nop"); __asm__("nop");
// Attempt to trigger watchdog reset
ETWCFG |= (1 << 5);
EWDKEYR = 0;
// Exit scratch ROM by going through trampoline // Exit scratch ROM by going through trampoline
__asm__("ljmp 0x1000"); __asm__("ljmp 0x1000");
break; break;