2020-09-18 09:23:28 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
|
|
|
set(requires soc)
|
2021-03-19 12:03:13 +00:00
|
|
|
set(priv_requires efuse bootloader_support spi_flash)
|
2020-09-18 09:23:28 +00:00
|
|
|
if(${target} STREQUAL "esp32")
|
|
|
|
list(APPEND requires efuse)
|
|
|
|
endif()
|
|
|
|
|
2020-11-23 07:35:09 +00:00
|
|
|
set(srcs "compare_set.c" "cpu_util.c")
|
|
|
|
if(NOT BOOTLOADER_BUILD)
|
2021-03-10 13:39:29 +00:00
|
|
|
list(APPEND srcs "esp_async_memcpy.c"
|
|
|
|
"esp_clk.c"
|
|
|
|
"clk_ctrl_os.c"
|
|
|
|
"hw_random.c"
|
|
|
|
"intr_alloc.c"
|
2021-03-10 13:55:49 +00:00
|
|
|
"mac_addr.c"
|
2021-03-30 06:50:27 +00:00
|
|
|
"sleep_modes.c"
|
|
|
|
"regi2c_ctrl.c")
|
2021-08-03 06:35:29 +00:00
|
|
|
list(APPEND requires esp_ipc)
|
2021-02-07 07:03:51 +00:00
|
|
|
else()
|
|
|
|
# Requires "_esp_error_check_failed()" function
|
|
|
|
list(APPEND priv_requires "esp_system")
|
2021-02-18 13:09:27 +00:00
|
|
|
endif()
|
|
|
|
|
2020-11-23 07:35:09 +00:00
|
|
|
idf_component_register(SRCS ${srcs}
|
2021-03-03 10:21:07 +00:00
|
|
|
INCLUDE_DIRS include include/soc include/soc/${target}
|
2021-03-10 13:32:47 +00:00
|
|
|
PRIV_INCLUDE_DIRS port/include
|
2020-09-18 09:23:28 +00:00
|
|
|
REQUIRES ${requires}
|
2021-03-19 12:03:13 +00:00
|
|
|
PRIV_REQUIRES "${priv_requires}"
|
2020-09-25 07:23:52 +00:00
|
|
|
LDFRAGMENTS linker.lf)
|
|
|
|
|
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
add_subdirectory(port/${target})
|
2021-03-19 07:54:30 +00:00
|
|
|
|
2021-07-15 09:23:15 +00:00
|
|
|
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)
|
2021-03-19 07:54:30 +00:00
|
|
|
endif()
|
|
|
|
endif()
|