From 33b7e227d48323056205bfc77c048274f73e722f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 30 Nov 2018 06:34:20 -0800 Subject: [PATCH] fusee: do PMC reboots, not CAR reboots. --- fusee/fusee-primary/src/utils.c | 11 +---------- fusee/fusee-primary/src/utils.h | 1 - fusee/fusee-secondary/src/utils.c | 11 +---------- fusee/fusee-secondary/src/utils.h | 1 - 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/fusee/fusee-primary/src/utils.c b/fusee/fusee-primary/src/utils.c index 87e84e793..26e838130 100644 --- a/fusee/fusee-primary/src/utils.c +++ b/fusee/fusee-primary/src/utils.c @@ -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) { uint32_t button; while (true) { button = btn_read(); if (button & BTN_POWER) { - car_reboot(); + pmc_reboot(1 << 1); } } } diff --git a/fusee/fusee-primary/src/utils.h b/fusee/fusee-primary/src/utils.h index 7fe8e6cb8..23893e930 100644 --- a/fusee/fusee-primary/src/utils.h +++ b/fusee/fusee-primary/src/utils.h @@ -121,7 +121,6 @@ void hexdump(const void* data, size_t size, uintptr_t addrbase); __attribute__((noreturn)) void watchdog_reboot(void); __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 generic_panic(void); diff --git a/fusee/fusee-secondary/src/utils.c b/fusee/fusee-secondary/src/utils.c index b74e0163d..ed7636a89 100644 --- a/fusee/fusee-secondary/src/utils.c +++ b/fusee/fusee-secondary/src/utils.c @@ -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) { uint32_t button; while (true) { button = btn_read(); if (button & BTN_POWER) { - car_reboot(); + pmc_reboot(1 << 1); } } } diff --git a/fusee/fusee-secondary/src/utils.h b/fusee/fusee-secondary/src/utils.h index 3d84a563d..6b26428ce 100644 --- a/fusee/fusee-secondary/src/utils.h +++ b/fusee/fusee-secondary/src/utils.h @@ -122,7 +122,6 @@ void hexdump(const void* data, size_t size, uintptr_t addrbase); __attribute__((noreturn)) void watchdog_reboot(void); __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0); -__attribute__((noreturn)) void car_reboot(void); __attribute__((noreturn)) void wait_for_button_and_reboot(void); void wait_for_button(void);