2020-09-18 17:23:28 +08:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2022-12-02 14:54:27 +08:00
|
|
|
# On Linux, we only support a few features, hence this simple component registration
|
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
idf_component_register(SRCS "port/linux/esp_random.c"
|
|
|
|
"port/linux/chip_info.c"
|
|
|
|
INCLUDE_DIRS "include")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2022-04-16 08:02:57 +02:00
|
|
|
set(requires soc)
|
2022-11-23 00:39:25 +08:00
|
|
|
# only esp_hw_support/adc_share_hw_ctrl.c requires efuse component
|
2022-04-16 08:02:57 +02:00
|
|
|
set(priv_requires efuse spi_flash bootloader_support)
|
2020-09-18 17:23:28 +08:00
|
|
|
|
2023-02-10 14:13:20 +08:00
|
|
|
if(${target} STREQUAL "esp32c6")
|
|
|
|
list(APPEND priv_requires hal)
|
|
|
|
endif()
|
|
|
|
|
2023-02-22 17:14:42 +05:30
|
|
|
set(srcs "cpu.c" "esp_memory_utils.c" "port/${IDF_TARGET}/cpu_region_protect.c")
|
2020-11-23 15:35:09 +08:00
|
|
|
if(NOT BOOTLOADER_BUILD)
|
2022-06-28 11:06:27 +08:00
|
|
|
list(APPEND srcs "esp_clk.c"
|
2021-03-10 21:39:29 +08:00
|
|
|
"clk_ctrl_os.c"
|
|
|
|
"hw_random.c"
|
|
|
|
"intr_alloc.c"
|
2021-03-10 21:55:49 +08:00
|
|
|
"mac_addr.c"
|
2022-03-24 21:33:36 +08:00
|
|
|
"periph_ctrl.c"
|
2023-06-30 13:26:14 +01:00
|
|
|
"revision.c"
|
2022-04-29 13:40:23 +08:00
|
|
|
"rtc_module.c"
|
2021-03-30 14:50:27 +08:00
|
|
|
"sleep_modes.c"
|
2021-08-19 21:57:17 +08:00
|
|
|
"sleep_gpio.c"
|
2023-07-06 15:52:21 +08:00
|
|
|
"sleep_event.c"
|
2022-11-14 21:36:23 +08:00
|
|
|
"sleep_modem.c"
|
2022-07-21 11:47:09 +08:00
|
|
|
"regi2c_ctrl.c"
|
2023-02-02 14:25:18 +08:00
|
|
|
"esp_gpio_reserve.c"
|
2023-05-17 17:40:59 +08:00
|
|
|
"sar_periph_ctrl_common.c"
|
2022-12-28 15:04:51 +08:00
|
|
|
"port/${target}/io_mux.c"
|
2023-04-23 15:49:59 +08:00
|
|
|
"port/${target}/esp_clk_tree.c"
|
2023-09-08 14:54:45 +08:00
|
|
|
"port/esp_clk_tree_common.c"
|
|
|
|
"dma/esp_dma_utils.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
|
2023-02-02 16:50:53 +08:00
|
|
|
if(CONFIG_SOC_ADC_SUPPORTED)
|
|
|
|
list(APPEND srcs "adc_share_hw_ctrl.c")
|
|
|
|
endif()
|
|
|
|
|
2023-01-12 18:08:14 +08:00
|
|
|
if(CONFIG_SOC_PM_SUPPORT_CPU_PD)
|
|
|
|
list(APPEND srcs "sleep_cpu.c")
|
2021-08-20 15:15:58 +08:00
|
|
|
endif()
|
2022-01-28 19:47:04 +08:00
|
|
|
|
2023-02-14 14:33:16 +08:00
|
|
|
if(CONFIG_SOC_PAU_SUPPORTED)
|
2023-02-15 16:35:23 +08:00
|
|
|
list(APPEND srcs "sleep_retention.c" "sleep_system_peripheral.c" "sleep_clock.c")
|
2023-02-14 14:33:16 +08:00
|
|
|
endif()
|
|
|
|
|
2022-01-28 19:47:04 +08:00
|
|
|
# [refactor-todo]: requires "driver" for GPIO and RTC (by sleep_gpio and sleep_modes)
|
2022-04-16 11:32:22 +02:00
|
|
|
list(APPEND priv_requires driver esp_timer)
|
2022-01-28 19:47:04 +08:00
|
|
|
|
2023-09-08 14:54:45 +08:00
|
|
|
list(APPEND priv_requires esp_mm)
|
|
|
|
|
2022-02-28 18:30:36 +08:00
|
|
|
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
|
2022-01-18 17:34:15 +08:00
|
|
|
list(APPEND srcs "rtc_wdt.c")
|
|
|
|
endif()
|
|
|
|
|
2022-06-28 11:06:27 +08:00
|
|
|
if(CONFIG_SOC_GDMA_SUPPORTED)
|
2023-07-12 15:21:40 +08:00
|
|
|
list(APPEND srcs "dma/gdma.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
2023-01-06 11:14:23 +08:00
|
|
|
if(CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED)
|
2022-09-13 18:47:08 +08:00
|
|
|
list(APPEND srcs "dma/esp_async_memcpy.c")
|
2023-07-12 15:21:40 +08:00
|
|
|
if(CONFIG_SOC_GDMA_SUPPORTED)
|
|
|
|
list(APPEND srcs "dma/async_memcpy_gdma.c")
|
|
|
|
endif() # CONFIG_SOC_GDMA_SUPPORTED
|
|
|
|
if(CONFIG_SOC_CP_DMA_SUPPORTED)
|
|
|
|
list(APPEND srcs "dma/async_memcpy_cp_dma.c")
|
|
|
|
endif() # CONFIG_SOC_CP_DMA_SUPPORTED
|
|
|
|
endif() # CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED
|
2022-09-13 18:47:08 +08:00
|
|
|
|
|
|
|
if(CONFIG_SOC_GDMA_SUPPORT_ETM)
|
|
|
|
list(APPEND srcs "dma/gdma_etm.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
2022-07-25 11:23:39 +08:00
|
|
|
if(CONFIG_SOC_SYSTIMER_SUPPORTED)
|
|
|
|
list(APPEND srcs "port/${target}/systimer.c")
|
|
|
|
endif()
|
|
|
|
|
2022-10-03 19:46:59 +05:30
|
|
|
if(CONFIG_SOC_HMAC_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_hmac.c")
|
|
|
|
endif()
|
|
|
|
|
2022-07-12 14:44:10 +08:00
|
|
|
if(CONFIG_SOC_ETM_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_etm.c")
|
|
|
|
endif()
|
|
|
|
|
2023-05-24 17:01:41 +05:30
|
|
|
if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_dpa_protection.c")
|
|
|
|
endif()
|
|
|
|
|
2022-11-04 11:47:47 +05:30
|
|
|
if(CONFIG_SOC_DIG_SIGN_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_ds.c")
|
|
|
|
endif()
|
|
|
|
|
2023-02-14 14:25:31 +08:00
|
|
|
if(CONFIG_SOC_PAU_SUPPORTED)
|
2023-02-14 14:28:35 +08:00
|
|
|
list(APPEND srcs "port/pau_regdma.c"
|
|
|
|
"port/regdma_link.c")
|
2023-02-14 14:25:31 +08:00
|
|
|
endif()
|
|
|
|
|
2023-01-11 14:12:40 +08:00
|
|
|
if(CONFIG_SOC_PM_CPU_RETENTION_BY_SW)
|
|
|
|
list(APPEND srcs "sleep_cpu_asm.S")
|
|
|
|
set_property(TARGET ${COMPONENT_LIB}
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u rv_core_critical_regs_save")
|
|
|
|
set_property(TARGET ${COMPONENT_LIB}
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u rv_core_critical_regs_restore")
|
|
|
|
endif()
|
|
|
|
|
2022-12-23 19:47:00 +08:00
|
|
|
if(CONFIG_SOC_MODEM_CLOCK_IS_INDEPENDENT)
|
|
|
|
list(APPEND srcs "modem_clock.c")
|
|
|
|
endif()
|
2023-01-05 15:24:08 +08:00
|
|
|
|
2023-04-04 15:49:45 +08:00
|
|
|
if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP)
|
|
|
|
list(APPEND srcs "mspi_timing_tuning.c" "mspi_timing_config.c")
|
|
|
|
if(CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY)
|
|
|
|
list(APPEND srcs "mspi_timing_by_mspi_delay.c")
|
|
|
|
endif()
|
2023-01-05 15:24:08 +08:00
|
|
|
endif()
|
|
|
|
|
2022-10-12 10:03:47 +08:00
|
|
|
if(CONFIG_SOC_RTC_FAST_MEM_SUPPORTED)
|
|
|
|
list(APPEND srcs "sleep_wake_stub.c")
|
|
|
|
endif()
|
2023-07-27 15:10:50 +08:00
|
|
|
|
|
|
|
if(CONFIG_IDF_TARGET_ESP32P4)
|
|
|
|
list(REMOVE_ITEM srcs
|
|
|
|
"sleep_cpu.c" # TODO: IDF-7528, IDF-7529
|
|
|
|
"sleep_modes.c" # TODO: IDF-7528, IDF-7529
|
|
|
|
"sleep_wake_stub.c" # TODO: IDF-7529
|
|
|
|
"sleep_gpio.c" # TODO: IDF-7528, IDF-7529
|
|
|
|
"port/esp_clk_tree_common.c" # TODO: IDF-7526
|
|
|
|
)
|
|
|
|
endif()
|
2021-02-07 15:03:51 +08:00
|
|
|
else()
|
|
|
|
# Requires "_esp_error_check_failed()" function
|
|
|
|
list(APPEND priv_requires "esp_system")
|
2021-02-18 21:09:27 +08:00
|
|
|
endif()
|
|
|
|
|
2020-11-23 15:35:09 +08:00
|
|
|
idf_component_register(SRCS ${srcs}
|
2021-03-03 18:21:07 +08:00
|
|
|
INCLUDE_DIRS include include/soc include/soc/${target}
|
2022-01-05 06:08:37 +00:00
|
|
|
PRIV_INCLUDE_DIRS port/include include/esp_private
|
2020-09-18 17:23:28 +08:00
|
|
|
REQUIRES ${requires}
|
2021-03-19 20:03:13 +08:00
|
|
|
PRIV_REQUIRES "${priv_requires}"
|
2023-06-21 19:00:59 +08:00
|
|
|
LDFRAGMENTS linker.lf dma/linker.lf)
|
2020-09-25 15:23:52 +08:00
|
|
|
|
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
add_subdirectory(port/${target})
|
2021-03-19 15:54:30 +08:00
|
|
|
|
2022-05-11 10:32:56 +08:00
|
|
|
if(NOT BOOTLOADER_BUILD)
|
|
|
|
if(CONFIG_SPIRAM)
|
|
|
|
idf_component_optional_requires(PRIVATE esp_psram)
|
2021-03-19 15:54:30 +08:00
|
|
|
endif()
|
2023-05-24 17:01:41 +05:30
|
|
|
if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PRIVATE "-u esp_crypto_dpa_prot_include_impl")
|
|
|
|
endif()
|
2021-03-19 15:54:30 +08:00
|
|
|
endif()
|