espressif: remove IDF git submodule and add its reference by param

Remove the ESP-IDF from git submodules to avoid potential
duplicated repo clones on the user system. IDF HAL code is still
a dependency for Espressif port, therefore now the HAL code
reference needs to be passed by parameter when building.

The Espressif port was also updated to work with last v5.1 IDF
code.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
diff --git a/boot/espressif/hal/include/esp32c3/esp32c3.cmake b/boot/espressif/hal/include/esp32c3/esp32c3.cmake
index 5d37192..3d4525a 100644
--- a/boot/espressif/hal/include/esp32c3/esp32c3.cmake
+++ b/boot/espressif/hal/include/esp32c3/esp32c3.cmake
@@ -3,17 +3,18 @@
 # SPDX-License-Identifier: Apache-2.0
 
 list(APPEND hal_srcs
-    ${esp_idf_dir}/components/bootloader_support/src/flash_qio_mode.c
-    ${esp_idf_dir}/components/esp_hw_support/port/${MCUBOOT_TARGET}/cpu_util_esp32c3.c
-    ${esp_idf_dir}/components/efuse/src/esp_efuse_api_key_esp32xx.c
+    ${esp_hal_dir}/components/esp_hw_support/port/${MCUBOOT_TARGET}/rtc_init.c
+    ${esp_hal_dir}/components/hal/cache_hal.c
+    ${esp_hal_dir}/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c
 )
 
+if (DEFINED CONFIG_ESP_CONSOLE_UART_CUSTOM)
+    list(APPEND hal_srcs
+        ${src_dir}/${MCUBOOT_TARGET}/console_uart_custom.c
+        )
+endif()
+
 list(APPEND LINKER_SCRIPTS
-    -T${esp_idf_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.newlib.ld
-    -T${esp_idf_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.eco3.ld
+    -T${esp_hal_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.newlib.ld
+    -T${esp_hal_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.eco3.ld
 )
-
-set_source_files_properties(
-    ${esp_idf_dir}/components/bootloader_support/src/flash_qio_mode.c
-    PROPERTIES COMPILE_FLAGS
-    "-Wno-unused-variable")