diff --git a/components/bootloader/subproject/CMakeLists.txt b/components/bootloader/subproject/CMakeLists.txt index 46662fd0e3..5ff5bddc97 100644 --- a/components/bootloader/subproject/CMakeLists.txt +++ b/components/bootloader/subproject/CMakeLists.txt @@ -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") diff --git a/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/components/bootloader/subproject/main/ld/esp32c2/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32c2/bootloader.rom.ld deleted file mode 100644 index e8af7ec5a6..0000000000 --- a/components/bootloader/subproject/main/ld/esp32c2/bootloader.rom.ld +++ /dev/null @@ -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 */ diff --git a/components/bootloader/subproject/main/ld/esp32c3/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32c3/bootloader.rom.ld deleted file mode 100644 index 54f8c54128..0000000000 --- a/components/bootloader/subproject/main/ld/esp32c3/bootloader.rom.ld +++ /dev/null @@ -1 +0,0 @@ -/* No definition for ESP32-C3 target */ diff --git a/components/bootloader/subproject/main/ld/esp32c5/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32c5/bootloader.rom.ld deleted file mode 100644 index 0bf140454f..0000000000 --- a/components/bootloader/subproject/main/ld/esp32c5/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-C5 target */ diff --git a/components/bootloader/subproject/main/ld/esp32c6/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32c6/bootloader.rom.ld deleted file mode 100644 index 239eb438b4..0000000000 --- a/components/bootloader/subproject/main/ld/esp32c6/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-C6 target */ diff --git a/components/bootloader/subproject/main/ld/esp32c61/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32c61/bootloader.rom.ld deleted file mode 100644 index 2005feaed3..0000000000 --- a/components/bootloader/subproject/main/ld/esp32c61/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-C61 target */ diff --git a/components/bootloader/subproject/main/ld/esp32h2/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32h2/bootloader.rom.ld deleted file mode 100644 index c6825c7ee4..0000000000 --- a/components/bootloader/subproject/main/ld/esp32h2/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-H2 target */ diff --git a/components/bootloader/subproject/main/ld/esp32h21/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32h21/bootloader.rom.ld deleted file mode 100644 index 26b801f3f7..0000000000 --- a/components/bootloader/subproject/main/ld/esp32h21/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-H21 target */ diff --git a/components/bootloader/subproject/main/ld/esp32h4/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32h4/bootloader.rom.ld deleted file mode 100644 index d8fa2c8a50..0000000000 --- a/components/bootloader/subproject/main/ld/esp32h4/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-H4 target */ diff --git a/components/bootloader/subproject/main/ld/esp32p4/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32p4/bootloader.rom.ld deleted file mode 100644 index 521eafee5c..0000000000 --- a/components/bootloader/subproject/main/ld/esp32p4/bootloader.rom.ld +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* No definition for ESP32-P4 target */ diff --git a/components/bootloader/subproject/main/ld/esp32s2/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32s2/bootloader.rom.ld deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/components/bootloader/subproject/main/ld/esp32s3/bootloader.rom.ld b/components/bootloader/subproject/main/ld/esp32s3/bootloader.rom.ld deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/components/esp_hal_wdt/CMakeLists.txt b/components/esp_hal_wdt/CMakeLists.txt index 19d0d05a4f..4df47401ca 100644 --- a/components/esp_hal_wdt/CMakeLists.txt +++ b/components/esp_hal_wdt/CMakeLists.txt @@ -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() diff --git a/components/esp_hal_wdt/Kconfig.hal_wdt b/components/esp_hal_wdt/Kconfig.hal_wdt new file mode 100644 index 0000000000..856b9c6581 --- /dev/null +++ b/components/esp_hal_wdt/Kconfig.hal_wdt @@ -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. diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.wdt.ld b/components/esp_hal_wdt/esp32c2/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32c2/ld/esp32c2.rom.wdt.ld rename to components/esp_hal_wdt/esp32c2/rom.wdt.ld diff --git a/components/esp_rom/esp32c5/ld/esp32c5.rom.wdt.ld b/components/esp_hal_wdt/esp32c5/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32c5/ld/esp32c5.rom.wdt.ld rename to components/esp_hal_wdt/esp32c5/rom.wdt.ld diff --git a/components/esp_rom/esp32c6/ld/esp32c6.rom.wdt.ld b/components/esp_hal_wdt/esp32c6/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32c6/ld/esp32c6.rom.wdt.ld rename to components/esp_hal_wdt/esp32c6/rom.wdt.ld diff --git a/components/esp_rom/esp32c61/ld/esp32c61.rom.wdt.ld b/components/esp_hal_wdt/esp32c61/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32c61/ld/esp32c61.rom.wdt.ld rename to components/esp_hal_wdt/esp32c61/rom.wdt.ld diff --git a/components/esp_rom/esp32h2/ld/esp32h2.rom.wdt.ld b/components/esp_hal_wdt/esp32h2/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32h2/ld/esp32h2.rom.wdt.ld rename to components/esp_hal_wdt/esp32h2/rom.wdt.ld diff --git a/components/esp_rom/esp32h21/ld/esp32h21.rom.wdt.ld b/components/esp_hal_wdt/esp32h21/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32h21/ld/esp32h21.rom.wdt.ld rename to components/esp_hal_wdt/esp32h21/rom.wdt.ld diff --git a/components/esp_rom/esp32h4/ld/esp32h4.rom.beta5.wdt.ld b/components/esp_hal_wdt/esp32h4/rom.beta5.wdt.ld similarity index 100% rename from components/esp_rom/esp32h4/ld/esp32h4.rom.beta5.wdt.ld rename to components/esp_hal_wdt/esp32h4/rom.beta5.wdt.ld diff --git a/components/esp_rom/esp32h4/ld/esp32h4.rom.wdt.ld b/components/esp_hal_wdt/esp32h4/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32h4/ld/esp32h4.rom.wdt.ld rename to components/esp_hal_wdt/esp32h4/rom.wdt.ld diff --git a/components/esp_rom/esp32p4/ld/esp32p4.rom.wdt.ld b/components/esp_hal_wdt/esp32p4/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32p4/ld/esp32p4.rom.wdt.ld rename to components/esp_hal_wdt/esp32p4/rom.wdt.ld diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld b/components/esp_hal_wdt/esp32s3/rom.wdt.ld similarity index 100% rename from components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld rename to components/esp_hal_wdt/esp32s3/rom.wdt.ld diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index e5d65aeb85..8246bbd351 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -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") diff --git a/components/hal/Kconfig b/components/hal/Kconfig index 671e27fbd4..abb479c358 100644 --- a/components/hal/Kconfig +++ b/components/hal/Kconfig @@ -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"