soc: arm: nordic: Deprecate reboot type in GPREGRET

Deprecates setting GPREGRET to the reset reason as this has been
replaced with the boot mode retention subsystem for nRF51/nRF52.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2023-02-27 10:54:33 +00:00 committed by Carles Cufí
commit f79a08d6c0
3 changed files with 25 additions and 2 deletions

View file

@ -136,4 +136,17 @@ config NRF_TRACE_PORT
Unit) for tracing using a hardware probe. If disabled, the trace
pins will be used as GPIO.
config NRF_STORE_REBOOT_TYPE_GPREGRET
bool "Set GPREGRET to reboot type (DEPRECATED)"
depends on SOC_SERIES_NRF51X || SOC_SERIES_NRF52X
depends on REBOOT
depends on !RETENTION_BOOT_MODE
select DEPRECATED
help
If this option is enabled, then the parameter supplied to the
sys_reboot() function will be set in the GPREGRET register.
This has been replaced with the bootmode part of the retention
subsystem, which should be used instead.
endif # SOC_FAMILY_NRF

View file

@ -23,13 +23,18 @@
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
LOG_MODULE_REGISTER(soc);
#ifdef CONFIG_NRF_STORE_REBOOT_TYPE_GPREGRET
/* Overrides the weak ARM implementation:
Set general purpose retention register and reboot */
* Set general purpose retention register and reboot
* This is deprecated and has been replaced with the boot mode retention
* subsystem
*/
void sys_arch_reboot(int type)
{
nrf_power_gpregret_set(NRF_POWER, (uint8_t)type);
NVIC_SystemReset();
}
#endif
static int nordicsemi_nrf51_init(void)
{

View file

@ -23,13 +23,18 @@
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
LOG_MODULE_REGISTER(soc);
#ifdef CONFIG_NRF_STORE_REBOOT_TYPE_GPREGRET
/* Overrides the weak ARM implementation:
Set general purpose retention register and reboot */
* Set general purpose retention register and reboot
* This is deprecated and has been replaced with the boot mode retention
* subsystem
*/
void sys_arch_reboot(int type)
{
nrf_power_gpregret_set(NRF_POWER, (uint8_t)type);
NVIC_SystemReset();
}
#endif
static int nordicsemi_nrf52_init(void)
{