85cb079838
In c4bcf111, soc_memory_types.h header was moved from soc to
esp_hw_support. Since some of the functions are also used in
bootloader and because esp_hw_support is not part of the bootloader
build, part of the functions were moved into bootloader_support.
To make these functions available to the app, bootloader_support was
added as a public dependency of esp_hw_support.
Since esp_hw_support is in common requirements list, this has added
bootloader_support as a public requirement to every component in the
build. Adding new public requirements outside of common components
is undesirable, since components may accidentally include headers
from bootloader_support without explicitly declaring it as a
requirement.
This commit reverts this addition. Until a better solution is found,
some part of esp_memory_utils.h is duplicated into
bootloader_memory_utils.h. A CI check is added to make sure these
files stay in sync.
68 lines
2.9 KiB
CMake
68 lines
2.9 KiB
CMake
idf_build_get_property(target IDF_TARGET)
|
|
|
|
set(requires soc)
|
|
set(priv_requires efuse spi_flash bootloader_support)
|
|
|
|
set(srcs "compare_set.c" "cpu_util.c" "esp_memory_utils.c")
|
|
if(NOT BOOTLOADER_BUILD)
|
|
list(APPEND srcs "esp_async_memcpy.c"
|
|
"esp_clk.c"
|
|
"clk_ctrl_os.c"
|
|
"hw_random.c"
|
|
"intr_alloc.c"
|
|
"mac_addr.c"
|
|
"periph_ctrl.c"
|
|
"sleep_modes.c"
|
|
"sleep_gpio.c"
|
|
"sleep_mac_bb.c"
|
|
"regi2c_ctrl.c")
|
|
if(NOT CONFIG_IDF_TARGET_ESP32 AND NOT CONFIG_IDF_TARGET_ESP32S2)
|
|
list(APPEND srcs "sleep_retention.c")
|
|
endif()
|
|
|
|
# [refactor-todo]: requires "driver" for GPIO and RTC (by sleep_gpio and sleep_modes)
|
|
list(APPEND priv_requires driver)
|
|
|
|
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
|
|
list(APPEND srcs "rtc_wdt.c")
|
|
endif()
|
|
|
|
else()
|
|
# Requires "_esp_error_check_failed()" function
|
|
list(APPEND priv_requires "esp_system")
|
|
endif()
|
|
|
|
idf_component_register(SRCS ${srcs}
|
|
INCLUDE_DIRS include include/soc include/soc/${target}
|
|
PRIV_INCLUDE_DIRS port/include include/esp_private
|
|
REQUIRES ${requires}
|
|
PRIV_REQUIRES "${priv_requires}"
|
|
LDFRAGMENTS linker.lf)
|
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
add_subdirectory(port/${target})
|
|
|
|
if(CONFIG_IDF_TARGET_ESP32 AND CONFIG_SPIRAM_CACHE_WORKAROUND AND NOT BOOTLOADER_BUILD)
|
|
# Note: Adding as a PUBLIC compile option here causes this option to propagate to all
|
|
# components that depend on esp32.
|
|
#
|
|
# To handle some corner cases, the same flag is set in project_include.cmake
|
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-issue)
|
|
# also, make sure we link with this option so correct toolchain libs are pulled in
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-issue)
|
|
# set strategy selected
|
|
# note that we don't need to set link options as the library linked is independent of this
|
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST)
|
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=dupldst)
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=dupldst)
|
|
endif()
|
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW)
|
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=memw)
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=memw)
|
|
endif()
|
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS)
|
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=nops)
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=nops)
|
|
endif()
|
|
endif()
|