diff --git a/arch/risc-v/src/espressif/Make.defs b/arch/risc-v/src/espressif/Make.defs index 06cefa545a2..0fb199febbf 100644 --- a/arch/risc-v/src/espressif/Make.defs +++ b/arch/risc-v/src/espressif/Make.defs @@ -36,7 +36,7 @@ CHIP_ASRCS = esp_vectors.S CHIP_CSRCS = esp_allocateheap.c esp_start.c esp_idle.c CHIP_CSRCS += esp_irq.c esp_gpio.c esp_libc_stubs.c CHIP_CSRCS += esp_lowputc.c esp_serial.c -CHIP_CSRCS += esp_timerisr.c +CHIP_CSRCS += esp_timerisr.c esp_systemreset.c ifeq ($(CONFIG_WATCHDOG),y) CHIP_CSRCS += esp_wdt.c @@ -49,7 +49,7 @@ endif # Fetch source files and add them to build ESP_HAL_3RDPARTY_UNPACK = esp-hal-3rdparty -ESP_HAL_3RDPARTY_ID = nuttx-20230324 +ESP_HAL_3RDPARTY_ID = nuttx-20230330 ESP_HAL_3RDPARTY_ZIP = $(ESP_HAL_3RDPARTY_ID).zip ESP_HAL_3RDPARTY_URL = https://github.com/espressif/esp-hal-3rdparty/archive diff --git a/arch/risc-v/src/espressif/esp_systemreset.c b/arch/risc-v/src/espressif/esp_systemreset.c new file mode 100644 index 00000000000..f515e592b80 --- /dev/null +++ b/arch/risc-v/src/espressif/esp_systemreset.c @@ -0,0 +1,158 @@ +/**************************************************************************** + * arch/risc-v/src/espressif/esp_systemreset.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "esp_systemreset.h" + +#include "esp_private/system_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define SHUTDOWN_HANDLERS_NO 4 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static shutdown_handler_t shutdown_handlers[SHUTDOWN_HANDLERS_NO]; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: esp_register_shutdown_handler + * + * Description: + * This function allows you to register a handler that gets invoked before + * the application is restarted. + * + * Input Parameters: + * handler - Function to execute on restart. + * + * Returned Value: + * OK on success (positive non-zero values are cmd-specific). + * Negated errno returned on failure. + * + ****************************************************************************/ + +int esp_register_shutdown_handler(shutdown_handler_t handler) +{ + for (int i = 0; i < SHUTDOWN_HANDLERS_NO; i++) + { + if (shutdown_handlers[i] == handler) + { + return -EEXIST; + } + else if (shutdown_handlers[i] == NULL) + { + shutdown_handlers[i] = handler; + return OK; + } + } + + return -ENOMEM; +} + +/**************************************************************************** + * Name: esp_unregister_shutdown_handler + * + * Description: + * This function allows you to unregister a handler which was previously + * registered using esp_register_shutdown_handler function. + * + * Input Parameters: + * handler - Function to execute on restart. + * + * Returned Value: + * OK on success (positive non-zero values are cmd-specific). + * Negated errno returned on failure. + * + ****************************************************************************/ + +int esp_unregister_shutdown_handler(shutdown_handler_t handler) +{ + for (int i = 0; i < SHUTDOWN_HANDLERS_NO; i++) + { + if (shutdown_handlers[i] == handler) + { + shutdown_handlers[i] = NULL; + return OK; + } + } + + return -EINVAL; +} + +/**************************************************************************** + * Name: up_shutdown_handler + * + * Description: + * Process all registered shutdown callback functions. + * + * Input Parameters: + * None. + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void up_shutdown_handler(void) +{ + for (int i = SHUTDOWN_HANDLERS_NO - 1; i >= 0; i--) + { + if (shutdown_handlers[i]) + { + shutdown_handlers[i](); + } + } +} + +/**************************************************************************** + * Name: up_systemreset + * + * Description: + * Internal reset logic. + * + * Input Parameters: + * None. + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void up_systemreset(void) +{ + esp_restart_noos(); +} diff --git a/arch/risc-v/src/espressif/esp_systemreset.h b/arch/risc-v/src/espressif/esp_systemreset.h new file mode 100644 index 00000000000..bf8ea3d58b1 --- /dev/null +++ b/arch/risc-v/src/espressif/esp_systemreset.h @@ -0,0 +1,111 @@ +/**************************************************************************** + * arch/risc-v/src/espressif/esp_systemreset.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __ARCH_RISCV_SRC_ESPRESSIF_ESP_SYSTEMRESET_H +#define __ARCH_RISCV_SRC_ESPRESSIF_ESP_SYSTEMRESET_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Shutdown handler type */ + +typedef void (*shutdown_handler_t)(void); + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: esp_register_shutdown_handler + * + * Description: + * This function allows you to register a handler that gets invoked before + * the application is restarted. + * + * Input Parameters: + * handler - Function to execute on restart. + * + * Returned Value: + * OK on success (positive non-zero values are cmd-specific). + * Negated errno returned on failure. + * + ****************************************************************************/ + +int esp_register_shutdown_handler(shutdown_handler_t handler); + +/**************************************************************************** + * Name: esp_unregister_shutdown_handler + * + * Description: + * This function allows you to unregister a handler which was previously + * registered using esp_register_shutdown_handler function. + * + * Input Parameters: + * handler - Function to execute on restart. + * + * Returned Value: + * OK on success (positive non-zero values are cmd-specific). + * Negated errno returned on failure. + * + ****************************************************************************/ + +int esp_unregister_shutdown_handler(shutdown_handler_t handler); + +/**************************************************************************** + * Name: up_shutdown_handler + * + * Description: + * Process all registered shutdown callback functions. + * + * Input Parameters: + * None. + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void up_shutdown_handler(void); + +#ifdef __cplusplus +} +#endif +#undef EXTERN + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_RISCV_SRC_ESPRESSIF_ESP_SYSTEMRESET_H */ diff --git a/arch/risc-v/src/espressif/hal_esp32c3.mk b/arch/risc-v/src/espressif/hal_esp32c3.mk index 8229aa597c4..9093bd21fcb 100644 --- a/arch/risc-v/src/espressif/hal_esp32c3.mk +++ b/arch/risc-v/src/espressif/hal_esp32c3.mk @@ -80,6 +80,7 @@ CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_hw_support/port/$(C CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_hw_support/port/$(CHIP_SERIES)/systimer.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/brownout.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/soc/$(CHIP_SERIES)/clk.c +CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/soc/$(CHIP_SERIES)/system_internal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/brownout_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/efuse_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/systimer_hal.c diff --git a/arch/risc-v/src/espressif/hal_esp32c6.mk b/arch/risc-v/src/espressif/hal_esp32c6.mk index 0515b94a4a9..6039085bf4a 100644 --- a/arch/risc-v/src/espressif/hal_esp32c6.mk +++ b/arch/risc-v/src/espressif/hal_esp32c6.mk @@ -85,6 +85,7 @@ CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_rom/patches/esp_rom CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_rom/patches/esp_rom_wdt.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/brownout.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/soc/$(CHIP_SERIES)/clk.c +CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/soc/$(CHIP_SERIES)/system_internal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/brownout_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/efuse_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/uart_hal.c diff --git a/arch/risc-v/src/espressif/hal_esp32h2.mk b/arch/risc-v/src/espressif/hal_esp32h2.mk index 764427a0d41..63ea4b882a0 100644 --- a/arch/risc-v/src/espressif/hal_esp32h2.mk +++ b/arch/risc-v/src/espressif/hal_esp32h2.mk @@ -84,7 +84,9 @@ CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_rom/patches/esp_rom CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_rom/patches/esp_rom_wdt.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/brownout.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/soc/$(CHIP_SERIES)/clk.c +CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/esp_system/port/soc/$(CHIP_SERIES)/system_internal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/brownout_hal.c +CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/cache_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/efuse_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/uart_hal.c CHIP_CSRCS += chip/$(ESP_HAL_3RDPARTY_UNPACK)/components/hal/uart_hal_iram.c diff --git a/boards/risc-v/espressif/esp32c3-generic/configs/nsh/defconfig b/boards/risc-v/espressif/esp32c3-generic/configs/nsh/defconfig index 65b27633e41..5f3c485436c 100644 --- a/boards/risc-v/espressif/esp32c3-generic/configs/nsh/defconfig +++ b/boards/risc-v/espressif/esp32c3-generic/configs/nsh/defconfig @@ -16,6 +16,7 @@ CONFIG_ARCH_CHIP_ESPRESSIF=y CONFIG_ARCH_INTERRUPTSTACK=1536 CONFIG_ARCH_RISCV=y CONFIG_ARCH_STACKDUMP=y +CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_LOOPSPERMSEC=15000 CONFIG_BUILTIN=y CONFIG_DEBUG_ASSERTIONS=y diff --git a/boards/risc-v/espressif/esp32c3-generic/src/Make.defs b/boards/risc-v/espressif/esp32c3-generic/src/Make.defs index c3fa143123f..5d1c61169fd 100644 --- a/boards/risc-v/espressif/esp32c3-generic/src/Make.defs +++ b/boards/risc-v/espressif/esp32c3-generic/src/Make.defs @@ -24,6 +24,10 @@ CSRCS = esp32c3_boot.c esp32c3_bringup.c ifeq ($(CONFIG_BOARDCTL),y) CSRCS += esp32c3_appinit.c + + ifeq ($(CONFIG_BOARDCTL_RESET),y) + CSRCS += esp32c3_reset.c + endif endif DEPPATH += --dep-path board diff --git a/boards/risc-v/espressif/esp32c3-generic/src/esp32c3_reset.c b/boards/risc-v/espressif/esp32c3-generic/src/esp32c3_reset.c new file mode 100644 index 00000000000..f6689c4a51f --- /dev/null +++ b/boards/risc-v/espressif/esp32c3-generic/src/esp32c3_reset.c @@ -0,0 +1,81 @@ +/**************************************************************************** + * boards/risc-v/espressif/esp32c3-generic/src/esp32c3_reset.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include + +#include "esp_systemreset.h" + +#ifdef CONFIG_BOARDCTL_RESET + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_reset + * + * Description: + * Reset board. Support for this function is required by board-level + * logic if CONFIG_BOARDCTL_RESET is selected. + * + * Input Parameters: + * status - Status information provided with the reset event. This + * meaning of this status information is board-specific. If not + * used by a board, the value zero may be provided in calls to + * board_reset(). + * + * Returned Value: + * If this function returns, then it was not possible to power-off the + * board due to some constraints. The return value in this case is a + * board-specific reason for the failure to shutdown. + * + ****************************************************************************/ + +int board_reset(int status) +{ + syslog(LOG_INFO, "reboot status=%d\n", status); + + switch (status) + { + case EXIT_SUCCESS: + up_shutdown_handler(); + break; + case CONFIG_BOARD_ASSERT_RESET_VALUE: + default: + break; + } + + up_systemreset(); + + return 0; +} + +#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/risc-v/espressif/esp32c6-generic/configs/nsh/defconfig b/boards/risc-v/espressif/esp32c6-generic/configs/nsh/defconfig index 129876ce442..f5374164845 100644 --- a/boards/risc-v/espressif/esp32c6-generic/configs/nsh/defconfig +++ b/boards/risc-v/espressif/esp32c6-generic/configs/nsh/defconfig @@ -16,6 +16,7 @@ CONFIG_ARCH_CHIP_ESPRESSIF=y CONFIG_ARCH_INTERRUPTSTACK=2048 CONFIG_ARCH_RISCV=y CONFIG_ARCH_STACKDUMP=y +CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_LOOPSPERMSEC=15000 CONFIG_BUILTIN=y CONFIG_DEV_ZERO=y diff --git a/boards/risc-v/espressif/esp32c6-generic/src/Make.defs b/boards/risc-v/espressif/esp32c6-generic/src/Make.defs index da0bd0abef9..40fa6da730f 100644 --- a/boards/risc-v/espressif/esp32c6-generic/src/Make.defs +++ b/boards/risc-v/espressif/esp32c6-generic/src/Make.defs @@ -24,6 +24,10 @@ CSRCS = esp32c6_boot.c esp32c6_bringup.c ifeq ($(CONFIG_BOARDCTL),y) CSRCS += esp32c6_appinit.c + + ifeq ($(CONFIG_BOARDCTL_RESET),y) + CSRCS += esp32c6_reset.c + endif endif DEPPATH += --dep-path board diff --git a/boards/risc-v/espressif/esp32c6-generic/src/esp32c6_reset.c b/boards/risc-v/espressif/esp32c6-generic/src/esp32c6_reset.c new file mode 100644 index 00000000000..9bdf617ab62 --- /dev/null +++ b/boards/risc-v/espressif/esp32c6-generic/src/esp32c6_reset.c @@ -0,0 +1,81 @@ +/**************************************************************************** + * boards/risc-v/espressif/esp32c6-generic/src/esp32c6_reset.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include + +#include "esp_systemreset.h" + +#ifdef CONFIG_BOARDCTL_RESET + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_reset + * + * Description: + * Reset board. Support for this function is required by board-level + * logic if CONFIG_BOARDCTL_RESET is selected. + * + * Input Parameters: + * status - Status information provided with the reset event. This + * meaning of this status information is board-specific. If not + * used by a board, the value zero may be provided in calls to + * board_reset(). + * + * Returned Value: + * If this function returns, then it was not possible to power-off the + * board due to some constraints. The return value in this case is a + * board-specific reason for the failure to shutdown. + * + ****************************************************************************/ + +int board_reset(int status) +{ + syslog(LOG_INFO, "reboot status=%d\n", status); + + switch (status) + { + case EXIT_SUCCESS: + up_shutdown_handler(); + break; + case CONFIG_BOARD_ASSERT_RESET_VALUE: + default: + break; + } + + up_systemreset(); + + return 0; +} + +#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/risc-v/espressif/esp32h2-generic/configs/nsh/defconfig b/boards/risc-v/espressif/esp32h2-generic/configs/nsh/defconfig index ffca5ca5413..c06a765e64f 100644 --- a/boards/risc-v/espressif/esp32h2-generic/configs/nsh/defconfig +++ b/boards/risc-v/espressif/esp32h2-generic/configs/nsh/defconfig @@ -16,6 +16,7 @@ CONFIG_ARCH_CHIP_ESPRESSIF=y CONFIG_ARCH_INTERRUPTSTACK=2048 CONFIG_ARCH_RISCV=y CONFIG_ARCH_STACKDUMP=y +CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_LOOPSPERMSEC=15000 CONFIG_BUILTIN=y CONFIG_DEV_ZERO=y diff --git a/boards/risc-v/espressif/esp32h2-generic/src/Make.defs b/boards/risc-v/espressif/esp32h2-generic/src/Make.defs index 57a1eeeddab..b75af13861e 100644 --- a/boards/risc-v/espressif/esp32h2-generic/src/Make.defs +++ b/boards/risc-v/espressif/esp32h2-generic/src/Make.defs @@ -24,6 +24,10 @@ CSRCS = esp32h2_boot.c esp32h2_bringup.c ifeq ($(CONFIG_BOARDCTL),y) CSRCS += esp32h2_appinit.c + + ifeq ($(CONFIG_BOARDCTL_RESET),y) + CSRCS += esp32h2_reset.c + endif endif DEPPATH += --dep-path board diff --git a/boards/risc-v/espressif/esp32h2-generic/src/esp32h2_reset.c b/boards/risc-v/espressif/esp32h2-generic/src/esp32h2_reset.c new file mode 100644 index 00000000000..b01e3de2d2f --- /dev/null +++ b/boards/risc-v/espressif/esp32h2-generic/src/esp32h2_reset.c @@ -0,0 +1,81 @@ +/**************************************************************************** + * boards/risc-v/espressif/esp32h2-generic/src/esp32h2_reset.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include + +#include "esp_systemreset.h" + +#ifdef CONFIG_BOARDCTL_RESET + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_reset + * + * Description: + * Reset board. Support for this function is required by board-level + * logic if CONFIG_BOARDCTL_RESET is selected. + * + * Input Parameters: + * status - Status information provided with the reset event. This + * meaning of this status information is board-specific. If not + * used by a board, the value zero may be provided in calls to + * board_reset(). + * + * Returned Value: + * If this function returns, then it was not possible to power-off the + * board due to some constraints. The return value in this case is a + * board-specific reason for the failure to shutdown. + * + ****************************************************************************/ + +int board_reset(int status) +{ + syslog(LOG_INFO, "reboot status=%d\n", status); + + switch (status) + { + case EXIT_SUCCESS: + up_shutdown_handler(); + break; + case CONFIG_BOARD_ASSERT_RESET_VALUE: + default: + break; + } + + up_systemreset(); + + return 0; +} + +#endif /* CONFIG_BOARDCTL_RESET */