2019-04-28 15:38:23 +08:00
|
|
|
set(priv_requires bootloader_support soc)
|
2019-11-28 09:20:00 +08:00
|
|
|
|
2018-01-12 13:49:13 +11:00
|
|
|
if(BOOTLOADER_BUILD)
|
2019-10-22 13:51:49 +11:00
|
|
|
if (CONFIG_IDF_TARGET_ESP32)
|
|
|
|
# ESP32 Bootloader needs SPIUnlock from this file, but doesn't
|
|
|
|
# need other parts of this component
|
2019-11-05 13:10:03 +08:00
|
|
|
set(srcs "esp32/spi_flash_rom_patch.c")
|
2019-10-22 13:51:49 +11:00
|
|
|
else()
|
|
|
|
# but on other platforms no source files are needed for bootloader
|
|
|
|
set(srcs)
|
|
|
|
endif()
|
2019-09-05 13:11:36 +08:00
|
|
|
set(cache_srcs "")
|
2018-01-12 13:49:13 +11:00
|
|
|
else()
|
2019-09-05 13:11:36 +08:00
|
|
|
set(cache_srcs
|
2019-06-21 14:29:32 +08:00
|
|
|
"cache_utils.c"
|
|
|
|
"flash_mmap.c"
|
|
|
|
"flash_ops.c"
|
2020-04-16 21:31:13 +10:00
|
|
|
"${IDF_TARGET}/flash_ops_${IDF_TARGET}.c"
|
2019-09-05 13:11:36 +08:00
|
|
|
)
|
|
|
|
set(srcs
|
2019-10-22 13:51:49 +11:00
|
|
|
"partition.c")
|
|
|
|
|
|
|
|
if (CONFIG_IDF_TARGET_ESP32)
|
|
|
|
list(APPEND srcs
|
2019-11-05 13:10:03 +08:00
|
|
|
"esp32/spi_flash_rom_patch.c")
|
2019-10-22 13:51:49 +11:00
|
|
|
endif()
|
|
|
|
|
2019-09-10 00:56:46 +08:00
|
|
|
# New implementation after IDF v4.0
|
2019-09-10 14:34:06 +08:00
|
|
|
list(APPEND srcs
|
2019-06-21 14:29:32 +08:00
|
|
|
"spi_flash_chip_drivers.c"
|
|
|
|
"spi_flash_chip_generic.c"
|
|
|
|
"spi_flash_chip_issi.c"
|
2020-03-19 22:49:25 +08:00
|
|
|
"spi_flash_chip_mxic.c"
|
2019-11-28 09:20:00 +08:00
|
|
|
"spi_flash_chip_gd.c"
|
|
|
|
"memspi_host_driver.c")
|
2019-10-22 13:51:49 +11:00
|
|
|
|
2019-11-28 09:20:00 +08:00
|
|
|
list(APPEND cache_srcs
|
2019-10-22 13:51:49 +11:00
|
|
|
"esp_flash_api.c"
|
|
|
|
"esp_flash_spi_init.c"
|
|
|
|
"spi_flash_os_func_app.c"
|
|
|
|
"spi_flash_os_func_noos.c")
|
2019-11-28 09:20:00 +08:00
|
|
|
|
2019-09-05 13:11:36 +08:00
|
|
|
list(APPEND srcs ${cache_srcs})
|
2020-04-27 14:29:54 +08:00
|
|
|
set(priv_requires bootloader_support app_update soc esp_ipc)
|
2018-01-12 13:49:13 +11:00
|
|
|
endif()
|
|
|
|
|
2019-04-28 15:38:23 +08:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
PRIV_REQUIRES "${priv_requires}"
|
|
|
|
INCLUDE_DIRS include
|
|
|
|
PRIV_INCLUDE_DIRS private_include
|
|
|
|
LDFRAGMENTS linker.lf)
|
2018-04-18 10:57:45 +08:00
|
|
|
|
2019-09-05 13:11:36 +08:00
|
|
|
# Avoid cache miss by unexpected inlineing when built by -Os
|
|
|
|
set_source_files_properties(${cache_srcs} PROPERTIES COMPILE_FLAGS
|
|
|
|
"-fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once")
|