espressif:esp32s3: Add esp32s3 initial support
ESP32-S3 target and related files added to the Espressif port.
Signed-off-by: Almir Okato <almir.okato@espressif.com>
diff --git a/boot/espressif/hal/include/esp32/esp32.cmake b/boot/espressif/hal/include/esp32/esp32.cmake
index ab96d1d..e26b6c3 100644
--- a/boot/espressif/hal/include/esp32/esp32.cmake
+++ b/boot/espressif/hal/include/esp32/esp32.cmake
@@ -1,3 +1,16 @@
+# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
+#
+# SPDX-License-Identifier: Apache-2.0
+
+list(APPEND include_dirs
+ ${esp_idf_dir}/components/${MCUBOOT_TARGET}/include
+ )
+
+list(APPEND hal_srcs
+ ${esp_idf_dir}/components/efuse/src/esp_efuse_api_key_esp32.c
+ )
+
list(APPEND LINKER_SCRIPTS
-T${esp_idf_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.newlib-funcs.ld
+ -T${esp_idf_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.eco3.ld
)
diff --git a/boot/espressif/hal/include/esp32c3/esp32c3.cmake b/boot/espressif/hal/include/esp32c3/esp32c3.cmake
index 372f4a4..5d37192 100644
--- a/boot/espressif/hal/include/esp32c3/esp32c3.cmake
+++ b/boot/espressif/hal/include/esp32c3/esp32c3.cmake
@@ -1,10 +1,16 @@
+# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
+#
+# 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
)
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
)
set_source_files_properties(
diff --git a/boot/espressif/hal/include/esp32s2/esp32s2.cmake b/boot/espressif/hal/include/esp32s2/esp32s2.cmake
index 171ab9d..588ec1c 100644
--- a/boot/espressif/hal/include/esp32s2/esp32s2.cmake
+++ b/boot/espressif/hal/include/esp32s2/esp32s2.cmake
@@ -1,5 +1,10 @@
+# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
+#
+# SPDX-License-Identifier: Apache-2.0
+
list(APPEND hal_srcs
${esp_idf_dir}/components/esp_hw_support/port/${MCUBOOT_TARGET}/regi2c_ctrl.c
+ ${esp_idf_dir}/components/efuse/src/esp_efuse_api_key_esp32xx.c
)
list(APPEND LINKER_SCRIPTS
diff --git a/boot/espressif/hal/include/esp32s3/esp32s3.cmake b/boot/espressif/hal/include/esp32s3/esp32s3.cmake
new file mode 100644
index 0000000..d8542e2
--- /dev/null
+++ b/boot/espressif/hal/include/esp32s3/esp32s3.cmake
@@ -0,0 +1,11 @@
+# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
+#
+# SPDX-License-Identifier: Apache-2.0
+
+list(APPEND hal_srcs
+ ${esp_idf_dir}/components/efuse/src/esp_efuse_api_key_esp32xx.c
+)
+
+list(APPEND LINKER_SCRIPTS
+ -T${esp_idf_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.newlib.ld
+ )
diff --git a/boot/espressif/hal/include/esp32s3/sdkconfig.h b/boot/espressif/hal/include/esp32s3/sdkconfig.h
new file mode 100644
index 0000000..e88d74f
--- /dev/null
+++ b/boot/espressif/hal/include/esp32s3/sdkconfig.h
@@ -0,0 +1,19 @@
+/*
+ * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#define BOOTLOADER_BUILD 1
+#define CONFIG_IDF_FIRMWARE_CHIP_ID 0x0009
+#define CONFIG_IDF_TARGET_ESP32S3 1
+#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1
+#define CONFIG_MCUBOOT 1
+#define NDEBUG 1
+#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000
+#define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200
+#define CONFIG_BOOTLOADER_OFFSET_IN_FLASH 0x0000
+#define CONFIG_PARTITION_TABLE_OFFSET 0x10000
+#define CONFIG_EFUSE_VIRTUAL_OFFSET 0x250000
+#define CONFIG_EFUSE_VIRTUAL_SIZE 0x2000
+#define CONFIG_EFUSE_MAX_BLK_LEN 256
diff --git a/boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h b/boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h
index 130f30f..8e86322 100644
--- a/boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h
+++ b/boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h
@@ -21,6 +21,8 @@
#define TARGET "[esp32]"
#elif CONFIG_IDF_TARGET_ESP32S2
#define TARGET "[esp32s2]"
+#elif CONFIG_IDF_TARGET_ESP32S3
+#define TARGET "[esp32s3]"
#elif CONFIG_IDF_TARGET_ESP32C3
#define TARGET "[esp32c3]"
#else