esp-idf/components/esp_hw_support/CMakeLists.txt

205 lines
6.8 KiB
CMake
Raw Normal View History

idf_build_get_property(target IDF_TARGET)
# 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()
set(requires soc)
# only esp_hw_support/adc_share_hw_ctrl.c requires efuse component
set(priv_requires efuse spi_flash bootloader_support)
if(${target} STREQUAL "esp32c6")
list(APPEND priv_requires hal)
endif()
set(srcs "cpu.c" "port/${IDF_TARGET}/esp_cpu_intr.c" "esp_memory_utils.c" "port/${IDF_TARGET}/cpu_region_protect.c")
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"
"mac_addr.c"
"periph_ctrl.c"
"revision.c"
"rtc_module.c"
"sleep_modem.c"
"sleep_modes.c"
"sleep_console.c"
"sleep_gpio.c"
"sleep_event.c"
"regi2c_ctrl.c"
2023-02-02 01:25:18 -05:00
"esp_gpio_reserve.c"
"sar_periph_ctrl_common.c"
"port/${target}/io_mux.c"
"port/${target}/esp_clk_tree.c"
"port/esp_clk_tree_common.c"
"dma/esp_dma_utils.c"
"spi_share_hw_ctrl.c"
"spi_bus_lock.c")
2022-06-27 23:06:27 -04:00
if(CONFIG_SOC_ADC_SUPPORTED)
list(APPEND srcs "adc_share_hw_ctrl.c")
endif()
if(CONFIG_SOC_ISP_SHARE_CSI_BRG)
list(APPEND srcs "mipi_csi_share_hw_ctrl.c")
endif()
if(CONFIG_SOC_PAU_SUPPORTED)
list(APPEND srcs "sleep_retention.c"
"sleep_system_peripheral.c"
"sleep_clock.c"
"port/${target}/clock_retention_init.c"
)
endif()
# [refactor-todo]
list(APPEND priv_requires esp_driver_gpio # for GPIO and RTC (by sleep_gpio and sleep_modes)
esp_timer
esp_pm)
list(APPEND priv_requires esp_mm)
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
list(APPEND srcs "rtc_wdt.c")
endif()
2022-06-27 23:06:27 -04:00
if(CONFIG_SOC_GDMA_SUPPORTED)
list(APPEND srcs "dma/gdma.c" "deprecated/gdma_legacy.c")
if(CONFIG_SOC_GDMA_SUPPORT_SLEEP_RETENTION)
list(APPEND srcs "dma/gdma_sleep_retention.c")
endif()
if(CONFIG_SOC_GDMA_SUPPORT_ETM)
list(APPEND srcs "dma/gdma_etm.c")
endif()
if(CONFIG_SOC_GDMA_SUPPORT_CRC)
list(APPEND srcs "dma/gdma_crc.c")
endif()
2022-06-27 23:06:27 -04:00
endif()
if(CONFIG_SOC_GP_LDO_SUPPORTED)
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")
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
if(CONFIG_SOC_DW_GDMA_SUPPORTED)
list(APPEND srcs "dma/dw_gdma.c")
endif()
if(CONFIG_SOC_DMA2D_SUPPORTED)
list(APPEND srcs "dma/dma2d.c")
endif()
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()
if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED)
list(APPEND srcs "esp_dpa_protection.c")
endif()
if(CONFIG_SOC_DIG_SIGN_SUPPORTED)
list(APPEND srcs "esp_ds.c")
endif()
if(CONFIG_SOC_KEY_MANAGER_SUPPORTED)
list(APPEND srcs "esp_key_mgr.c")
endif()
if(CONFIG_SOC_PAU_SUPPORTED)
list(APPEND srcs "port/pau_regdma.c"
"port/regdma_link.c")
endif()
if(CONFIG_SOC_MODEM_CLOCK_IS_INDEPENDENT AND CONFIG_SOC_MODEM_CLOCK_SUPPORTED)
list(APPEND srcs "modem_clock.c")
endif()
if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP)
list(APPEND srcs "mspi_timing_tuning.c")
if(CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY)
list(APPEND srcs "mspi_timing_by_mspi_delay.c")
endif()
if(CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_DQS)
list(APPEND srcs "mspi_timing_by_dqs.c")
endif()
endif()
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()
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)
list(REMOVE_ITEM srcs
"sleep_gpio.c" # TODO: [ESP32C5] IDF-8638
"port/esp_clk_tree_common.c" # TODO: [ESP32C5] IDF-8638
)
endif()
2024-04-07 05:17:24 -04:00
if(CONFIG_IDF_TARGET_ESP32C5_MP_VERSION)
list(REMOVE_ITEM srcs
"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
)
endif()
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()
else()
# Requires "_esp_error_check_failed()" function
list(APPEND priv_requires "esp_system")
2021-02-18 08:09:27 -05:00
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS include include/soc include/soc/${target} dma/include ldo/include
PRIV_INCLUDE_DIRS port/include include/esp_private
REQUIRES ${requires}
2021-03-19 08:03:13 -04:00
PRIV_REQUIRES "${priv_requires}"
LDFRAGMENTS linker.lf dma/linker.lf ldo/linker.lf)
idf_build_get_property(target IDF_TARGET)
add_subdirectory(port/${target})
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()
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()