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