mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
hal: extract hal component from soc component
This commit is contained in:
@@ -20,7 +20,7 @@ set(BOOTLOADER_BUILD 1)
|
|||||||
include("${IDF_PATH}/tools/cmake/project.cmake")
|
include("${IDF_PATH}/tools/cmake/project.cmake")
|
||||||
set(common_req log esp_rom esp_common xtensa)
|
set(common_req log esp_rom esp_common xtensa)
|
||||||
if(LEGACY_INCLUDE_COMMON_HEADERS)
|
if(LEGACY_INCLUDE_COMMON_HEADERS)
|
||||||
list(APPEND common_req soc)
|
list(APPEND common_req soc hal)
|
||||||
endif()
|
endif()
|
||||||
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${common_req}")
|
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${common_req}")
|
||||||
idf_build_set_property(__OUTPUT_SDKCONFIG 0)
|
idf_build_set_property(__OUTPUT_SDKCONFIG 0)
|
||||||
|
@@ -8,7 +8,7 @@ endif
|
|||||||
|
|
||||||
PROJECT_NAME := bootloader
|
PROJECT_NAME := bootloader
|
||||||
|
|
||||||
COMPONENTS := esptool_py bootloader_support log spi_flash micro-ecc soc main efuse esp_rom
|
COMPONENTS := esptool_py bootloader_support log spi_flash micro-ecc soc main efuse esp_rom hal
|
||||||
|
|
||||||
# Clear C and CXX from top level project
|
# Clear C and CXX from top level project
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
|
@@ -24,6 +24,7 @@ if(BOOTLOADER_BUILD)
|
|||||||
"src/${IDF_TARGET}/flash_encrypt.c"
|
"src/${IDF_TARGET}/flash_encrypt.c"
|
||||||
"src/${IDF_TARGET}/bootloader_${IDF_TARGET}.c"
|
"src/${IDF_TARGET}/bootloader_${IDF_TARGET}.c"
|
||||||
)
|
)
|
||||||
|
list(APPEND priv_requires hal)
|
||||||
else()
|
else()
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"src/idf/bootloader_sha.c")
|
"src/idf/bootloader_sha.c")
|
||||||
|
@@ -44,7 +44,6 @@ if(IDF_TARGET STREQUAL "esp32s2")
|
|||||||
"esp32s2/adc2_init_cal.c"
|
"esp32s2/adc2_init_cal.c"
|
||||||
"spi_slave_hd.c"
|
"spi_slave_hd.c"
|
||||||
"esp32s2/dac.c")
|
"esp32s2/dac.c")
|
||||||
# currently only S2 beta has its own target-specific includes
|
|
||||||
list(APPEND includes "esp32s2/include")
|
list(APPEND includes "esp32s2/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ idf_component_register(SRCS "${srcs}"
|
|||||||
INCLUDE_DIRS ${includes}
|
INCLUDE_DIRS ${includes}
|
||||||
PRIV_INCLUDE_DIRS "include/driver"
|
PRIV_INCLUDE_DIRS "include/driver"
|
||||||
PRIV_REQUIRES efuse esp_timer esp_ipc
|
PRIV_REQUIRES efuse esp_timer esp_ipc
|
||||||
REQUIRES esp_ringbuf freertos soc) #cannot totally hide soc headers, since there are a lot arguments in the driver are chip-dependent
|
REQUIRES esp_ringbuf freertos soc hal) # cannot totally hide soc headers, since there are a lot arguments in the driver are chip-dependent
|
||||||
|
|
||||||
# uses C11 atomic feature
|
# uses C11 atomic feature
|
||||||
set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11)
|
set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11)
|
||||||
|
@@ -527,7 +527,7 @@ static const esp_err_msg_t esp_err_msg_table[] = {
|
|||||||
# ifdef ESP_ERR_FLASH_OP_TIMEOUT
|
# ifdef ESP_ERR_FLASH_OP_TIMEOUT
|
||||||
ERR_TBL_IT(ESP_ERR_FLASH_OP_TIMEOUT), /* 24578 0x6002 */
|
ERR_TBL_IT(ESP_ERR_FLASH_OP_TIMEOUT), /* 24578 0x6002 */
|
||||||
# endif
|
# endif
|
||||||
// components/soc/include/hal/esp_flash_err.h
|
// components/hal/include/hal/esp_flash_err.h
|
||||||
# ifdef ESP_ERR_FLASH_NOT_INITIALISED
|
# ifdef ESP_ERR_FLASH_NOT_INITIALISED
|
||||||
ERR_TBL_IT(ESP_ERR_FLASH_NOT_INITIALISED), /* 24579 0x6003 */
|
ERR_TBL_IT(ESP_ERR_FLASH_NOT_INITIALISED), /* 24579 0x6003 */
|
||||||
# endif
|
# endif
|
||||||
|
@@ -5,7 +5,7 @@ idf_component_register(SRCS "patches/esp_rom_crc.c"
|
|||||||
"patches/esp_rom_uart.c"
|
"patches/esp_rom_uart.c"
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
PRIV_INCLUDE_DIRS "${target}"
|
PRIV_INCLUDE_DIRS "${target}"
|
||||||
PRIV_REQUIRES soc)
|
PRIV_REQUIRES soc hal)
|
||||||
|
|
||||||
if(BOOTLOADER_BUILD)
|
if(BOOTLOADER_BUILD)
|
||||||
set(scripts
|
set(scripts
|
||||||
|
@@ -34,6 +34,7 @@ INCLUDE_DIRS := \
|
|||||||
esp_common/include \
|
esp_common/include \
|
||||||
bootloader_support/include \
|
bootloader_support/include \
|
||||||
app_update/include \
|
app_update/include \
|
||||||
|
hal/include \
|
||||||
spi_flash/include \
|
spi_flash/include \
|
||||||
wear_levelling/include \
|
wear_levelling/include \
|
||||||
)
|
)
|
||||||
|
73
components/hal/CMakeLists.txt
Normal file
73
components/hal/CMakeLists.txt
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
|
set(srcs "wdt_hal_iram.c"
|
||||||
|
"mpu_hal.c")
|
||||||
|
set(includes "${target}/include" "include")
|
||||||
|
|
||||||
|
if(NOT BOOTLOADER_BUILD)
|
||||||
|
list(APPEND srcs
|
||||||
|
"cpu_hal.c"
|
||||||
|
"rmt_hal.c"
|
||||||
|
"rtc_io_hal.c"
|
||||||
|
"dac_hal.c"
|
||||||
|
"adc_hal.c"
|
||||||
|
"spi_hal.c"
|
||||||
|
"spi_hal_iram.c"
|
||||||
|
"spi_slave_hal.c"
|
||||||
|
"spi_slave_hal_iram.c"
|
||||||
|
"touch_sensor_hal.c"
|
||||||
|
"pcnt_hal.c"
|
||||||
|
"i2s_hal.c"
|
||||||
|
"sigmadelta_hal.c"
|
||||||
|
"timer_hal.c"
|
||||||
|
"ledc_hal.c"
|
||||||
|
"ledc_hal_iram.c"
|
||||||
|
"i2c_hal.c"
|
||||||
|
"i2c_hal_iram.c"
|
||||||
|
"gpio_hal.c"
|
||||||
|
"uart_hal.c"
|
||||||
|
"uart_hal_iram.c"
|
||||||
|
"spi_flash_hal.c"
|
||||||
|
"spi_flash_hal_iram.c"
|
||||||
|
"soc_hal.c"
|
||||||
|
"twai_hal.c")
|
||||||
|
|
||||||
|
if(${target} STREQUAL "esp32")
|
||||||
|
list(APPEND srcs
|
||||||
|
"mcpwm_hal.c"
|
||||||
|
"sdio_slave_hal.c"
|
||||||
|
"esp32/adc_hal.c"
|
||||||
|
"esp32/brownout_hal.c"
|
||||||
|
"esp32/touch_sensor_hal.c")
|
||||||
|
if(NOT BOOTLOADER_BUILD AND CONFIG_ETH_USE_ESP32_EMAC)
|
||||||
|
list(APPEND srcs "esp32/emac_hal.c")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${target} STREQUAL "esp32s2")
|
||||||
|
list(APPEND srcs
|
||||||
|
"spi_flash_hal_gpspi.c"
|
||||||
|
"spi_slave_hd_hal.c"
|
||||||
|
"esp32s2/adc_hal.c"
|
||||||
|
"esp32s2/brownout_hal.c"
|
||||||
|
"esp32s2/cp_dma_hal.c"
|
||||||
|
"esp32s2/systimer_hal.c"
|
||||||
|
"esp32s2/touch_sensor_hal.c"
|
||||||
|
"esp32s2/usb_hal.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${target} STREQUAL "esp32s3")
|
||||||
|
list(APPEND srcs
|
||||||
|
"esp32s3/brownout_hal.c"
|
||||||
|
"esp32s3/systimer_hal.c"
|
||||||
|
"esp32s3/touch_sensor_hal.c")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
idf_component_register(SRCS ${srcs}
|
||||||
|
INCLUDE_DIRS ${includes}
|
||||||
|
PRIV_INCLUDE_DIRS ${priv_include}
|
||||||
|
REQUIRES soc
|
||||||
|
LDFRAGMENTS linker.lf)
|
||||||
|
|
||||||
|
|
10
components/hal/component.mk
Normal file
10
components/hal/component.mk
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
COMPONENT_SRCDIRS := . esp32
|
||||||
|
COMPONENT_ADD_INCLUDEDIRS := esp32/include include
|
||||||
|
COMPONENT_ADD_LDFRAGMENTS += linker.lf
|
||||||
|
|
||||||
|
COMPONENT_OBJEXCLUDE += ./spi_slave_hd_hal.o ./spi_flash_hal_gpspi.o ./spi_slave_hd_hal.o
|
||||||
|
|
||||||
|
ifndef CONFIG_ETH_USE_ESP32_EMAC
|
||||||
|
COMPONENT_OBJEXCLUDE += esp32/emac_hal.o
|
||||||
|
endif
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user