diff --git a/CMakeLists.txt b/CMakeLists.txt index 8caae634f0..722b07b973 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,15 +245,6 @@ if(COMPILER_RT_LIB_NAME) list(APPEND link_options "-rtlib=${CONFIG_COMPILER_RT_LIB_NAME}") endif() -# For the transition period from 32-bit time_t to 64-bit time_t, -# auto-detect the size of this type and set corresponding variable. -include(CheckTypeSize) -check_type_size("time_t" TIME_T_SIZE) -if(TIME_T_SIZE) - idf_build_set_property(TIME_T_SIZE ${TIME_T_SIZE}) -else() - message(FATAL_ERROR "Failed to determine sizeof(time_t)") -endif() idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "${c_compile_options}" APPEND) diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index 1a4d4edd49..f7b4941407 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -101,65 +101,46 @@ else() endif() endif() -idf_build_get_property(time_t_size TIME_T_SIZE) +# Common API which is linked both for bootloader and app builds + +if(CONFIG_HAL_WDT_USE_ROM_IMPL) + rom_linker_script("wdt") +endif() + +if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) + rom_linker_script("systimer") +endif() + +if(CONFIG_ESP_ROM_HAS_VERSION) + rom_linker_script("version") +endif() if(BOOTLOADER_BUILD) if(target STREQUAL "esp32") - rom_linker_script("newlib-funcs") if(NOT CONFIG_SPI_FLASH_ROM_DRIVER_PATCH) - rom_linker_script("spiflash") + rom_linker_script("spiflash_legacy") endif() if(CONFIG_ESP32_REV_MIN_FULL GREATER_EQUAL 300) rom_linker_script("eco3") endif() elseif(target STREQUAL "esp32s2") - rom_linker_script("newlib-funcs") - rom_linker_script("spiflash") - - elseif(target STREQUAL "esp32s3") - rom_linker_script("newlib") - - elseif(target STREQUAL "esp32c3") - rom_linker_script("newlib") - - elseif(target STREQUAL "esp32c2") - rom_linker_script("newlib") + rom_linker_script("spiflash_legacy") elseif(target STREQUAL "esp32c6") - rom_linker_script("newlib") # The linking of the bootloader needs to use the rom_i2c_writeReg_Mask in esp32c6.rom.phy.ld rom_linker_script("phy") - if(CONFIG_HAL_WDT_USE_ROM_IMPL) - rom_linker_script("wdt") - endif() - if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) - rom_linker_script("systimer") - endif() - rom_linker_script("version") - - elseif(target STREQUAL "esp32c5") - rom_linker_script("newlib") - elseif(target STREQUAL "esp32h2") - rom_linker_script("newlib") - if(CONFIG_HAL_WDT_USE_ROM_IMPL) - rom_linker_script("wdt") - endif() - if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) - rom_linker_script("systimer") - endif() - - elseif(target STREQUAL "esp32p4") - rom_linker_script("newlib") - if(CONFIG_HAL_WDT_USE_ROM_IMPL) - rom_linker_script("wdt") - endif() - if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) - rom_linker_script("systimer") - endif() - rom_linker_script("version") endif() + if(CONFIG_ESP_ROM_HAS_NEWLIB) + if(target STREQUAL "esp32" OR target STREQUAL "esp32s2") + rom_linker_script("newlib-funcs") + else() + rom_linker_script("newlib") + endif() + endif() + + else() # Regular app build if(target STREQUAL "esp32") rom_linker_script("newlib-data") @@ -169,22 +150,11 @@ else() # Regular app build # ESP32 only: these ROM functions may only be used if PSRAM cache workaround is disabled. # Otherwise we need to link to a multilib version of libc compiled with PSRAM workaround. rom_linker_script("newlib-funcs") - - if(time_t_size EQUAL 4) - # The ROM functions listed in this linker script depend on sizeof(time_t). - # Since ROM for ESP32 was compiled for 32-bit time_t, only link these functions - # if the toolchain is also using 32-bit time_t. - rom_linker_script("newlib-time") - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 32-bit time_t. - rom_linker_script("newlib-nano") - endif() - endif() endif() if(NOT CONFIG_SPI_FLASH_ROM_DRIVER_PATCH) - rom_linker_script("spiflash") + # For ESP32, inclusion of ROM driver do not depend on CONFIG_SPI_FLASH_ROM_IMPL + rom_linker_script("spiflash_legacy") endif() if(CONFIG_ESP32_REV_MIN_FULL GREATER_EQUAL 300) @@ -194,51 +164,11 @@ else() # Regular app build elseif(target STREQUAL "esp32s2") rom_linker_script("newlib-funcs") rom_linker_script("newlib-data") - rom_linker_script("spiflash") - if(time_t_size EQUAL 4) - # The ROM functions listed in this linker script depend on sizeof(time_t). - # Since ROM for ESP32-S2 was compiled for 32-bit time_t, only link these functions - # if the toolchain is also using 32-bit time_t. - rom_linker_script("newlib-time") - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 32-bit time_t. - rom_linker_script("newlib-nano") - endif() - endif() - - elseif(target STREQUAL "esp32s3") - rom_linker_script("newlib") - rom_linker_script("version") - - if(time_t_size EQUAL 4) - # The ROM functions listed in this linker script depend on sizeof(time_t). - # Since ROM for ESP32-S3 was compiled for 32-bit time_t, only link these functions - # if the toolchain is also using 32-bit time_t. - rom_linker_script("newlib-time") - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 32-bit time_t. - rom_linker_script("newlib-nano") - endif() - endif() + # For ESP32S2, inclusion of ROM driver do not depend on CONFIG_SPI_FLASH_ROM_IMPL + rom_linker_script("spiflash_legacy") elseif(target STREQUAL "esp32c3") - rom_linker_script("newlib") - rom_linker_script("version") - - if(time_t_size EQUAL 4) - # The ROM functions listed in this linker script depend on sizeof(time_t). - # Since ROM for ESP32-C3 was compiled for 32-bit time_t, only link these functions - # if the toolchain is also using 32-bit time_t. - rom_linker_script("newlib-time") - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 32-bit time_t. - rom_linker_script("newlib-nano") - endif() - endif() if(CONFIG_ESP32C3_REV_MIN_FULL GREATER_EQUAL 3) rom_linker_script("eco3") @@ -248,102 +178,30 @@ else() # Regular app build rom_linker_script("eco7") endif() - elseif(target STREQUAL "esp32c2") - rom_linker_script("newlib") - rom_linker_script("version") - - if(CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL) - rom_linker_script("mbedtls") - endif() - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 64-bit time_t. - rom_linker_script("newlib-nano") - endif() - elseif(target STREQUAL "esp32c6") - rom_linker_script("newlib") - rom_linker_script("version") - # esp32c6.rom.api.ld has been split to several lds by components. # esp32c6.rom.api.ld is still reserved to map the APIs rom_linker_script("phy") rom_linker_script("coexist") rom_linker_script("net80211") rom_linker_script("pp") + endif() - if(CONFIG_SPI_FLASH_ROM_IMPL) - rom_linker_script("spiflash") + if(CONFIG_ESP_ROM_HAS_NEWLIB AND NOT target STREQUAL "esp32" AND NOT target STREQUAL "esp32s2") + # ESP32 and S2 are a bit different, keep them as special cases in the target specific include section + rom_linker_script("newlib") + + if(CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT AND CONFIG_NEWLIB_NANO_FORMAT) + if(NOT CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME) + # Newlib-nano functions contains time_t related functions + # and cannot be used if they were compiled with 32 bit time_t + rom_linker_script("newlib-nano") + endif() endif() - if(CONFIG_HAL_WDT_USE_ROM_IMPL) - rom_linker_script("wdt") - endif() - - if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) - rom_linker_script("systimer") - endif() - - if(NOT CONFIG_NEWLIB_NANO_FORMAT) - # Normal(Non-nano) formatting functions in ROM are also built for 64-bit time_t. + if(CONFIG_ESP_ROM_HAS_NEWLIB_NORMAL_FORMAT AND NOT CONFIG_NEWLIB_NANO_FORMAT) rom_linker_script("newlib-normal") endif() - - elseif(target STREQUAL "esp32c5") - rom_linker_script("newlib") - rom_linker_script("version") - - # esp32c5.rom.api.ld has been split to several lds by components. - # esp32c5.rom.api.ld is still reserved to map the APIs - if(CONFIG_SPI_FLASH_ROM_IMPL) - rom_linker_script("spiflash") - endif() - - if(NOT CONFIG_NEWLIB_NANO_FORMAT) - # Normal(Non-nano) formatting functions in ROM are also built for 64-bit time_t. - rom_linker_script("newlib-normal") - endif() - - elseif(target STREQUAL "esp32h2") - rom_linker_script("newlib") - rom_linker_script("version") - - if(CONFIG_SPI_FLASH_ROM_IMPL) - rom_linker_script("spiflash") - endif() - - if(CONFIG_HAL_WDT_USE_ROM_IMPL) - rom_linker_script("wdt") - endif() - - if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) - rom_linker_script("systimer") - endif() - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 64-bit time_t. - rom_linker_script("newlib-nano") - endif() - - elseif(target STREQUAL "esp32p4") - rom_linker_script("newlib") - rom_linker_script("version") - - # esp32p4 rom doesn't have esp_flash driver - - if(CONFIG_HAL_WDT_USE_ROM_IMPL) - rom_linker_script("wdt") - endif() - - if(CONFIG_HAL_SYSTIMER_USE_ROM_IMPL) - rom_linker_script("systimer") - endif() - - if(CONFIG_NEWLIB_NANO_FORMAT) - # nano formatting functions in ROM are also built for 64-bit time_t. - rom_linker_script("newlib-nano") - endif() - endif() if(CONFIG_HEAP_TLSF_USE_ROM_IMPL) @@ -358,6 +216,17 @@ else() # Regular app build rom_linker_script("heap") endif() + if(CONFIG_SPI_FLASH_ROM_IMPL) + # Older targets do not have a separate ld file for spiflash + if(NOT target STREQUAL "esp32c3" AND NOT target STREQUAL "esp32s3" AND NOT target STREQUAL "esp32c2") + rom_linker_script("spiflash") + endif() + endif() + + if(CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL) + rom_linker_script("mbedtls") + endif() + if(CONFIG_IDF_TARGET_ARCH_XTENSA) target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=longjmp") endif() diff --git a/components/esp_rom/esp32/Kconfig.soc_caps.in b/components/esp_rom/esp32/Kconfig.soc_caps.in index 5f63da9c19..b9936a42e9 100644 --- a/components/esp_rom/esp32/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32/Kconfig.soc_caps.in @@ -27,10 +27,18 @@ config ESP_ROM_NEEDS_SWSETUP_WORKAROUND bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y +config ESP_ROM_HAS_NEWLIB_32BIT_TIME + bool + default y + config ESP_ROM_HAS_SW_FLOAT bool default y diff --git a/components/esp_rom/esp32/esp_rom_caps.h b/components/esp_rom/esp32/esp_rom_caps.h index 9067600037..91130bd555 100644 --- a/components/esp_rom/esp32/esp_rom_caps.h +++ b/components/esp_rom/esp32/esp_rom_caps.h @@ -12,7 +12,9 @@ #define ESP_ROM_HAS_JPEG_DECODE (1) // ROM has JPEG decode library #define ESP_ROM_HAS_UART_BUF_SWITCH (1) // ROM has exported the uart buffer switch function #define ESP_ROM_NEEDS_SWSETUP_WORKAROUND (1) // ROM uses 32-bit time_t. A workaround is required to prevent printf functions from crashing +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions +#define ESP_ROM_HAS_NEWLIB_32BIT_TIME (1) // ROM was compiled with 32 bit time_t #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions #define ESP_ROM_USB_OTG_NUM (-1) // No USB_OTG CDC in the ROM, set -1 for Kconfig usage. #define ESP_ROM_USB_SERIAL_DEVICE_NUM (-1) // No USB_SERIAL_JTAG in the ROM, set -1 for Kconfig usage. diff --git a/components/esp_rom/esp32/ld/esp32.rom.spiflash.ld b/components/esp_rom/esp32/ld/esp32.rom.spiflash_legacy.ld similarity index 90% rename from components/esp_rom/esp32/ld/esp32.rom.spiflash.ld rename to components/esp_rom/esp32/ld/esp32.rom.spiflash_legacy.ld index 63aee6391f..b68b897a98 100644 --- a/components/esp_rom/esp32/ld/esp32.rom.spiflash.ld +++ b/components/esp_rom/esp32/ld/esp32.rom.spiflash_legacy.ld @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /* Address table for SPI driver functions in ESP32 ROM. These functions are only linked from ROM when SPI_FLASH_ROM_DRIVER_PATCH is not set in configuration. diff --git a/components/esp_rom/esp32c2/Kconfig.soc_caps.in b/components/esp_rom/esp32c2/Kconfig.soc_caps.in index e5bc96a913..ca4d67e28a 100644 --- a/components/esp_rom/esp32c2/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32c2/Kconfig.soc_caps.in @@ -47,6 +47,10 @@ config ESP_ROM_HAS_SPI_FLASH bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y @@ -74,3 +78,7 @@ config ESP_ROM_USB_OTG_NUM config ESP_ROM_USB_SERIAL_DEVICE_NUM int default -1 + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32c2/esp_rom_caps.h b/components/esp_rom/esp32c2/esp_rom_caps.h index fd73fa92b0..eb7284de4c 100644 --- a/components/esp_rom/esp32c2/esp_rom_caps.h +++ b/components/esp_rom/esp32c2/esp_rom_caps.h @@ -17,6 +17,7 @@ #define ESP_ROM_HAS_HEAP_TLSF (1) // ROM has the implementation of the tlsf and multi-heap library #define ESP_ROM_HAS_LAYOUT_TABLE (1) // ROM has the layout table #define ESP_ROM_HAS_SPI_FLASH (1) // ROM has the implementation of SPI Flash driver +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions #define ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE (1) // ROM needs to set cache MMU size according to instruction and rodata for flash mmap #define ESP_ROM_RAM_APP_NEEDS_MMU_INIT (1) // ROM doesn't init cache MMU when it's a RAM APP, needs MMU hal to init @@ -24,3 +25,4 @@ #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions #define ESP_ROM_USB_OTG_NUM (-1) // No USB_OTG CDC in the ROM, set -1 for Kconfig usage. #define ESP_ROM_USB_SERIAL_DEVICE_NUM (-1) // No USB_SERIAL_JTAG in the ROM, set -1 for Kconfig usage. +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.heap.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.heap.ld index 229d7e2fea..5d6f54c534 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.heap.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.heap.ld @@ -1,8 +1,59 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ + + +/*************************************** + Group heap + ***************************************/ + +/* Functions */ +PROVIDE( tlsf_create = 0x400002dc ); +PROVIDE( tlsf_create_with_pool = 0x400002e0 ); +PROVIDE( tlsf_get_pool = 0x400002e4 ); +PROVIDE( tlsf_add_pool = 0x400002e8 ); +PROVIDE( tlsf_remove_pool = 0x400002ec ); +PROVIDE( tlsf_malloc = 0x400002f0 ); +PROVIDE( tlsf_memalign = 0x400002f4 ); +PROVIDE( tlsf_memalign_offs = 0x400002f8 ); +PROVIDE( tlsf_realloc = 0x400002fc ); +PROVIDE( tlsf_free = 0x40000300 ); +PROVIDE( tlsf_block_size = 0x40000304 ); +PROVIDE( tlsf_size = 0x40000308 ); +PROVIDE( tlsf_align_size = 0x4000030c ); +PROVIDE( tlsf_block_size_min = 0x40000310 ); +PROVIDE( tlsf_block_size_max = 0x40000314 ); +PROVIDE( tlsf_pool_overhead = 0x40000318 ); +PROVIDE( tlsf_alloc_overhead = 0x4000031c ); +PROVIDE( tlsf_walk_pool = 0x40000320 ); +PROVIDE( tlsf_check = 0x40000324 ); +PROVIDE( tlsf_check_pool = 0x40000328 ); +PROVIDE( tlsf_poison_fill_pfunc_set = 0x4000032c ); +PROVIDE( multi_heap_get_block_address_impl = 0x40000330 ); +PROVIDE( multi_heap_get_allocated_size_impl = 0x40000334 ); +PROVIDE( multi_heap_register_impl = 0x40000338 ); +PROVIDE( multi_heap_set_lock = 0x4000033c ); +PROVIDE( multi_heap_os_funcs_init = 0x40000340 ); +PROVIDE( multi_heap_internal_lock = 0x40000344 ); +PROVIDE( multi_heap_internal_unlock = 0x40000348 ); +PROVIDE( multi_heap_get_first_block = 0x4000034c ); +PROVIDE( multi_heap_get_next_block = 0x40000350 ); +PROVIDE( multi_heap_is_free = 0x40000354 ); +PROVIDE( multi_heap_malloc_impl = 0x40000358 ); +PROVIDE( multi_heap_free_impl = 0x4000035c ); +PROVIDE( multi_heap_realloc_impl = 0x40000360 ); +PROVIDE( multi_heap_aligned_alloc_impl_offs = 0x40000364 ); +PROVIDE( multi_heap_aligned_alloc_impl = 0x40000368 ); +PROVIDE( multi_heap_check = 0x4000036c ); +PROVIDE( multi_heap_dump = 0x40000370 ); +PROVIDE( multi_heap_free_size_impl = 0x40000374 ); +PROVIDE( multi_heap_minimum_free_size_impl = 0x40000378 ); +PROVIDE( multi_heap_get_info_impl = 0x4000037c ); +/* Data (.data, .bss, .rodata) */ +PROVIDE( heap_tlsf_table_ptr = 0x3fcdffec ); + /** * Multi heap function */ diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index e1e7ae7d0f..5dcf695de9 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -200,81 +200,6 @@ PROVIDE( spi_flash_encryption_hal_prepare = 0x4000026c ); PROVIDE( spi_flash_encryption_hal_done = 0x40000270 ); PROVIDE( spi_flash_encryption_hal_destroy = 0x40000274 ); PROVIDE( spi_flash_encryption_hal_check = 0x40000278 ); -PROVIDE( wdt_hal_init = 0x4000027c ); -PROVIDE( wdt_hal_deinit = 0x40000280 ); -PROVIDE( wdt_hal_config_stage = 0x40000284 ); -PROVIDE( wdt_hal_write_protect_disable = 0x40000288 ); -PROVIDE( wdt_hal_write_protect_enable = 0x4000028c ); -PROVIDE( wdt_hal_enable = 0x40000290 ); -PROVIDE( wdt_hal_disable = 0x40000294 ); -PROVIDE( wdt_hal_handle_intr = 0x40000298 ); -PROVIDE( wdt_hal_feed = 0x4000029c ); -PROVIDE( wdt_hal_set_flashboot_en = 0x400002a0 ); -PROVIDE( wdt_hal_is_enabled = 0x400002a4 ); -PROVIDE( systimer_hal_get_counter_value = 0x400002ac ); -PROVIDE( systimer_hal_get_alarm_value = 0x400002bc ); -PROVIDE( systimer_hal_enable_alarm_int = 0x400002c0 ); -PROVIDE( systimer_hal_enable_counter = 0x400002cc ); -PROVIDE( systimer_hal_select_alarm_mode = 0x400002d0 ); -PROVIDE( systimer_hal_connect_alarm_counter = 0x400002d4 ); -PROVIDE( systimer_hal_counter_can_stall_by_cpu = 0x400002d8 ); - -/* The following ROM functions are commented out because they're patched in the esp_rom_systimer.c */ -/* PROVIDE( systimer_hal_init = 0x400002a8 ); */ -/* PROVIDE( systimer_hal_get_time = 0x400002b0 ); */ -/* PROVIDE( systimer_hal_set_alarm_target = 0x400002b4 ); */ -/* PROVIDE( systimer_hal_set_alarm_period = 0x400002b8 ); */ -/* PROVIDE( systimer_hal_counter_value_advance = 0x400002c8 ); */ - - -/*************************************** - Group heap - ***************************************/ - -/* Functions */ -PROVIDE( tlsf_create = 0x400002dc ); -PROVIDE( tlsf_create_with_pool = 0x400002e0 ); -PROVIDE( tlsf_get_pool = 0x400002e4 ); -PROVIDE( tlsf_add_pool = 0x400002e8 ); -PROVIDE( tlsf_remove_pool = 0x400002ec ); -PROVIDE( tlsf_malloc = 0x400002f0 ); -PROVIDE( tlsf_memalign = 0x400002f4 ); -PROVIDE( tlsf_memalign_offs = 0x400002f8 ); -PROVIDE( tlsf_realloc = 0x400002fc ); -PROVIDE( tlsf_free = 0x40000300 ); -PROVIDE( tlsf_block_size = 0x40000304 ); -PROVIDE( tlsf_size = 0x40000308 ); -PROVIDE( tlsf_align_size = 0x4000030c ); -PROVIDE( tlsf_block_size_min = 0x40000310 ); -PROVIDE( tlsf_block_size_max = 0x40000314 ); -PROVIDE( tlsf_pool_overhead = 0x40000318 ); -PROVIDE( tlsf_alloc_overhead = 0x4000031c ); -PROVIDE( tlsf_walk_pool = 0x40000320 ); -PROVIDE( tlsf_check = 0x40000324 ); -PROVIDE( tlsf_check_pool = 0x40000328 ); -PROVIDE( tlsf_poison_fill_pfunc_set = 0x4000032c ); -PROVIDE( multi_heap_get_block_address_impl = 0x40000330 ); -PROVIDE( multi_heap_get_allocated_size_impl = 0x40000334 ); -PROVIDE( multi_heap_register_impl = 0x40000338 ); -PROVIDE( multi_heap_set_lock = 0x4000033c ); -PROVIDE( multi_heap_os_funcs_init = 0x40000340 ); -PROVIDE( multi_heap_internal_lock = 0x40000344 ); -PROVIDE( multi_heap_internal_unlock = 0x40000348 ); -PROVIDE( multi_heap_get_first_block = 0x4000034c ); -PROVIDE( multi_heap_get_next_block = 0x40000350 ); -PROVIDE( multi_heap_is_free = 0x40000354 ); -PROVIDE( multi_heap_malloc_impl = 0x40000358 ); -PROVIDE( multi_heap_free_impl = 0x4000035c ); -PROVIDE( multi_heap_realloc_impl = 0x40000360 ); -PROVIDE( multi_heap_aligned_alloc_impl_offs = 0x40000364 ); -PROVIDE( multi_heap_aligned_alloc_impl = 0x40000368 ); -PROVIDE( multi_heap_check = 0x4000036c ); -PROVIDE( multi_heap_dump = 0x40000370 ); -PROVIDE( multi_heap_free_size_impl = 0x40000374 ); -PROVIDE( multi_heap_minimum_free_size_impl = 0x40000378 ); -PROVIDE( multi_heap_get_info_impl = 0x4000037c ); -/* Data (.data, .bss, .rodata) */ -PROVIDE( heap_tlsf_table_ptr = 0x3fcdffec ); /*************************************** diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.systimer.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.systimer.ld new file mode 100644 index 0000000000..532ebd9497 --- /dev/null +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.systimer.ld @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +PROVIDE( systimer_hal_get_counter_value = 0x400002ac ); +PROVIDE( systimer_hal_get_alarm_value = 0x400002bc ); +PROVIDE( systimer_hal_enable_alarm_int = 0x400002c0 ); +PROVIDE( systimer_hal_enable_counter = 0x400002cc ); +PROVIDE( systimer_hal_select_alarm_mode = 0x400002d0 ); +PROVIDE( systimer_hal_connect_alarm_counter = 0x400002d4 ); +PROVIDE( systimer_hal_counter_can_stall_by_cpu = 0x400002d8 ); + +/* The following ROM functions are commented out because they're patched in the esp_rom_systimer.c */ +/* PROVIDE( systimer_hal_init = 0x400002a8 ); */ +/* PROVIDE( systimer_hal_get_time = 0x400002b0 ); */ +/* PROVIDE( systimer_hal_set_alarm_target = 0x400002b4 ); */ +/* PROVIDE( systimer_hal_set_alarm_period = 0x400002b8 ); */ +/* PROVIDE( systimer_hal_counter_value_advance = 0x400002c8 ); */ diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.wdt.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.wdt.ld new file mode 100644 index 0000000000..9872a971b0 --- /dev/null +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.wdt.ld @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +PROVIDE( wdt_hal_init = 0x4000027c ); +PROVIDE( wdt_hal_deinit = 0x40000280 ); +PROVIDE( wdt_hal_config_stage = 0x40000284 ); +PROVIDE( wdt_hal_write_protect_disable = 0x40000288 ); +PROVIDE( wdt_hal_write_protect_enable = 0x4000028c ); +PROVIDE( wdt_hal_enable = 0x40000290 ); +PROVIDE( wdt_hal_disable = 0x40000294 ); +PROVIDE( wdt_hal_handle_intr = 0x40000298 ); +PROVIDE( wdt_hal_feed = 0x4000029c ); +PROVIDE( wdt_hal_set_flashboot_en = 0x400002a0 ); +PROVIDE( wdt_hal_is_enabled = 0x400002a4 ); diff --git a/components/esp_rom/esp32c3/Kconfig.soc_caps.in b/components/esp_rom/esp32c3/Kconfig.soc_caps.in index 0a8fc618a8..cd11aba9e3 100644 --- a/components/esp_rom/esp32c3/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32c3/Kconfig.soc_caps.in @@ -59,10 +59,18 @@ config ESP_ROM_HAS_ETS_PRINTF_BUG bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y +config ESP_ROM_HAS_NEWLIB_32BIT_TIME + bool + default y + config ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE bool default y @@ -78,3 +86,7 @@ config ESP_ROM_HAS_SW_FLOAT config ESP_ROM_USB_OTG_NUM int default -1 + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32c3/esp_rom_caps.h b/components/esp_rom/esp32c3/esp_rom_caps.h index fb2c493514..e4218b0f51 100644 --- a/components/esp_rom/esp32c3/esp_rom_caps.h +++ b/components/esp_rom/esp32c3/esp_rom_caps.h @@ -20,8 +20,11 @@ #define ESP_ROM_HAS_LAYOUT_TABLE (1) // ROM has the layout table #define ESP_ROM_HAS_SPI_FLASH (1) // ROM has the implementation of SPI Flash driver #define ESP_ROM_HAS_ETS_PRINTF_BUG (1) // ROM has ets_printf bug when disable the ROM log either by eFuse or RTC storage register +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions +#define ESP_ROM_HAS_NEWLIB_32BIT_TIME (1) // ROM was compiled with 32 bit time_t #define ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE (1) // ROM needs to set cache MMU size according to instruction and rodata for flash mmap #define ESP_ROM_RAM_APP_NEEDS_MMU_INIT (1) // ROM doesn't init cache MMU when it's a RAM APP, needs MMU hal to init #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions #define ESP_ROM_USB_OTG_NUM (-1) // No USB_OTG CDC in the ROM, set -1 for Kconfig usage. +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32c5/beta3/esp32c5/Kconfig.soc_caps.in b/components/esp_rom/esp32c5/beta3/esp32c5/Kconfig.soc_caps.in index fce9a24ae3..f2b89066e3 100644 --- a/components/esp_rom/esp32c5/beta3/esp32c5/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32c5/beta3/esp32c5/Kconfig.soc_caps.in @@ -63,6 +63,10 @@ config ESP_ROM_WITHOUT_REGI2C bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NORMAL_FORMAT bool default y @@ -78,3 +82,7 @@ config ESP_ROM_RAM_APP_NEEDS_MMU_INIT config ESP_ROM_USB_OTG_NUM int default -1 + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32c5/beta3/esp32c5/esp_rom_caps.h b/components/esp_rom/esp32c5/beta3/esp32c5/esp_rom_caps.h index 924a30c23a..00e7cfed2e 100644 --- a/components/esp_rom/esp32c5/beta3/esp32c5/esp_rom_caps.h +++ b/components/esp_rom/esp32c5/beta3/esp32c5/esp_rom_caps.h @@ -21,7 +21,9 @@ #define ESP_ROM_HAS_LAYOUT_TABLE (1) // ROM has the layout table #define ESP_ROM_HAS_SPI_FLASH (1) // ROM has the implementation of SPI Flash driver #define ESP_ROM_WITHOUT_REGI2C (1) // ROM has no regi2c APIs +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NORMAL_FORMAT (1) // ROM has the newlib normal/full version of formatting functions (as opposed to the nano versions) #define ESP_ROM_WDT_INIT_PATCH (1) // ROM version does not configure the clock #define ESP_ROM_RAM_APP_NEEDS_MMU_INIT (1) // ROM doesn't init cache MMU when it's a RAM APP, needs MMU hal to init #define ESP_ROM_USB_OTG_NUM (-1) // No USB_OTG CDC in the ROM, set -1 for Kconfig usage. +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.ld b/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.ld index 58e5292c71..8e3dfdefe7 100644 --- a/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.ld +++ b/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.ld @@ -160,46 +160,6 @@ rom_spiflash_legacy_data = 0x4087ffec; g_flash_guard_ops = 0x4087fff4; -/*************************************** - Group hal_wdt - ***************************************/ - -/* Functions */ -wdt_hal_init = 0x40000390; -wdt_hal_deinit = 0x40000394; -wdt_hal_config_stage = 0x40000398; -wdt_hal_write_protect_disable = 0x4000039c; -wdt_hal_write_protect_enable = 0x400003a0; -wdt_hal_enable = 0x400003a4; -wdt_hal_disable = 0x400003a8; -wdt_hal_handle_intr = 0x400003ac; -wdt_hal_feed = 0x400003b0; -wdt_hal_set_flashboot_en = 0x400003b4; -wdt_hal_is_enabled = 0x400003b8; - - -/*************************************** - Group hal_systimer - ***************************************/ - -/* Functions */ -systimer_hal_init = 0x400003bc; -systimer_hal_deinit = 0x400003c0; -systimer_hal_set_tick_rate_ops = 0x400003c4; -systimer_hal_get_counter_value = 0x400003c8; -systimer_hal_get_time = 0x400003cc; -systimer_hal_set_alarm_target = 0x400003d0; -systimer_hal_set_alarm_period = 0x400003d4; -systimer_hal_get_alarm_value = 0x400003d8; -systimer_hal_enable_alarm_int = 0x400003dc; -systimer_hal_on_apb_freq_update = 0x400003e0; -systimer_hal_counter_value_advance = 0x400003e4; -systimer_hal_enable_counter = 0x400003e8; -systimer_hal_select_alarm_mode = 0x400003ec; -systimer_hal_connect_alarm_counter = 0x400003f0; -systimer_hal_counter_can_stall_by_cpu = 0x400003f4; - - /*************************************** Group cache ***************************************/ diff --git a/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.systimer.ld b/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.systimer.ld new file mode 100644 index 0000000000..3cd221e7c9 --- /dev/null +++ b/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.systimer.ld @@ -0,0 +1,27 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +/*************************************** + Group hal_systimer + ***************************************/ + +/* Functions */ +systimer_hal_init = 0x400003bc; +systimer_hal_deinit = 0x400003c0; +systimer_hal_set_tick_rate_ops = 0x400003c4; +systimer_hal_get_counter_value = 0x400003c8; +systimer_hal_get_time = 0x400003cc; +systimer_hal_set_alarm_target = 0x400003d0; +systimer_hal_set_alarm_period = 0x400003d4; +systimer_hal_get_alarm_value = 0x400003d8; +systimer_hal_enable_alarm_int = 0x400003dc; +systimer_hal_on_apb_freq_update = 0x400003e0; +systimer_hal_counter_value_advance = 0x400003e4; +systimer_hal_enable_counter = 0x400003e8; +systimer_hal_select_alarm_mode = 0x400003ec; +systimer_hal_connect_alarm_counter = 0x400003f0; +systimer_hal_counter_can_stall_by_cpu = 0x400003f4; diff --git a/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.wdt.ld b/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.wdt.ld new file mode 100644 index 0000000000..ea0029d7f3 --- /dev/null +++ b/components/esp_rom/esp32c5/beta3/esp32c5/ld/esp32c5.rom.wdt.ld @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/*************************************** + Group hal_wdt + ***************************************/ + +/* Functions */ +wdt_hal_init = 0x40000390; +wdt_hal_deinit = 0x40000394; +wdt_hal_config_stage = 0x40000398; +wdt_hal_write_protect_disable = 0x4000039c; +wdt_hal_write_protect_enable = 0x400003a0; +wdt_hal_enable = 0x400003a4; +wdt_hal_disable = 0x400003a8; +wdt_hal_handle_intr = 0x400003ac; +wdt_hal_feed = 0x400003b0; +wdt_hal_set_flashboot_en = 0x400003b4; +wdt_hal_is_enabled = 0x400003b8; diff --git a/components/esp_rom/esp32c6/Kconfig.soc_caps.in b/components/esp_rom/esp32c6/Kconfig.soc_caps.in index 1999ddc331..3a2a837056 100644 --- a/components/esp_rom/esp32c6/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32c6/Kconfig.soc_caps.in @@ -63,6 +63,10 @@ config ESP_ROM_HAS_REGI2C_BUG bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NORMAL_FORMAT bool default y @@ -90,3 +94,7 @@ config ESP_ROM_HAS_SW_FLOAT config ESP_ROM_USB_OTG_NUM int default -1 + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32c6/esp_rom_caps.h b/components/esp_rom/esp32c6/esp_rom_caps.h index ba530c862f..1fb9480849 100644 --- a/components/esp_rom/esp32c6/esp_rom_caps.h +++ b/components/esp_rom/esp32c6/esp_rom_caps.h @@ -21,6 +21,7 @@ #define ESP_ROM_HAS_LAYOUT_TABLE (1) // ROM has the layout table #define ESP_ROM_HAS_SPI_FLASH (1) // ROM has the implementation of SPI Flash driver #define ESP_ROM_HAS_REGI2C_BUG (1) // ROM has the regi2c bug +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NORMAL_FORMAT (1) // ROM has the newlib normal/full version of formatting functions (as opposed to the nano versions) #define ESP_ROM_REV0_HAS_NO_ECDSA_INTERFACE (1) // ECO 0 does not have ets_ecdsa_verify symbol, future revision will have it #define ESP_ROM_WDT_INIT_PATCH (1) // ROM version does not configure the clock @@ -28,3 +29,4 @@ #define ESP_ROM_RAM_APP_NEEDS_MMU_INIT (1) // ROM doesn't init cache MMU when it's a RAM APP, needs MMU hal to init #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions #define ESP_ROM_USB_OTG_NUM (-1) // No USB_OTG CDC in the ROM, set -1 for Kconfig usage. +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32h2/Kconfig.soc_caps.in b/components/esp_rom/esp32h2/Kconfig.soc_caps.in index 78c0c45b63..e6a8376ae5 100644 --- a/components/esp_rom/esp32h2/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32h2/Kconfig.soc_caps.in @@ -55,6 +55,10 @@ config ESP_ROM_WITHOUT_REGI2C bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y @@ -78,3 +82,7 @@ config ESP_ROM_HAS_SW_FLOAT config ESP_ROM_USB_OTG_NUM int default -1 + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32h2/esp_rom_caps.h b/components/esp_rom/esp32h2/esp_rom_caps.h index 5923dfbc4a..186b94a09a 100644 --- a/components/esp_rom/esp32h2/esp_rom_caps.h +++ b/components/esp_rom/esp32h2/esp_rom_caps.h @@ -19,9 +19,11 @@ #define ESP_ROM_HAS_LAYOUT_TABLE (1) // ROM has the layout table #define ESP_ROM_HAS_SPI_FLASH (1) // ROM has the implementation of SPI Flash driver #define ESP_ROM_WITHOUT_REGI2C (1) // ROM has no regi2c APIs +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano versions of formatting functions #define ESP_ROM_WDT_INIT_PATCH (1) // ROM version does not configure the clock #define ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE (1) // ROM needs to set cache MMU size according to instruction and rodata for flash mmap #define ESP_ROM_RAM_APP_NEEDS_MMU_INIT (1) // ROM doesn't init cache MMU when it's a RAM APP, needs MMU hal to init #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions #define ESP_ROM_USB_OTG_NUM (-1) // No USB_OTG CDC in the ROM, set -1 for Kconfig usage. +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32p4/Kconfig.soc_caps.in b/components/esp_rom/esp32p4/Kconfig.soc_caps.in index 78c3af265d..0218335e2c 100644 --- a/components/esp_rom/esp32p4/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32p4/Kconfig.soc_caps.in @@ -59,6 +59,14 @@ config ESP_ROM_WITHOUT_REGI2C bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32p4/esp_rom_caps.h b/components/esp_rom/esp32p4/esp_rom_caps.h index acc4ff8e38..e226465aec 100644 --- a/components/esp_rom/esp32p4/esp_rom_caps.h +++ b/components/esp_rom/esp32p4/esp_rom_caps.h @@ -20,4 +20,6 @@ #define ESP_ROM_WDT_INIT_PATCH (1) // ROM version does not configure the clock #define ESP_ROM_HAS_LP_ROM (1) // ROM also has a LP ROM placed in LP memory #define ESP_ROM_WITHOUT_REGI2C (1) // ROM has no regi2c APIs +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32s2/Kconfig.soc_caps.in b/components/esp_rom/esp32s2/Kconfig.soc_caps.in index 077d3f780d..ae5670d4cd 100644 --- a/components/esp_rom/esp32s2/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32s2/Kconfig.soc_caps.in @@ -23,10 +23,18 @@ config ESP_ROM_HAS_REGI2C_BUG bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y +config ESP_ROM_HAS_NEWLIB_32BIT_TIME + bool + default y + config ESP_ROM_USB_OTG_NUM int default 3 diff --git a/components/esp_rom/esp32s2/esp_rom_caps.h b/components/esp_rom/esp32s2/esp_rom_caps.h index 0409926678..3beb3ee0ba 100644 --- a/components/esp_rom/esp32s2/esp_rom_caps.h +++ b/components/esp_rom/esp32s2/esp_rom_caps.h @@ -11,7 +11,9 @@ #define ESP_ROM_HAS_UART_BUF_SWITCH (1) // ROM has exported the uart buffer switch function #define ESP_ROM_NEEDS_SWSETUP_WORKAROUND (1) // ROM uses 32-bit time_t. A workaround is required to prevent printf functions from crashing #define ESP_ROM_HAS_REGI2C_BUG (1) // ROM has the regi2c bug +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions +#define ESP_ROM_HAS_NEWLIB_32BIT_TIME (1) // ROM was compiled with 32 bit time_t #define ESP_ROM_USB_OTG_NUM (3) // The serial port ID (UART, USB, ...) of USB_OTG CDC in the ROM. #define ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG (1) // ROM api Cache_Count_Flash_Pages will return unexpected value #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions diff --git a/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld b/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash_legacy.ld similarity index 92% rename from components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld rename to components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash_legacy.ld index 4ff8dd8193..bfbb63f756 100644 --- a/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld +++ b/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash_legacy.ld @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** * SPI flash driver function, compatibility names. */ diff --git a/components/esp_rom/esp32s3/Kconfig.soc_caps.in b/components/esp_rom/esp32s3/Kconfig.soc_caps.in index dfc3a7ff7f..b5acdc50f4 100644 --- a/components/esp_rom/esp32s3/Kconfig.soc_caps.in +++ b/components/esp_rom/esp32s3/Kconfig.soc_caps.in @@ -67,10 +67,18 @@ config ESP_ROM_HAS_ETS_PRINTF_BUG bool default y +config ESP_ROM_HAS_NEWLIB + bool + default y + config ESP_ROM_HAS_NEWLIB_NANO_FORMAT bool default y +config ESP_ROM_HAS_NEWLIB_32BIT_TIME + bool + default y + config ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE bool default y @@ -94,3 +102,7 @@ config ESP_ROM_HAS_CACHE_WRITEBACK_BUG config ESP_ROM_HAS_SW_FLOAT bool default y + +config ESP_ROM_HAS_VERSION + bool + default y diff --git a/components/esp_rom/esp32s3/esp_rom_caps.h b/components/esp_rom/esp32s3/esp_rom_caps.h index 98a650bf2d..bbcb92ee07 100644 --- a/components/esp_rom/esp32s3/esp_rom_caps.h +++ b/components/esp_rom/esp32s3/esp_rom_caps.h @@ -22,10 +22,13 @@ #define ESP_ROM_HAS_LAYOUT_TABLE (1) // ROM has the layout table #define ESP_ROM_HAS_SPI_FLASH (1) // ROM has the implementation of SPI Flash driver #define ESP_ROM_HAS_ETS_PRINTF_BUG (1) // ROM has ets_printf bug when disable the ROM log either by eFuse or RTC storage register +#define ESP_ROM_HAS_NEWLIB (1) // ROM has newlib (at least parts of it) functions included #define ESP_ROM_HAS_NEWLIB_NANO_FORMAT (1) // ROM has the newlib nano version of formatting functions +#define ESP_ROM_HAS_NEWLIB_32BIT_TIME (1) // ROM was compiled with 32 bit time_t #define ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE (1) // ROM needs to set cache MMU size according to instruction and rodata for flash mmap #define ESP_ROM_RAM_APP_NEEDS_MMU_INIT (1) // ROM doesn't init cache MMU when it's a RAM APP, needs MMU hal to init #define ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG (1) // ROM api Cache_Count_Flash_Pages will return unexpected value #define ESP_ROM_HAS_CACHE_SUSPEND_WAITI_BUG (1) // ROM api Cache_Suspend_I/DCache and Cache_Freeze_I/DCache_Enable does not waiti #define ESP_ROM_HAS_CACHE_WRITEBACK_BUG (1) // ROM api Cache_WriteBack_Addr address or size misalignment may cause cache hit with wrong value. #define ESP_ROM_HAS_SW_FLOAT (1) // ROM has libgcc software floating point emulation functions +#define ESP_ROM_HAS_VERSION (1) // ROM has version/eco information diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index b8cb6f39f8..ee709b79f9 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -243,29 +243,6 @@ PROVIDE( spi_flash_hal_erase_block = 0x40000d8c ); PROVIDE( spi_flash_hal_program_page = 0x40000d98 ); PROVIDE( spi_flash_hal_set_write_protect = 0x40000da4 ); PROVIDE( spi_flash_hal_host_idle = 0x40000db0 ); -PROVIDE( wdt_hal_init = 0x40000dbc ); -PROVIDE( wdt_hal_deinit = 0x40000dc8 ); -PROVIDE( wdt_hal_config_stage = 0x40000dd4 ); -PROVIDE( wdt_hal_write_protect_disable = 0x40000de0 ); -PROVIDE( wdt_hal_write_protect_enable = 0x40000dec ); -PROVIDE( wdt_hal_enable = 0x40000df8 ); -PROVIDE( wdt_hal_disable = 0x40000e04 ); -PROVIDE( wdt_hal_handle_intr = 0x40000e10 ); -PROVIDE( wdt_hal_feed = 0x40000e1c ); -PROVIDE( wdt_hal_set_flashboot_en = 0x40000e28 ); -PROVIDE( wdt_hal_is_enabled = 0x40000e34 ); -PROVIDE( systimer_hal_get_counter_value = 0x40000e40 ); -PROVIDE( systimer_hal_get_time = 0x40000e4c ); -PROVIDE( systimer_hal_set_alarm_target = 0x40000e58 ); -PROVIDE( systimer_hal_set_alarm_period = 0x40000e64 ); -PROVIDE( systimer_hal_get_alarm_value = 0x40000e70 ); -PROVIDE( systimer_hal_enable_alarm_int = 0x40000e7c ); -PROVIDE( systimer_hal_on_apb_freq_update = 0x40000e88 ); -PROVIDE( systimer_hal_counter_value_advance = 0x40000e94 ); -PROVIDE( systimer_hal_enable_counter = 0x40000ea0 ); -PROVIDE( systimer_hal_init = 0x40000eac ); -PROVIDE( systimer_hal_select_alarm_mode = 0x40000eb8 ); -PROVIDE( systimer_hal_connect_alarm_counter = 0x40000ec4 ); /*************************************** diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.systimer.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.systimer.ld new file mode 100644 index 0000000000..a2f2805ba8 --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.systimer.ld @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +PROVIDE( systimer_hal_get_counter_value = 0x40000e40 ); +PROVIDE( systimer_hal_get_time = 0x40000e4c ); +PROVIDE( systimer_hal_set_alarm_target = 0x40000e58 ); +PROVIDE( systimer_hal_set_alarm_period = 0x40000e64 ); +PROVIDE( systimer_hal_get_alarm_value = 0x40000e70 ); +PROVIDE( systimer_hal_enable_alarm_int = 0x40000e7c ); +PROVIDE( systimer_hal_on_apb_freq_update = 0x40000e88 ); +PROVIDE( systimer_hal_counter_value_advance = 0x40000e94 ); +PROVIDE( systimer_hal_enable_counter = 0x40000ea0 ); +PROVIDE( systimer_hal_init = 0x40000eac ); +PROVIDE( systimer_hal_select_alarm_mode = 0x40000eb8 ); +PROVIDE( systimer_hal_connect_alarm_counter = 0x40000ec4 ); diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld new file mode 100644 index 0000000000..f5ebc61f8f --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.wdt.ld @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +PROVIDE( wdt_hal_init = 0x40000dbc ); +PROVIDE( wdt_hal_deinit = 0x40000dc8 ); +PROVIDE( wdt_hal_config_stage = 0x40000dd4 ); +PROVIDE( wdt_hal_write_protect_disable = 0x40000de0 ); +PROVIDE( wdt_hal_write_protect_enable = 0x40000dec ); +PROVIDE( wdt_hal_enable = 0x40000df8 ); +PROVIDE( wdt_hal_disable = 0x40000e04 ); +PROVIDE( wdt_hal_handle_intr = 0x40000e10 ); +PROVIDE( wdt_hal_feed = 0x40000e1c ); +PROVIDE( wdt_hal_set_flashboot_en = 0x40000e28 ); +PROVIDE( wdt_hal_is_enabled = 0x40000e34 ); diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 6e2462ab59..d98620c6e3 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -422,7 +422,6 @@ components/esp_rom/esp32/ld/esp32.rom.newlib-locale.ld components/esp_rom/esp32/ld/esp32.rom.newlib-nano.ld components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld components/esp_rom/esp32/ld/esp32.rom.redefined.ld -components/esp_rom/esp32/ld/esp32.rom.spiflash.ld components/esp_rom/esp32/ld/esp32.rom.syscalls.ld components/esp_rom/esp32c3/ld/esp32c3.rom.api.ld components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld @@ -437,7 +436,6 @@ components/esp_rom/esp32s2/ld/esp32s2.rom.libgcc.ld components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-data.ld components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-funcs.ld components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-nano.ld -components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld components/esp_rom/esp32s3/ld/esp32s3.rom.ld components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld