2020-09-18 05:23:28 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2022-12-02 01:54:27 -05: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 02:02:57 -04:00
|
|
|
set(requires soc)
|
2022-11-22 11:39:25 -05:00
|
|
|
# only esp_hw_support/adc_share_hw_ctrl.c requires efuse component
|
2022-04-16 02:02:57 -04:00
|
|
|
set(priv_requires efuse spi_flash bootloader_support)
|
2020-09-18 05:23:28 -04:00
|
|
|
|
2023-02-10 01:13:20 -05:00
|
|
|
if(${target} STREQUAL "esp32c6")
|
|
|
|
list(APPEND priv_requires hal)
|
|
|
|
endif()
|
|
|
|
|
2024-02-12 02:22:53 -05:00
|
|
|
set(srcs "cpu.c" "port/${IDF_TARGET}/esp_cpu_intr.c" "esp_memory_utils.c" "port/${IDF_TARGET}/cpu_region_protect.c")
|
2020-11-23 02:35:09 -05:00
|
|
|
if(NOT BOOTLOADER_BUILD)
|
2022-06-27 23:06:27 -04:00
|
|
|
list(APPEND srcs "esp_clk.c"
|
2021-03-10 08:39:29 -05:00
|
|
|
"clk_ctrl_os.c"
|
|
|
|
"hw_random.c"
|
|
|
|
"intr_alloc.c"
|
2021-03-10 08:55:49 -05:00
|
|
|
"mac_addr.c"
|
2022-03-24 09:33:36 -04:00
|
|
|
"periph_ctrl.c"
|
2023-06-30 08:26:14 -04:00
|
|
|
"revision.c"
|
2022-04-29 01:40:23 -04:00
|
|
|
"rtc_module.c"
|
2024-03-13 02:24:43 -04:00
|
|
|
"sleep_modem.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"
|
2023-07-06 03:52:21 -04:00
|
|
|
"sleep_event.c"
|
2022-07-20 23:47:09 -04:00
|
|
|
"regi2c_ctrl.c"
|
2023-02-02 01:25:18 -05:00
|
|
|
"esp_gpio_reserve.c"
|
2023-05-17 05:40:59 -04:00
|
|
|
"sar_periph_ctrl_common.c"
|
2022-12-28 02:04:51 -05:00
|
|
|
"port/${target}/io_mux.c"
|
2023-04-23 03:49:59 -04:00
|
|
|
"port/${target}/esp_clk_tree.c"
|
2023-09-08 02:54:45 -04:00
|
|
|
"port/esp_clk_tree_common.c"
|
2023-11-13 22:14:34 -05:00
|
|
|
"dma/esp_dma_utils.c"
|
|
|
|
"spi_share_hw_ctrl.c"
|
|
|
|
"spi_bus_lock.c")
|
2022-06-27 23:06:27 -04:00
|
|
|
|
2023-02-02 03:50:53 -05:00
|
|
|
if(CONFIG_SOC_ADC_SUPPORTED)
|
|
|
|
list(APPEND srcs "adc_share_hw_ctrl.c")
|
|
|
|
endif()
|
|
|
|
|
2024-01-09 03:15:52 -05:00
|
|
|
if(CONFIG_SOC_ISP_SHARE_CSI_BRG)
|
|
|
|
list(APPEND srcs "mipi_csi_share_hw_ctrl.c")
|
|
|
|
endif()
|
2023-02-14 01:33:16 -05:00
|
|
|
if(CONFIG_SOC_PAU_SUPPORTED)
|
2024-01-29 08:51:15 -05:00
|
|
|
list(APPEND srcs "sleep_retention.c"
|
|
|
|
"sleep_system_peripheral.c"
|
|
|
|
"sleep_clock.c"
|
|
|
|
"port/${target}/clock_retention_init.c"
|
|
|
|
)
|
2023-02-14 01:33:16 -05:00
|
|
|
endif()
|
|
|
|
|
2023-10-17 00:11:42 -04:00
|
|
|
# [refactor-todo]
|
2023-11-06 03:18:33 -05:00
|
|
|
list(APPEND priv_requires esp_driver_gpio # for GPIO and RTC (by sleep_gpio and sleep_modes)
|
2023-10-17 00:11:42 -04:00
|
|
|
esp_timer
|
|
|
|
esp_pm)
|
2022-01-28 06:47:04 -05:00
|
|
|
|
2023-09-08 02:54:45 -04:00
|
|
|
list(APPEND priv_requires esp_mm)
|
|
|
|
|
2022-02-28 05:30:36 -05:00
|
|
|
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
|
2022-01-18 04:34:15 -05:00
|
|
|
list(APPEND srcs "rtc_wdt.c")
|
|
|
|
endif()
|
|
|
|
|
2022-06-27 23:06:27 -04:00
|
|
|
if(CONFIG_SOC_GDMA_SUPPORTED)
|
2023-07-12 03:21:40 -04:00
|
|
|
list(APPEND srcs "dma/gdma.c")
|
2024-02-07 03:56:53 -05:00
|
|
|
if(CONFIG_SOC_GDMA_SUPPORT_SLEEP_RETENTION)
|
2023-11-17 04:27:37 -05:00
|
|
|
list(APPEND srcs "dma/gdma_sleep_retention.c")
|
|
|
|
endif()
|
2024-02-07 03:56:53 -05:00
|
|
|
if(CONFIG_SOC_GDMA_SUPPORT_ETM)
|
|
|
|
list(APPEND srcs "dma/gdma_etm.c")
|
|
|
|
endif()
|
2022-06-27 23:06:27 -04:00
|
|
|
endif()
|
|
|
|
|
2024-03-16 11:58:01 -04:00
|
|
|
if(CONFIG_SOC_GP_LDO_SUPPORTED)
|
2024-03-25 23:36:54 -04:00
|
|
|
list(APPEND srcs "ldo/esp_ldo_regulator.c")
|
2023-12-06 07:59:41 -05:00
|
|
|
endif()
|
|
|
|
|
2023-01-05 22:14:23 -05:00
|
|
|
if(CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED)
|
2022-09-13 06:47:08 -04:00
|
|
|
list(APPEND srcs "dma/esp_async_memcpy.c")
|
2023-07-12 03:21:40 -04: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 06:47:08 -04:00
|
|
|
|
2023-11-29 22:15:34 -05:00
|
|
|
if(CONFIG_SOC_DW_GDMA_SUPPORTED)
|
|
|
|
list(APPEND srcs "dma/dw_gdma.c")
|
|
|
|
endif()
|
|
|
|
|
2023-08-21 05:04:55 -04:00
|
|
|
if(CONFIG_SOC_DMA2D_SUPPORTED)
|
|
|
|
list(APPEND srcs "dma/dma2d.c")
|
|
|
|
endif()
|
|
|
|
|
2022-07-24 23:23:39 -04:00
|
|
|
if(CONFIG_SOC_SYSTIMER_SUPPORTED)
|
|
|
|
list(APPEND srcs "port/${target}/systimer.c")
|
|
|
|
endif()
|
|
|
|
|
2022-10-03 10:16:59 -04:00
|
|
|
if(CONFIG_SOC_HMAC_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_hmac.c")
|
|
|
|
endif()
|
|
|
|
|
2022-07-12 02:44:10 -04:00
|
|
|
if(CONFIG_SOC_ETM_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_etm.c")
|
|
|
|
endif()
|
|
|
|
|
2023-05-24 07:31:41 -04:00
|
|
|
if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_dpa_protection.c")
|
|
|
|
endif()
|
|
|
|
|
2022-11-04 02:17:47 -04:00
|
|
|
if(CONFIG_SOC_DIG_SIGN_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_ds.c")
|
|
|
|
endif()
|
|
|
|
|
2023-09-26 00:52:56 -04:00
|
|
|
if(CONFIG_SOC_KEY_MANAGER_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_key_mgr.c")
|
|
|
|
endif()
|
|
|
|
|
2023-02-14 01:25:31 -05:00
|
|
|
if(CONFIG_SOC_PAU_SUPPORTED)
|
2023-02-14 01:28:35 -05:00
|
|
|
list(APPEND srcs "port/pau_regdma.c"
|
|
|
|
"port/regdma_link.c")
|
2023-02-14 01:25:31 -05:00
|
|
|
endif()
|
|
|
|
|
2024-03-13 07:32:32 -04:00
|
|
|
if(CONFIG_SOC_MODEM_CLOCK_IS_INDEPENDENT AND CONFIG_SOC_MODEM_CLOCK_SUPPORTED)
|
2022-12-23 06:47:00 -05:00
|
|
|
list(APPEND srcs "modem_clock.c")
|
|
|
|
endif()
|
2023-01-05 02:24:08 -05:00
|
|
|
|
2023-04-04 03:49:45 -04:00
|
|
|
if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP)
|
2024-01-08 23:27:07 -05:00
|
|
|
list(APPEND srcs "mspi_timing_tuning.c")
|
2023-04-04 03:49:45 -04:00
|
|
|
if(CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY)
|
|
|
|
list(APPEND srcs "mspi_timing_by_mspi_delay.c")
|
|
|
|
endif()
|
2024-01-08 23:27:07 -05:00
|
|
|
if(CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_DQS)
|
|
|
|
list(APPEND srcs "mspi_timing_by_dqs.c")
|
|
|
|
endif()
|
2023-01-05 02:24:08 -05:00
|
|
|
endif()
|
|
|
|
|
2024-03-21 06:07:36 -04:00
|
|
|
if(CONFIG_SOC_RTC_FAST_MEM_SUPPORTED AND CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB)
|
2022-10-11 22:03:47 -04:00
|
|
|
list(APPEND srcs "sleep_wake_stub.c")
|
|
|
|
endif()
|
2023-07-27 03:10:50 -04:00
|
|
|
|
2023-09-04 05:20:36 -04:00
|
|
|
if(CONFIG_SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX OR CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX)
|
|
|
|
list(APPEND srcs "esp_clock_output.c")
|
|
|
|
endif()
|
|
|
|
|
2024-04-07 05:17:24 -04:00
|
|
|
if(CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION)
|
2024-01-01 22:16:55 -05:00
|
|
|
list(REMOVE_ITEM srcs
|
2024-04-08 05:12:27 -04:00
|
|
|
"sleep_gpio.c" # TODO: [ESP32C5] IDF-8638
|
|
|
|
"port/esp_clk_tree_common.c" # TODO: [ESP32C5] IDF-8638
|
2024-01-01 22:16:55 -05:00
|
|
|
)
|
|
|
|
endif()
|
2024-04-07 05:17:24 -04:00
|
|
|
if(CONFIG_IDF_TARGET_ESP32C5_MP_VERSION)
|
2024-01-01 22:16:55 -05:00
|
|
|
list(REMOVE_ITEM srcs
|
2024-04-08 05:12:27 -04:00
|
|
|
"sleep_modes.c" # TODO: [ESP32C5] IDF-8638
|
|
|
|
"sleep_modem.c" # TODO: [ESP32C5] IDF-8638
|
|
|
|
"sleep_wake_stub.c" # TODO: [ESP32C5] IDF-8638
|
|
|
|
"sleep_gpio.c" # TODO: [ESP32C5] IDF-8638
|
|
|
|
"port/esp_clk_tree_common.c" # TODO: [ESP32C5] IDF-8638
|
2024-01-01 22:16:55 -05:00
|
|
|
)
|
|
|
|
endif()
|
2024-03-13 02:24:43 -04:00
|
|
|
if(CONFIG_IDF_TARGET_ESP32C61) # TODO: [ESP32C61] IDF-9245, IDF-9247, IDF-9248
|
|
|
|
list(REMOVE_ITEM srcs
|
|
|
|
"sleep_cpu.c"
|
|
|
|
"sleep_modem.c"
|
|
|
|
"sleep_modes.c"
|
|
|
|
"sleep_wake_stub.c"
|
|
|
|
"sleep_gpio.c"
|
|
|
|
"port/esp_clk_tree_common.c"
|
|
|
|
)
|
|
|
|
endif()
|
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}
|
2024-03-16 11:58:01 -04:00
|
|
|
INCLUDE_DIRS include include/soc include/soc/${target} dma/include ldo/include
|
2022-01-05 01:08:37 -05:00
|
|
|
PRIV_INCLUDE_DIRS port/include include/esp_private
|
2020-09-18 05:23:28 -04:00
|
|
|
REQUIRES ${requires}
|
2021-03-19 08:03:13 -04:00
|
|
|
PRIV_REQUIRES "${priv_requires}"
|
2023-06-21 07:00:59 -04:00
|
|
|
LDFRAGMENTS linker.lf dma/linker.lf)
|
2020-09-25 03:23:52 -04:00
|
|
|
|
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
add_subdirectory(port/${target})
|
2024-02-05 01:26:30 -05:00
|
|
|
add_subdirectory(lowpower)
|
2021-03-19 03:54:30 -04:00
|
|
|
|
2022-05-10 22:32:56 -04:00
|
|
|
if(NOT BOOTLOADER_BUILD)
|
|
|
|
if(CONFIG_SPIRAM)
|
|
|
|
idf_component_optional_requires(PRIVATE esp_psram)
|
2021-03-19 03:54:30 -04:00
|
|
|
endif()
|
2023-05-24 07:31:41 -04:00
|
|
|
if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PRIVATE "-u esp_crypto_dpa_prot_include_impl")
|
|
|
|
endif()
|
2021-03-19 03:54:30 -04:00
|
|
|
endif()
|