diff --git a/core/embed/sys/power_manager/stm32u5/power_states.c b/core/embed/sys/power_manager/stm32u5/power_states.c index 658e5deb90..c2f9c3338c 100644 --- a/core/embed/sys/power_manager/stm32u5/power_states.c +++ b/core/embed/sys/power_manager/stm32u5/power_states.c @@ -238,7 +238,7 @@ void pm_enter_hibernate(pm_driver_t* drv) { // Store power manager data with request to hibernate, power manager // will try to hibernate immediately after reboot. pm_store_data_to_backup_ram(); - reboot_device(); + reboot_to_off(); } void pm_enter_charging(pm_driver_t* drv) {} diff --git a/core/embed/sys/startup/inc/sys/bootargs.h b/core/embed/sys/startup/inc/sys/bootargs.h index 051040404c..f80e717de2 100644 --- a/core/embed/sys/startup/inc/sys/bootargs.h +++ b/core/embed/sys/startup/inc/sys/bootargs.h @@ -33,6 +33,8 @@ typedef enum { BOOT_COMMAND_INSTALL_UPGRADE = 0xFA4A5C8D, // Show RSOD and wait for user input BOOT_COMMAND_SHOW_RSOD = 0x7CD945A0, + // Reboot the device as if it was powered on + BOOT_COMMAND_REBOOT = 0xA5C3D4E2, } boot_command_t; // Maximum size boot_args array diff --git a/core/embed/sys/startup/inc/sys/bootutils.h b/core/embed/sys/startup/inc/sys/bootutils.h index a32abe1ad4..5fc0423e57 100644 --- a/core/embed/sys/startup/inc/sys/bootutils.h +++ b/core/embed/sys/startup/inc/sys/bootutils.h @@ -22,9 +22,13 @@ #include -// Immediately resets the device and initiates the normal boot sequence. +// Immediately resets the device and initiates the normal boot sequence as if +// the device was powered on void __attribute__((noreturn)) reboot_device(void); +// Immediately resets the device +void __attribute__((noreturn)) reboot_to_off(void); + // Resets the device and enters the bootloader, // halting there and waiting for further user instructions. void __attribute__((noreturn)) reboot_to_bootloader(void); diff --git a/core/embed/sys/startup/stm32/bootutils.c b/core/embed/sys/startup/stm32/bootutils.c index 90525d6569..7859c6a602 100644 --- a/core/embed/sys/startup/stm32/bootutils.c +++ b/core/embed/sys/startup/stm32/bootutils.c @@ -213,6 +213,10 @@ __attribute__((noreturn)) void reboot_and_upgrade(const uint8_t hash[32]) { } __attribute__((noreturn)) void reboot_device(void) { + reboot_with_args(BOOT_COMMAND_REBOOT, NULL, 0); +} + +__attribute__((noreturn)) void reboot_to_off(void) { reboot_with_args(BOOT_COMMAND_NONE, NULL, 0); } diff --git a/core/embed/sys/startup/unix/bootutils.c b/core/embed/sys/startup/unix/bootutils.c index 347335ce25..a3b3d1cd98 100644 --- a/core/embed/sys/startup/unix/bootutils.c +++ b/core/embed/sys/startup/unix/bootutils.c @@ -61,6 +61,12 @@ __attribute__((noreturn)) void reboot_device(void) { exit(3); } +__attribute__((noreturn)) void reboot_to_off(void) { + printf("reboot (power off)\n"); + + exit(3); +} + __attribute__((noreturn)) void reboot_or_halt_after_rsod(void) { printf("reboot (with timeout)\n");