hal: extract hal component from soc component

This commit is contained in:
Michael (XIAO Xufeng) 2020-08-08 20:15:27 +08:00
parent 5a9a42b079
commit 5425ef4ee4
222 changed files with 147 additions and 107 deletions

View File

@ -20,7 +20,7 @@ set(BOOTLOADER_BUILD 1)
include("${IDF_PATH}/tools/cmake/project.cmake")
set(common_req log esp_rom esp_common xtensa)
if(LEGACY_INCLUDE_COMMON_HEADERS)
list(APPEND common_req soc)
list(APPEND common_req soc hal)
endif()
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${common_req}")
idf_build_set_property(__OUTPUT_SDKCONFIG 0)

View File

@ -8,7 +8,7 @@ endif
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
CFLAGS =

View File

@ -24,6 +24,7 @@ if(BOOTLOADER_BUILD)
"src/${IDF_TARGET}/flash_encrypt.c"
"src/${IDF_TARGET}/bootloader_${IDF_TARGET}.c"
)
list(APPEND priv_requires hal)
else()
list(APPEND srcs
"src/idf/bootloader_sha.c")

View File

@ -44,7 +44,6 @@ if(IDF_TARGET STREQUAL "esp32s2")
"esp32s2/adc2_init_cal.c"
"spi_slave_hd.c"
"esp32s2/dac.c")
# currently only S2 beta has its own target-specific includes
list(APPEND includes "esp32s2/include")
endif()
@ -52,7 +51,7 @@ idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS ${includes}
PRIV_INCLUDE_DIRS "include/driver"
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
set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11)

View File

@ -527,7 +527,7 @@ static const esp_err_msg_t esp_err_msg_table[] = {
# ifdef ESP_ERR_FLASH_OP_TIMEOUT
ERR_TBL_IT(ESP_ERR_FLASH_OP_TIMEOUT), /* 24578 0x6002 */
# endif
// components/soc/include/hal/esp_flash_err.h
// components/hal/include/hal/esp_flash_err.h
# ifdef ESP_ERR_FLASH_NOT_INITIALISED
ERR_TBL_IT(ESP_ERR_FLASH_NOT_INITIALISED), /* 24579 0x6003 */
# endif

View File

@ -5,7 +5,7 @@ idf_component_register(SRCS "patches/esp_rom_crc.c"
"patches/esp_rom_uart.c"
INCLUDE_DIRS include
PRIV_INCLUDE_DIRS "${target}"
PRIV_REQUIRES soc)
PRIV_REQUIRES soc hal)
if(BOOTLOADER_BUILD)
set(scripts

View File

@ -34,6 +34,7 @@ INCLUDE_DIRS := \
esp_common/include \
bootloader_support/include \
app_update/include \
hal/include \
spi_flash/include \
wear_levelling/include \
)

View 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)

View 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