Merge branch 'refactor/wdt_rom_impl_v6.0' into 'release/v6.0'

refactor(hal_wdt): esp_hal_wdt also maintains the ROM implementation (v6.0)

See merge request espressif/esp-idf!43968
This commit is contained in:
morris
2025-12-10 18:27:30 +08:00
27 changed files with 23 additions and 71 deletions

View File

@@ -67,7 +67,6 @@ idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${common_req}")
idf_build_set_property(__OUTPUT_SDKCONFIG 0)
# Define a property for the default linker script
set(LD_DEFAULT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/main/ld/${IDF_TARGET}")
idf_build_set_property(BOOTLOADER_LINKER_SCRIPT "${LD_DEFAULT_PATH}/bootloader.rom.ld" APPEND)
project(bootloader)
if(CONFIG_ESP32P4_REV_MIN_300)
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.rev3.ld.in")

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-C2 target */

View File

@@ -1 +0,0 @@
/* No definition for ESP32-C3 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-C5 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-C6 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-C61 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-H2 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-H21 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-H4 target */

View File

@@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-P4 target */

View File

@@ -24,5 +24,14 @@ endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${public_include}
REQUIRES soc hal esp_hal_timg
REQUIRES soc hal esp_rom esp_hal_timg
LDFRAGMENTS linker.lf)
# Link the ROM WDT HAL implementation linker script if selected
if(CONFIG_HAL_WDT_USE_ROM_IMPL)
if(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
target_linker_script(${COMPONENT_LIB} INTERFACE "${target}/rom.beta5.wdt.ld")
else()
target_linker_script(${COMPONENT_LIB} INTERFACE "${target}/rom.wdt.ld")
endif()
endif()

View File

@@ -0,0 +1,12 @@
config HAL_WDT_USE_ROM_IMPL
bool "Use ROM implementation of WDT HAL driver"
depends on ESP_ROM_HAS_HAL_WDT
default y
help
Enable this flag to use HAL functions from ROM instead of ESP-IDF.
If keeping this as "n" in your project, you will have less free IRAM.
If making this as "y" in your project, you will increase free IRAM,
but you will lose the possibility to debug this module, and some new
features will be added and bugs will be fixed in the IDF source
but cannot be synced to ROM.

View File

@@ -131,14 +131,6 @@ endif()
# Common API which is linked both for bootloader and app builds
if(CONFIG_HAL_WDT_USE_ROM_IMPL)
if(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
rom_linker_script("beta5.wdt")
else()
rom_linker_script("wdt")
endif()
endif()
if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL)
if(CONFIG_IDF_TARGET_ESP32H4 AND NOT CONFIG_ESP32H4_SELECTS_REV_MP) # TODO: ESP32H4 IDF-13835
rom_linker_script("beta5.systimer")

View File

@@ -78,18 +78,7 @@ menu "Hardware Abstraction Layer (HAL) and Low Level (LL)"
features will be added and bugs will be fixed in the IDF source
but cannot be synced to ROM.
config HAL_WDT_USE_ROM_IMPL
bool "Use ROM implementation of WDT HAL driver"
depends on ESP_ROM_HAS_HAL_WDT
default y
help
Enable this flag to use HAL functions from ROM instead of ESP-IDF.
If keeping this as "n" in your project, you will have less free IRAM.
If making this as "y" in your project, you will increase free IRAM,
but you will lose the possibility to debug this module, and some new
features will be added and bugs will be fixed in the IDF source
but cannot be synced to ROM.
orsource "../esp_hal_wdt/Kconfig.hal_wdt"
config HAL_GPIO_USE_ROM_IMPL
bool "Use ROM implementation of GPIO HAL driver"