fusee: do PMC reboots, not CAR reboots.

This commit is contained in:
Michael Scire 2018-11-30 06:34:20 -08:00
parent be5b58d033
commit 33b7e227d4
4 changed files with 2 additions and 22 deletions

View file

@ -59,21 +59,12 @@ __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0) {
} }
} }
__attribute__((noreturn)) void car_reboot(void) {
/* Reset the processor. */
car_get_regs()->rst_dev_l |= 1<<2;
while (true) {
/* Wait for reboot. */
}
}
__attribute__((noreturn)) void wait_for_button_and_reboot(void) { __attribute__((noreturn)) void wait_for_button_and_reboot(void) {
uint32_t button; uint32_t button;
while (true) { while (true) {
button = btn_read(); button = btn_read();
if (button & BTN_POWER) { if (button & BTN_POWER) {
car_reboot(); pmc_reboot(1 << 1);
} }
} }
} }

View file

@ -121,7 +121,6 @@ void hexdump(const void* data, size_t size, uintptr_t addrbase);
__attribute__((noreturn)) void watchdog_reboot(void); __attribute__((noreturn)) void watchdog_reboot(void);
__attribute__((noreturn)) void pmc_reboot(uint32_t scratch0); __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0);
__attribute__((noreturn)) void car_reboot(void);
__attribute__((noreturn)) void wait_for_button_and_reboot(void); __attribute__((noreturn)) void wait_for_button_and_reboot(void);
__attribute__((noreturn)) void generic_panic(void); __attribute__((noreturn)) void generic_panic(void);

View file

@ -58,21 +58,12 @@ __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0) {
} }
} }
__attribute__((noreturn)) void car_reboot(void) {
/* Reset the processor. */
car_get_regs()->rst_dev_l |= 1<<2;
while (true) {
/* Wait for reboot. */
}
}
__attribute__((noreturn)) void wait_for_button_and_reboot(void) { __attribute__((noreturn)) void wait_for_button_and_reboot(void) {
uint32_t button; uint32_t button;
while (true) { while (true) {
button = btn_read(); button = btn_read();
if (button & BTN_POWER) { if (button & BTN_POWER) {
car_reboot(); pmc_reboot(1 << 1);
} }
} }
} }

View file

@ -122,7 +122,6 @@ void hexdump(const void* data, size_t size, uintptr_t addrbase);
__attribute__((noreturn)) void watchdog_reboot(void); __attribute__((noreturn)) void watchdog_reboot(void);
__attribute__((noreturn)) void pmc_reboot(uint32_t scratch0); __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0);
__attribute__((noreturn)) void car_reboot(void);
__attribute__((noreturn)) void wait_for_button_and_reboot(void); __attribute__((noreturn)) void wait_for_button_and_reboot(void);
void wait_for_button(void); void wait_for_button(void);