diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c index eefcbfaf3f..10350bdc11 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c @@ -17,7 +17,7 @@ #include "soc/spi_reg.h" #include "soc/dport_reg.h" #include "soc/soc_caps.h" -#include "soc/soc_pins.h" +#include "soc/spi_pins.h" #include "soc/chip_revision.h" #include "hal/efuse_hal.h" #include "hal/gpio_hal.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c index 38bcb84ebf..553aed51fd 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c @@ -19,6 +19,7 @@ #include "bootloader_common.h" #include "bootloader_flash_priv.h" #include "bootloader_init.h" +#include "soc/spi_pins.h" #include "hal/mmu_hal.h" #include "hal/mmu_ll.h" #include "hal/cache_hal.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c index 98c346f5aa..107da83e9a 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c @@ -14,6 +14,7 @@ #include "esp32c3/rom/spi_flash.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c index f9b711496a..1d1ce7e209 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c @@ -17,6 +17,7 @@ #include "soc/efuse_reg.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c index 759bac5f9b..51b3195689 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c @@ -13,6 +13,7 @@ #include "esp32c6/rom/spi_flash.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c index e5331aaae2..b4863a925e 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c @@ -13,6 +13,7 @@ #include "esp32c61/rom/spi_flash.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c index f1b79e9b8e..0955677a62 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c @@ -13,6 +13,7 @@ #include "esp32h2/rom/spi_flash.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c index 16d28b31d1..c52086c38e 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c @@ -20,6 +20,7 @@ #include "hal/mspi_ll.h" #include "hal/clk_tree_ll.h" #include "soc/pcr_reg.h" +#include "soc/spi_pins.h" ESP_LOG_ATTR_TAG(TAG, "boot.esp32h21"); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c index c481590557..bfa209bd50 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c @@ -15,6 +15,7 @@ #include "rom/efuse.h" #include "soc/efuse_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c index 8722ac904b..b4cd6f98c0 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c @@ -12,6 +12,7 @@ #include "esp_rom_gpio.h" #include "soc/spi_pins.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" #include "bootloader_common.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c index 0139d5c98b..61d8a5f59c 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c @@ -16,6 +16,7 @@ #include "soc/io_mux_reg.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c index e24506db6e..3c321ff585 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c @@ -16,6 +16,7 @@ #include "soc/io_mux_reg.h" #include "soc/spi_reg.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_pins.h" #include "soc/soc_caps.h" #include "flash_qio_mode.h" #include "bootloader_flash_config.h" diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s31.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s31.c index 8c7a113791..68a7d14237 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s31.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s31.c @@ -10,6 +10,7 @@ #include "esp_err.h" #include "esp_log.h" #include "esp_rom_gpio.h" +#include "soc/spi_pins.h" #include "soc/gpio_periph.h" #include "soc/spi_mem_reg.h" #include "flash_qio_mode.h" diff --git a/components/bootloader_support/src/esp32/bootloader_esp32.c b/components/bootloader_support/src/esp32/bootloader_esp32.c index fef1057ef2..879f7c2ece 100644 --- a/components/bootloader_support/src/esp32/bootloader_esp32.c +++ b/components/bootloader_support/src/esp32/bootloader_esp32.c @@ -24,7 +24,6 @@ #include "soc/gpio_sig_map.h" #include "soc/io_mux_reg.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "hal/gpio_hal.h" #include "hal/mmu_hal.h" #include "xtensa/config/core.h" diff --git a/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c b/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c index 565a1891a4..3b8f422258 100644 --- a/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c +++ b/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c @@ -18,9 +18,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/extmem_reg.h" -#include "soc/io_mux_reg.h" #include "soc/system_reg.h" #include "esp32c2/rom/ets_sys.h" #include "esp32c2/rom/rtc.h" diff --git a/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c b/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c index 931f44999b..0b19b71221 100644 --- a/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c +++ b/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c @@ -19,9 +19,7 @@ #include "esp_cpu.h" #include "soc/rtc.h" #include "soc/rtc_cntl_reg.h" -#include "soc/spi_periph.h" #include "soc/extmem_reg.h" -#include "soc/io_mux_reg.h" #include "soc/system_reg.h" #include "soc/chip_revision.h" #include "esp32c3/rom/ets_sys.h" diff --git a/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c b/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c index ff5d6880fe..8c2f071534 100644 --- a/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c +++ b/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c @@ -19,9 +19,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/cache_reg.h" -#include "soc/io_mux_reg.h" #include "soc/pcr_reg.h" #include "esp32c5/rom/ets_sys.h" #include "esp32c5/rom/spi_flash.h" diff --git a/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c b/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c index 24264800d4..32947d8a00 100644 --- a/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c +++ b/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c @@ -18,9 +18,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/extmem_reg.h" -#include "soc/io_mux_reg.h" #include "soc/pcr_reg.h" #include "esp32c6/rom/ets_sys.h" #include "esp32c6/rom/spi_flash.h" diff --git a/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c b/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c index 32f26e8064..1e97936b48 100644 --- a/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c +++ b/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c @@ -18,9 +18,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/cache_reg.h" -#include "soc/io_mux_reg.h" #include "soc/pcr_reg.h" #include "esp32c61/rom/ets_sys.h" #include "esp32c61/rom/spi_flash.h" diff --git a/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c b/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c index dfbcf1765a..9e0eeab7ba 100644 --- a/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c +++ b/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c @@ -18,9 +18,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/extmem_reg.h" -#include "soc/io_mux_reg.h" #include "soc/pcr_reg.h" #include "esp32h2/rom/ets_sys.h" #include "bootloader_common.h" diff --git a/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c b/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c index 00e18f5d8e..483001bae1 100644 --- a/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c +++ b/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c @@ -18,9 +18,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/cache_reg.h" -#include "soc/io_mux_reg.h" #include "soc/pcr_reg.h" #include "rom/ets_sys.h" #include "bootloader_common.h" diff --git a/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c b/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c index 5676208792..70eb57c2af 100644 --- a/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c +++ b/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c @@ -18,9 +18,7 @@ #include "soc/assist_debug_reg.h" #include "esp_cpu.h" #include "soc/rtc.h" -#include "soc/spi_periph.h" #include "soc/cache_reg.h" -#include "soc/io_mux_reg.h" #include "esp32p4/rom/ets_sys.h" #include "esp32p4/rom/spi_flash.h" #include "bootloader_common.h" diff --git a/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c b/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c index 9773d971c8..07f921ce91 100644 --- a/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c +++ b/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c @@ -33,7 +33,6 @@ #include "soc/extmem_reg.h" #include "soc/rtc.h" #include "soc/rtc_cntl_reg.h" -#include "soc/spi_periph.h" #include "esp_efuse.h" #include "hal/mmu_hal.h" #include "hal/cache_hal.h" diff --git a/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c b/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c index fc6ffba135..d35158725e 100644 --- a/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c +++ b/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c @@ -17,7 +17,6 @@ #include "soc/dport_reg.h" #include "soc/rtc.h" #include "soc/rtc_cntl_reg.h" -#include "soc/spi_periph.h" #include "soc/extmem_reg.h" #include "esp_rom_gpio.h" diff --git a/components/driver/test_apps/components/test_driver_utils/include/test_spi_utils.h b/components/driver/test_apps/components/test_driver_utils/include/test_spi_utils.h index 08bc9835bd..e5da02e8aa 100644 --- a/components/driver/test_apps/components/test_driver_utils/include/test_spi_utils.h +++ b/components/driver/test_apps/components/test_driver_utils/include/test_spi_utils.h @@ -20,7 +20,7 @@ #include "param_test.h" #include "soc/io_mux_reg.h" #include "sdkconfig.h" -#include "soc/spi_periph.h" +#include "soc/spi_pins.h" #include "driver/spi_master.h" #include "test_dualboard_utils.h" diff --git a/components/driver/test_apps/components/test_driver_utils/test_spi_utils.c b/components/driver/test_apps/components/test_driver_utils/test_spi_utils.c index e4e3e9e69a..6f4e657d01 100644 --- a/components/driver/test_apps/components/test_driver_utils/test_spi_utils.c +++ b/components/driver/test_apps/components/test_driver_utils/test_spi_utils.c @@ -3,14 +3,15 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include "esp_log.h" #include "test_spi_utils.h" #include "driver/spi_slave.h" -#include "esp_log.h" +#include "soc/gpio_sig_map.h" #include "driver/gpio.h" #include "esp_private/gpio.h" -#include "esp_rom_gpio.h" -#include "hal/gpio_ll.h" +#include "soc/spi_periph.h" #include "hal/spi_ll.h" +#include "hal/gpio_ll.h" const char MASTER_TAG[] = "test_master"; const char SLAVE_TAG[] = "test_slave"; diff --git a/components/driver/touch_sensor/esp32s2/touch_sensor.c b/components/driver/touch_sensor/esp32s2/touch_sensor.c index e69dbd9fc1..be36b7a7f9 100644 --- a/components/driver/touch_sensor/esp32s2/touch_sensor.c +++ b/components/driver/touch_sensor/esp32s2/touch_sensor.c @@ -9,7 +9,6 @@ #include #include "esp_log.h" #include "sys/lock.h" -#include "soc/soc_pins.h" #include "soc/soc_caps.h" #include "soc/rtc_cntl_reg.h" #include "freertos/FreeRTOS.h" diff --git a/components/driver/touch_sensor/esp32s3/touch_sensor.c b/components/driver/touch_sensor/esp32s3/touch_sensor.c index f3254ace29..ea80a590bd 100644 --- a/components/driver/touch_sensor/esp32s3/touch_sensor.c +++ b/components/driver/touch_sensor/esp32s3/touch_sensor.c @@ -9,7 +9,6 @@ #include #include "esp_log.h" #include "sys/lock.h" -#include "soc/soc_pins.h" #include "soc/soc_caps.h" #include "soc/rtc_cntl_reg.h" #include "freertos/FreeRTOS.h" diff --git a/components/driver/touch_sensor/touch_sensor_common.c b/components/driver/touch_sensor/touch_sensor_common.c index c31aa040df..de119e5d1e 100644 --- a/components/driver/touch_sensor/touch_sensor_common.c +++ b/components/driver/touch_sensor/touch_sensor_common.c @@ -10,7 +10,6 @@ #include "esp_types.h" #include "esp_log.h" #include "sys/lock.h" -#include "soc/soc_pins.h" #include "soc/soc_caps.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" diff --git a/components/esp_driver_gpio/test_apps/gpio/CMakeLists.txt b/components/esp_driver_gpio/test_apps/gpio/CMakeLists.txt index e0da928036..fb00bf066d 100644 --- a/components/esp_driver_gpio/test_apps/gpio/CMakeLists.txt +++ b/components/esp_driver_gpio/test_apps/gpio/CMakeLists.txt @@ -9,24 +9,34 @@ project(gpio_test) idf_build_get_property(elf EXECUTABLE) if(CONFIG_COMPILER_DUMP_RTL_FILES) - add_custom_target(check_test_app_sections ALL - COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gpio/,${CMAKE_BINARY_DIR}/esp-idf/hal/ - --elf-file ${CMAKE_BINARY_DIR}/gpio_test.elf - find-refs - --from-sections=.iram0.text - --to-sections=.flash.text,.flash.rodata - --exit-code - DEPENDS ${elf} - ) + set(GPIO_RTL_DIRS + ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gpio + ${CMAKE_BINARY_DIR}/esp-idf/esp_hal_gpio + ${CMAKE_BINARY_DIR}/esp-idf/hal + ) + string(JOIN "," RTL_DIRS_STRING ${GPIO_RTL_DIRS}) + add_custom_target( + check_test_app_sections ALL + COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py + --rtl-dirs ${RTL_DIRS_STRING} + --elf-file ${CMAKE_BINARY_DIR}/gpio_test.elf + find-refs + --from-sections=.iram0.text + --to-sections=.flash.text,.flash.rodata + --exit-code + DEPENDS ${elf} + ) endif() include($ENV{IDF_PATH}/tools/ci/check_register_rw_half_word.cmake) message(STATUS "Checking gpio registers are not read-write by half-word") -check_register_rw_half_word(SOC_MODULES "gpio" "io_mux" "rtc_cntl" "rtc_io" "pcr" "hp_sys_clkrst" "hp_system" - "lp_aon" "lp_iomux" "pmu" - HAL_MODULES "gpio") +check_register_rw_half_word( + SOC_MODULES "gpio" "io_mux" "rtc_cntl" "rtc_io" "pcr" "hp_sys_clkrst" "hp_system" "lp_aon" "lp_iomux" "pmu" + HAL_MODULES "gpio" +) message(STATUS "Checking rtcio registers are not read-write by half-word") -check_register_rw_half_word(SOC_MODULES "rtc_io" "sens" "pcr" "lp_aon" "lp_io" "lp_gpio" "lp_iomux" "lpperi" "pmu" - HAL_MODULES "rtc_io") +check_register_rw_half_word( + SOC_MODULES "rtc_io" "sens" "pcr" "lp_aon" "lp_io" "lp_gpio" "lp_iomux" "lpperi" "pmu" + HAL_MODULES "rtc_io" +) diff --git a/components/esp_driver_gpio/test_apps/gpio_extensions/CMakeLists.txt b/components/esp_driver_gpio/test_apps/gpio_extensions/CMakeLists.txt index 35edeeb590..5781ca587e 100644 --- a/components/esp_driver_gpio/test_apps/gpio_extensions/CMakeLists.txt +++ b/components/esp_driver_gpio/test_apps/gpio_extensions/CMakeLists.txt @@ -9,14 +9,21 @@ project(gpio_extension_test) idf_build_get_property(elf EXECUTABLE) if(CONFIG_COMPILER_DUMP_RTL_FILES) - add_custom_target(check_test_app_sections ALL - COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gpio/,${CMAKE_BINARY_DIR}/esp-idf/hal/ - --elf-file ${CMAKE_BINARY_DIR}/gpio_extension_test.elf - find-refs - --from-sections=.iram0.text - --to-sections=.flash.text,.flash.rodata - --exit-code - DEPENDS ${elf} - ) + set(GPIO_EXTENSIONS_RTL_DIRS + ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gpio + ${CMAKE_BINARY_DIR}/esp-idf/esp_hal_gpio + ${CMAKE_BINARY_DIR}/esp-idf/hal + ) + string(JOIN "," RTL_DIRS_STRING ${GPIO_EXTENSIONS_RTL_DIRS}) + add_custom_target( + check_test_app_sections ALL + COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py + --rtl-dirs ${RTL_DIRS_STRING} + --elf-file ${CMAKE_BINARY_DIR}/gpio_extension_test.elf + find-refs + --from-sections=.iram0.text + --to-sections=.flash.text,.flash.rodata + --exit-code + DEPENDS ${elf} + ) endif() diff --git a/components/esp_driver_sdm/test_apps/sigma_delta/CMakeLists.txt b/components/esp_driver_sdm/test_apps/sigma_delta/CMakeLists.txt index 34bc943bdc..2378281e61 100644 --- a/components/esp_driver_sdm/test_apps/sigma_delta/CMakeLists.txt +++ b/components/esp_driver_sdm/test_apps/sigma_delta/CMakeLists.txt @@ -9,9 +9,15 @@ project(sigma_delta_test) idf_build_get_property(elf EXECUTABLE) if(CONFIG_COMPILER_DUMP_RTL_FILES) + set(SDM_RTL_DIRS + ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_sdm + ${CMAKE_BINARY_DIR}/esp-idf/esp_hal_gpio + ${CMAKE_BINARY_DIR}/esp-idf/hal + ) + string(JOIN "," RTL_DIRS_STRING ${SDM_RTL_DIRS}) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_sdm/,${CMAKE_BINARY_DIR}/esp-idf/hal/ + --rtl-dirs ${RTL_DIRS_STRING} --elf-file ${CMAKE_BINARY_DIR}/sigma_delta_test.elf find-refs --from-sections=.iram0.text diff --git a/components/esp_driver_sdmmc/src/sd_host_sdmmc.c b/components/esp_driver_sdmmc/src/sd_host_sdmmc.c index c358a677cc..73f6d35c72 100644 --- a/components/esp_driver_sdmmc/src/sd_host_sdmmc.c +++ b/components/esp_driver_sdmmc/src/sd_host_sdmmc.c @@ -15,6 +15,7 @@ #include "esp_timer.h" #include "esp_memory_utils.h" #include "soc/chip_revision.h" +#include "soc/sdmmc_pins.h" #include "soc/sdmmc_periph.h" #include "soc/soc_caps.h" #include "hal/efuse_hal.h" diff --git a/components/esp_driver_spi/CMakeLists.txt b/components/esp_driver_spi/CMakeLists.txt index 945d920b5f..88cd7386d0 100644 --- a/components/esp_driver_spi/CMakeLists.txt +++ b/components/esp_driver_spi/CMakeLists.txt @@ -26,7 +26,7 @@ endif() idf_component_register( SRCS ${srcs} INCLUDE_DIRS ${public_include} - REQUIRES esp_pm + REQUIRES esp_pm esp_hal_gpspi PRIV_REQUIRES esp_timer esp_mm esp_driver_gpio spi_flash esp_psram #For CONFIG_SPIRAM_SPEED LDFRAGMENTS "linker.lf" ) diff --git a/components/esp_driver_spi/linker.lf b/components/esp_driver_spi/linker.lf index 7a5832f189..faa66ce40c 100644 --- a/components/esp_driver_spi/linker.lf +++ b/components/esp_driver_spi/linker.lf @@ -1,5 +1,5 @@ [mapping:gpspi_hal] -archive: libhal.a +archive: libesp_hal_gpspi.a entries: if SPI_MASTER_ISR_IN_IRAM = y: spi_hal_iram (noflash) diff --git a/components/esp_driver_spi/src/gpspi/spi_master.c b/components/esp_driver_spi/src/gpspi/spi_master.c index 28ba959ce9..8f2e436c12 100644 --- a/components/esp_driver_spi/src/gpspi/spi_master.c +++ b/components/esp_driver_spi/src/gpspi/spi_master.c @@ -1473,6 +1473,7 @@ esp_err_t SPI_MASTER_ISR_ATTR spi_device_polling_end(spi_device_handle_t handle, } } spi_trans_dma_error_check(host); + uint32_t trans_flags = host->cur_trans_buf.trans->flags; // save the flags before bus_lock release ESP_LOGV(SPI_TAG, "polling trans done"); //deal with the in-flight transaction @@ -1489,7 +1490,7 @@ esp_err_t SPI_MASTER_ISR_ATTR spi_device_polling_end(spi_device_handle_t handle, spi_bus_lock_acquire_end(handle->dev_lock); } - return (host->cur_trans_buf.trans->flags & (SPI_TRANS_DMA_RX_FAIL | SPI_TRANS_DMA_TX_FAIL)) ? ESP_ERR_INVALID_STATE : ESP_OK; + return (trans_flags & (SPI_TRANS_DMA_RX_FAIL | SPI_TRANS_DMA_TX_FAIL)) ? ESP_ERR_INVALID_STATE : ESP_OK; } esp_err_t SPI_MASTER_ISR_ATTR spi_device_polling_transmit(spi_device_handle_t handle, spi_transaction_t* trans_desc) diff --git a/components/esp_driver_spi/test_apps/master/CMakeLists.txt b/components/esp_driver_spi/test_apps/master/CMakeLists.txt index 4a70a2fcb7..2e70b27cf5 100644 --- a/components/esp_driver_spi/test_apps/master/CMakeLists.txt +++ b/components/esp_driver_spi/test_apps/master/CMakeLists.txt @@ -9,19 +9,28 @@ project(spi_master_test) idf_build_get_property(elf EXECUTABLE) if(CONFIG_COMPILER_DUMP_RTL_FILES) - add_custom_target(check_test_app_sections ALL - COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_spi/,${CMAKE_BINARY_DIR}/esp-idf/hal/ - --elf-file ${CMAKE_BINARY_DIR}/spi_master_test.elf - find-refs - --from-sections=.iram0.text - --to-sections=.flash.text,.flash.rodata - --exit-code - DEPENDS ${elf} - ) + set(SPI_MASTER_RTL_DIRS + ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_spi + ${CMAKE_BINARY_DIR}/esp-idf/esp_hal_gpspi + ${CMAKE_BINARY_DIR}/esp-idf/hal + ) + string(JOIN "," RTL_DIRS_STRING ${SPI_MASTER_RTL_DIRS}) + add_custom_target( + check_test_app_sections ALL + COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py + --rtl-dirs ${RTL_DIRS_STRING} + --elf-file ${CMAKE_BINARY_DIR}/spi_master_test.elf + find-refs + --from-sections=.iram0.text + --to-sections=.flash.text,.flash.rodata + --exit-code + DEPENDS ${elf} + ) endif() message(STATUS "Checking spi registers are not read-write by half-word") include($ENV{IDF_PATH}/tools/ci/check_register_rw_half_word.cmake) -check_register_rw_half_word(SOC_MODULES "spi" "syscon" "pcr" "system" "hp_sys_clkrst" - HAL_MODULES "spi") +check_register_rw_half_word( + SOC_MODULES "spi" "syscon" "pcr" "system" "hp_sys_clkrst" + HAL_MODULES "spi" +) diff --git a/components/esp_driver_spi/test_apps/master/main/test_spi_master_sct.c b/components/esp_driver_spi/test_apps/master/main/test_spi_master_sct.c index f325751eb2..748173f168 100644 --- a/components/esp_driver_spi/test_apps/master/main/test_spi_master_sct.c +++ b/components/esp_driver_spi/test_apps/master/main/test_spi_master_sct.c @@ -20,7 +20,6 @@ #include "esp_private/esp_pmu.h" #include "driver/spi_slave_hd.h" #include "driver/spi_slave.h" -#include "soc/spi_pins.h" #include "test_spi_utils.h" __attribute__((unused)) static const char *TAG = "SCT"; diff --git a/components/esp_driver_spi/test_apps/slave/CMakeLists.txt b/components/esp_driver_spi/test_apps/slave/CMakeLists.txt index 83e4b2caf0..c8c9712a92 100644 --- a/components/esp_driver_spi/test_apps/slave/CMakeLists.txt +++ b/components/esp_driver_spi/test_apps/slave/CMakeLists.txt @@ -9,14 +9,21 @@ project(spi_slave_test) idf_build_get_property(elf EXECUTABLE) if(CONFIG_COMPILER_DUMP_RTL_FILES) - add_custom_target(check_test_app_sections ALL - COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_spi/,${CMAKE_BINARY_DIR}/esp-idf/hal/ - --elf-file ${CMAKE_BINARY_DIR}/spi_slave_test.elf - find-refs - --from-sections=.iram0.text - --to-sections=.flash.text,.flash.rodata - --exit-code - DEPENDS ${elf} - ) + set(SPI_SLAVE_RTL_DIRS + ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_spi + ${CMAKE_BINARY_DIR}/esp-idf/esp_hal_gpspi + ${CMAKE_BINARY_DIR}/esp-idf/hal + ) + string(JOIN "," RTL_DIRS_STRING ${SPI_SLAVE_RTL_DIRS}) + add_custom_target( + check_test_app_sections ALL + COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py + --rtl-dirs ${RTL_DIRS_STRING} + --elf-file ${CMAKE_BINARY_DIR}/spi_slave_test.elf + find-refs + --from-sections=.iram0.text + --to-sections=.flash.text,.flash.rodata + --exit-code + DEPENDS ${elf} + ) endif() diff --git a/components/esp_driver_spi/test_apps/slave/main/test_spi_slave_queue.c b/components/esp_driver_spi/test_apps/slave/main/test_spi_slave_queue.c index 52967059ee..0f80299097 100644 --- a/components/esp_driver_spi/test_apps/slave/main/test_spi_slave_queue.c +++ b/components/esp_driver_spi/test_apps/slave/main/test_spi_slave_queue.c @@ -17,7 +17,6 @@ #include "driver/spi_slave.h" #include "esp_private/spi_slave_internal.h" #include "soc/spi_pins.h" -#include "soc/spi_periph.h" #define TEST_BUF_SIZE 32 #define TEST_TIMES 4 diff --git a/components/esp_hal_ana_conv/include/hal/adc_hal.h b/components/esp_hal_ana_conv/include/hal/adc_hal.h index 66b363c603..521914698a 100644 --- a/components/esp_hal_ana_conv/include/hal/adc_hal.h +++ b/components/esp_hal_ana_conv/include/hal/adc_hal.h @@ -15,11 +15,6 @@ #include "hal/adc_ll.h" #endif -#if SOC_IS(ESP32S2) -//ADC utilises SPI3 DMA on ESP32S2 -#include "hal/spi_ll.h" -#endif - #if SOC_IS(ESP32) //ADC utilises I2S0 DMA on ESP32 #include "hal/i2s_ll.h" diff --git a/components/esp_hal_gpio/CMakeLists.txt b/components/esp_hal_gpio/CMakeLists.txt index 3f0a2bac81..f7bde5ea3c 100644 --- a/components/esp_hal_gpio/CMakeLists.txt +++ b/components/esp_hal_gpio/CMakeLists.txt @@ -1,7 +1,11 @@ idf_build_get_property(target IDF_TARGET) set(srcs) -set(includes "include" "${target}/include") +set(includes "include") + +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") + list(APPEND includes "${target}/include") +endif() if(CONFIG_SOC_GPIO_PORT GREATER 0) list(APPEND srcs "gpio_hal.c") diff --git a/components/esp_hal_gpspi/CMakeLists.txt b/components/esp_hal_gpspi/CMakeLists.txt new file mode 100644 index 0000000000..99e19773ee --- /dev/null +++ b/components/esp_hal_gpspi/CMakeLists.txt @@ -0,0 +1,29 @@ +idf_build_get_property(target IDF_TARGET) + +set(srcs) +set(includes "include") + +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") + list(APPEND includes "${target}/include") +endif() + +if(CONFIG_SOC_GPSPI_SUPPORTED) + list(APPEND srcs + "${target}/spi_periph.c" + "spi_hal.c" + "spi_hal_iram.c" + "spi_slave_hal.c" + "spi_slave_hal_iram.c" + ) + + if(CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2) + list(APPEND srcs "spi_slave_hd_hal.c") + endif() +endif() + +idf_component_register( + SRCS ${srcs} + INCLUDE_DIRS ${includes} + REQUIRES soc hal + PRIV_REQUIRES esp_hal_gpio +) diff --git a/components/esp_hal_gpspi/README.md b/components/esp_hal_gpspi/README.md new file mode 100644 index 0000000000..cab83a116f --- /dev/null +++ b/components/esp_hal_gpspi/README.md @@ -0,0 +1,69 @@ +# ESP Hardware Abstraction Layer for SPI Peripheral + +> [!NOTE] +> This component is currently in beta. Its API, behavior, and compatibility may change at any time and without notice; backward compatibility is not guaranteed. Use caution when integrating into production systems. + +## Overview + +The `esp_hal_spi` component provides a **Hardware Abstraction Layer** for the General Purpose SPI (GPSPI) peripherals across all ESP-IDF supported targets. It serves as a foundation for the higher-level SPI drivers, offering a consistent interface to interact with SPI hardware while hiding the complexities of chip-specific implementations. + +## Architecture + +The HAL architecture consists of two primary layers: + +1. **HAL Layer (Upper)**: Defines the operational sequences and data structures required to interact with SPI peripherals, including: + - Initialization and de-initialization + - Clock configuration and timing calculations + - Device and transaction setup + - Master, slave, and slave HD (Half Duplex) mode operations + +2. **Low-Level Layer (Bottom)**: Acts as a translation layer between the HAL and the register definitions in the `soc` component, handling: + - Register access abstractions + - Chip-specific register configurations + - Hardware feature compatibility + +## Features + +- Unified SPI interface across all ESP chip families +- Support for multiple operation modes: + - **Master mode**: Full-duplex and half-duplex communication + - **Slave mode**: Standard slave operation + - **Slave HD mode**: Half Duplex slave mode with segment-based transactions (on supported chips) +- Flexible SPI line configurations (1/2/4-line modes) +- Configurable clock sources and frequency settings +- Support for various transaction formats (command, address, dummy, data phases) + +## Usage + +This component is primarily used by ESP-IDF peripheral drivers such as `esp_driver_spi`. It provides the low-level hardware abstraction needed for SPI communication with external devices. + +For advanced developers implementing custom SPI solutions, the HAL functions can be used directly. However, please note that the interfaces provided by this component are internal to ESP-IDF and are subject to change. + +### Typical Usage Flow + +**Master Mode (without DMA):** +1. Initialize the SPI bus +2. Setup clock speed configuration +3. Call `setup_device` to update parameters for a specific device +4. Call `setup_trans` to update parameters for a specific transaction +5. Prepare data to send into hardware registers +6. Trigger the SPI transaction to start +7. Wait until the transaction is complete +8. Fetch the received data + +**Slave Mode (without DMA):** +1. Initialize the SPI bus with `spi_slave_hal_init` +2. Configure device parameters (mode, bit order, etc.) in the HAL context +3. Call `spi_slave_hal_setup_device` to update parameters for the device +4. Prepare data to send and receiving buffer +5. Call `spi_slave_hal_set_trans_bitlen` to set transaction bit length +6. Call `spi_slave_hal_user_start` to trigger the SPI transaction to start +7. Wait until the transaction is done with `spi_slave_hal_usr_is_done` +8. Call `spi_slave_hal_store_result` to store the received data +9. Call `spi_slave_hal_get_rcv_bitlen` to get the received data length + +## Dependencies + +- `soc`: Provides chip-specific register definitions +- `hal`: Core hardware abstraction utilities and macros +- `esp_hal_gpio`: Required for ESP32 to access GPIO matrix delay information diff --git a/components/hal/esp32/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32/include/hal/spi_ll.h index 79d0844b16..8685e5312d 100644 --- a/components/hal/esp32/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32/include/hal/spi_ll.h @@ -18,7 +18,7 @@ #include //for abs() #include "esp_types.h" #include "esp32/rom/lldesc.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/dport_reg.h" #include "hal/misc.h" diff --git a/components/hal/esp32/include/hal/spi_types.h b/components/esp_hal_gpspi/esp32/include/hal/spi_types.h similarity index 100% rename from components/hal/esp32/include/hal/spi_types.h rename to components/esp_hal_gpspi/esp32/include/hal/spi_types.h diff --git a/components/soc/esp32/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32/include/soc/spi_pins.h similarity index 96% rename from components/soc/esp32/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32/include/soc/spi_pins.h index f7a095f978..2603bb381b 100644 --- a/components/soc/esp32/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32/spi_periph.c b/components/esp_hal_gpspi/esp32/spi_periph.c similarity index 98% rename from components/soc/esp32/spi_periph.c rename to components/esp_hal_gpspi/esp32/spi_periph.c index 7d331ab71c..ef1a28181e 100644 --- a/components/soc/esp32/spi_periph.c +++ b/components/esp_hal_gpspi/esp32/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/spi_periph.h" diff --git a/components/hal/esp32c2/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32c2/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32c2/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32c2/include/hal/spi_ll.h index fef1ff04fc..bd838e71e6 100644 --- a/components/hal/esp32c2/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32c2/include/hal/spi_ll.h @@ -18,8 +18,8 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" #include "soc/spi_struct.h" +#include "soc/spi_reg.h" #include "soc/system_struct.h" #include "hal/assert.h" #include "hal/misc.h" @@ -1100,7 +1100,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.cmd9, dma_int_raw.cmd9, dma_int_clr.cmd9, dma_int_set.cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.cmda, dma_int_raw.cmda, dma_int_clr.cmda, dma_int_set.cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; @@ -1287,8 +1286,6 @@ static inline int spi_ll_get_slave_hd_dummy_bits(spi_line_mode_t line_mode) return 8; } - - /*------------------------------------------------------------------------------ * Segmented-Configure-Transfer *----------------------------------------------------------------------------*/ @@ -1611,7 +1608,6 @@ static inline void spi_ll_set_magic_number(spi_dev_t *hw, uint8_t magic_value) hw->slave.dma_seg_magic_value = magic_value; } - #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK diff --git a/components/soc/esp32c3/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32c2/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32c3/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32c2/include/soc/spi_pins.h index 113fb191de..45bccaef27 100644 --- a/components/soc/esp32c3/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32c2/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32c2/spi_periph.c b/components/esp_hal_gpspi/esp32c2/spi_periph.c similarity index 97% rename from components/soc/esp32c2/spi_periph.c rename to components/esp_hal_gpspi/esp32c2/spi_periph.c index 9a516f556e..437d0e2732 100644 --- a/components/soc/esp32c2/spi_periph.c +++ b/components/esp_hal_gpspi/esp32c2/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32c3/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32c3/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32c3/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32c3/include/hal/spi_ll.h index 258cc41675..e1553d16d9 100644 --- a/components/hal/esp32c3/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32c3/include/hal/spi_ll.h @@ -18,7 +18,7 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/system_struct.h" #include "hal/assert.h" @@ -64,7 +64,6 @@ typedef enum { SPI_LL_INTR_SEG_DONE = BIT(14), } spi_ll_intr_t; - // Flags for conditions under which the transaction length should be recorded typedef enum { SPI_LL_TRANS_LEN_COND_WRBUF = BIT(0), ///< WRBUF length will be recorded @@ -73,7 +72,6 @@ typedef enum { SPI_LL_TRANS_LEN_COND_RDDMA = BIT(3), ///< RDDMA length will be recorded } spi_ll_trans_len_cond_t; - // SPI base command in esp32c3 typedef enum { /* Slave HD Only */ @@ -1102,7 +1100,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.cmd9, dma_int_raw.cmd9, dma_int_clr.cmd9=1) \ item(SPI_LL_INTR_CMDA, dma_int_ena.cmda, dma_int_raw.cmda, dma_int_clr.cmda=1) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; diff --git a/components/soc/esp32c2/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32c3/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32c2/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32c3/include/soc/spi_pins.h index 113fb191de..45bccaef27 100644 --- a/components/soc/esp32c2/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32c3/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32c3/spi_periph.c b/components/esp_hal_gpspi/esp32c3/spi_periph.c similarity index 97% rename from components/soc/esp32c3/spi_periph.c rename to components/esp_hal_gpspi/esp32c3/spi_periph.c index 9a516f556e..437d0e2732 100644 --- a/components/soc/esp32c3/spi_periph.c +++ b/components/esp_hal_gpspi/esp32c3/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32c5/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32c5/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32c5/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32c5/include/hal/spi_ll.h index 5a43252c90..8ad078822c 100644 --- a/components/hal/esp32c5/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32c5/include/hal/spi_ll.h @@ -15,7 +15,7 @@ #include //for abs() #include #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/clk_tree_defs.h" #include "hal/assert.h" @@ -1113,7 +1113,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9_int_ena, dma_int_raw.slv_cmd9_int_raw, dma_int_clr.slv_cmd9_int_clr, dma_int_set.slv_cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda_int_ena, dma_int_raw.slv_cmda_int_raw, dma_int_clr.slv_cmda_int_clr, dma_int_set.slv_cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; diff --git a/components/soc/esp32c5/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32c5/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32c5/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32c5/include/soc/spi_pins.h index 06fe12689c..535ba47d50 100644 --- a/components/soc/esp32c5/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32c5/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32c61/spi_periph.c b/components/esp_hal_gpspi/esp32c5/spi_periph.c similarity index 98% rename from components/soc/esp32c61/spi_periph.c rename to components/esp_hal_gpspi/esp32c5/spi_periph.c index 6b2ae32acd..4c5fd84d12 100644 --- a/components/soc/esp32c61/spi_periph.c +++ b/components/esp_hal_gpspi/esp32c5/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32c6/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32c6/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32c6/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32c6/include/hal/spi_ll.h index 3d16b5d7d2..8e4212fa3a 100644 --- a/components/hal/esp32c6/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32c6/include/hal/spi_ll.h @@ -18,7 +18,7 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/assert.h" #include "hal/misc.h" @@ -1085,7 +1085,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9, dma_int_raw.slv_cmd9, dma_int_clr.slv_cmd9, dma_int_set.slv_cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda, dma_int_raw.slv_cmda, dma_int_clr.slv_cmda, dma_int_set.slv_cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; @@ -1186,7 +1185,6 @@ static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) return hw->slave1.slv_last_addr; } - /*------------------------------------------------------------------------------ * Segmented-Configure-Transfer *----------------------------------------------------------------------------*/ diff --git a/components/soc/esp32c6/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32c6/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32c6/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32c6/include/soc/spi_pins.h index 5511d2bd52..d49ad210fb 100644 --- a/components/soc/esp32c6/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32c6/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32c6/spi_periph.c b/components/esp_hal_gpspi/esp32c6/spi_periph.c similarity index 98% rename from components/soc/esp32c6/spi_periph.c rename to components/esp_hal_gpspi/esp32c6/spi_periph.c index c6b01502c4..8331c591b9 100644 --- a/components/soc/esp32c6/spi_periph.c +++ b/components/esp_hal_gpspi/esp32c6/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32c61/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32c61/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32c61/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32c61/include/hal/spi_ll.h index 46823ff1b4..404a2ce126 100644 --- a/components/hal/esp32c61/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32c61/include/hal/spi_ll.h @@ -16,7 +16,7 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/assert.h" #include "hal/misc.h" @@ -1113,7 +1113,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9, dma_int_raw.slv_cmd9, dma_int_clr.slv_cmd9, dma_int_set.slv_cmd9) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda, dma_int_raw.slv_cmda, dma_int_clr.slv_cmda, dma_int_set.slv_cmda) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; diff --git a/components/soc/esp32c61/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32c61/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32c61/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32c61/include/soc/spi_pins.h index de4fe0e177..b3673f360d 100644 --- a/components/soc/esp32c61/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32c61/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32c5/spi_periph.c b/components/esp_hal_gpspi/esp32c61/spi_periph.c similarity index 98% rename from components/soc/esp32c5/spi_periph.c rename to components/esp_hal_gpspi/esp32c61/spi_periph.c index 6b2ae32acd..4c5fd84d12 100644 --- a/components/soc/esp32c5/spi_periph.c +++ b/components/esp_hal_gpspi/esp32c61/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32h2/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32h2/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32h2/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32h2/include/hal/spi_ll.h index 5f7cca1d98..9af0a43ea3 100644 --- a/components/hal/esp32h2/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32h2/include/hal/spi_ll.h @@ -18,7 +18,7 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/chip_revision.h" #include "soc/pcr_struct.h" @@ -1087,7 +1087,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9_int_ena, dma_int_raw.slv_cmd9_int_raw, dma_int_clr.slv_cmd9_int_clr, dma_int_set.slv_cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda_int_ena, dma_int_raw.slv_cmda_int_raw, dma_int_clr.slv_cmda_int_clr, dma_int_set.slv_cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; @@ -1188,7 +1187,6 @@ static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) return hw->slave1.slv_last_addr; } - /*------------------------------------------------------------------------------ * Segmented-Configure-Transfer *----------------------------------------------------------------------------*/ @@ -1516,7 +1514,6 @@ static inline void spi_ll_set_magic_number(spi_dev_t *hw, uint8_t magic_value) hw->slave.dma_seg_magic_value = magic_value; } - #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK diff --git a/components/soc/esp32h2/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32h2/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32h2/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32h2/include/soc/spi_pins.h index 466aca8bf9..13b399e75d 100644 --- a/components/soc/esp32h2/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32h2/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32h2/spi_periph.c b/components/esp_hal_gpspi/esp32h2/spi_periph.c similarity index 98% rename from components/soc/esp32h2/spi_periph.c rename to components/esp_hal_gpspi/esp32h2/spi_periph.c index 628ff4e8c1..c668285789 100644 --- a/components/soc/esp32h2/spi_periph.c +++ b/components/esp_hal_gpspi/esp32h2/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32h21/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32h21/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32h21/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32h21/include/hal/spi_ll.h index d2ae13d544..4ccbabfc2d 100644 --- a/components/hal/esp32h21/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32h21/include/hal/spi_ll.h @@ -16,7 +16,7 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/chip_revision.h" #include "soc/pcr_struct.h" @@ -1073,7 +1073,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9_int_ena, dma_int_raw.slv_cmd9_int_raw, dma_int_clr.slv_cmd9_int_clr, dma_int_set.slv_cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda_int_ena, dma_int_raw.slv_cmda_int_raw, dma_int_clr.slv_cmda_int_clr, dma_int_set.slv_cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; diff --git a/components/soc/esp32h21/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32h21/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32h21/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32h21/include/soc/spi_pins.h index 3c2857fcc8..9d884a5d41 100644 --- a/components/soc/esp32h21/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32h21/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #ifndef _SOC_SPI_PINS_H_ diff --git a/components/soc/esp32h21/spi_periph.c b/components/esp_hal_gpspi/esp32h21/spi_periph.c similarity index 98% rename from components/soc/esp32h21/spi_periph.c rename to components/esp_hal_gpspi/esp32h21/spi_periph.c index 51bedd903b..65928c8df2 100644 --- a/components/soc/esp32h21/spi_periph.c +++ b/components/esp_hal_gpspi/esp32h21/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32h4/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32h4/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32h4/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32h4/include/hal/spi_ll.h index a49cd91e19..06d8a8fe75 100644 --- a/components/hal/esp32h4/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32h4/include/hal/spi_ll.h @@ -16,7 +16,7 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/assert.h" #include "hal/misc.h" @@ -1135,7 +1135,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9_int_ena, dma_int_raw.slv_cmd9_int_raw, dma_int_clr.slv_cmd9_int_clr, dma_int_set.slv_cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda_int_ena, dma_int_raw.slv_cmda_int_raw, dma_int_clr.slv_cmda_int_clr, dma_int_set.slv_cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; diff --git a/components/soc/esp32h4/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32h4/include/soc/spi_pins.h similarity index 93% rename from components/soc/esp32h4/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32h4/include/soc/spi_pins.h index 1c4d5859b5..fa9dffa36d 100644 --- a/components/soc/esp32h4/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32h4/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32h4/spi_periph.c b/components/esp_hal_gpspi/esp32h4/spi_periph.c similarity index 98% rename from components/soc/esp32h4/spi_periph.c rename to components/esp_hal_gpspi/esp32h4/spi_periph.c index c1d00acc2d..a013e32f2b 100644 --- a/components/soc/esp32h4/spi_periph.c +++ b/components/esp_hal_gpspi/esp32h4/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32p4/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32p4/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32p4/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32p4/include/hal/spi_ll.h index 7411d7716f..2d2fdc78e3 100644 --- a/components/hal/esp32p4/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32p4/include/hal/spi_ll.h @@ -18,7 +18,7 @@ #include #include "hal/config.h" #include "esp_types.h" -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/assert.h" #include "hal/misc.h" @@ -1186,7 +1186,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.slv_cmd9_int, dma_int_raw.slv_cmd9_int, dma_int_clr.slv_cmd9_int, dma_int_set.slv_cmd9_int) \ item(SPI_LL_INTR_CMDA, dma_int_ena.slv_cmda_int, dma_int_raw.slv_cmda_int, dma_int_clr.slv_cmda_int, dma_int_set.slv_cmda_int) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; diff --git a/components/soc/esp32p4/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32p4/include/soc/spi_pins.h similarity index 97% rename from components/soc/esp32p4/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32p4/include/soc/spi_pins.h index f7ca901c66..416ad7cf20 100644 --- a/components/soc/esp32p4/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32p4/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32p4/spi_periph.c b/components/esp_hal_gpspi/esp32p4/spi_periph.c similarity index 98% rename from components/soc/esp32p4/spi_periph.c rename to components/esp_hal_gpspi/esp32p4/spi_periph.c index 8f326d0f9c..4afb9842bd 100644 --- a/components/soc/esp32p4/spi_periph.c +++ b/components/esp_hal_gpspi/esp32p4/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/hal/esp32s2/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32s2/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32s2/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32s2/include/hal/spi_ll.h index 64429b3b25..90a4d2fb38 100644 --- a/components/hal/esp32s2/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32s2/include/hal/spi_ll.h @@ -20,7 +20,6 @@ #include "esp_attr.h" #include "esp_bit_defs.h" #include "esp_compiler.h" -#include "soc/spi_periph.h" #include "soc/spi_struct.h" #include "soc/spi_reg.h" #include "soc/dport_reg.h" @@ -1121,7 +1120,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.cmd9, dma_int_raw.cmd9, dma_int_clr.cmd9=1) \ item(SPI_LL_INTR_CMDA, dma_int_ena.cmda, dma_int_raw.cmda, dma_int_clr.cmda=1) - __attribute__((always_inline)) static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { diff --git a/components/hal/esp32s2/include/hal/spi_types.h b/components/esp_hal_gpspi/esp32s2/include/hal/spi_types.h similarity index 100% rename from components/hal/esp32s2/include/hal/spi_types.h rename to components/esp_hal_gpspi/esp32s2/include/hal/spi_types.h diff --git a/components/soc/esp32s2/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32s2/include/soc/spi_pins.h similarity index 97% rename from components/soc/esp32s2/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32s2/include/soc/spi_pins.h index 93f92a570a..65e1ee9d0b 100644 --- a/components/soc/esp32s2/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32s2/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32s2/spi_periph.c b/components/esp_hal_gpspi/esp32s2/spi_periph.c similarity index 97% rename from components/soc/esp32s2/spi_periph.c rename to components/esp_hal_gpspi/esp32s2/spi_periph.c index 9a14d9b713..61a853123f 100644 --- a/components/soc/esp32s2/spi_periph.c +++ b/components/esp_hal_gpspi/esp32s2/spi_periph.c @@ -1,10 +1,11 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/spi_periph.h" +#include "soc/spi_mem_struct.h" /* Bunch of constants for every SPI peripheral: GPIO signals, irqs, hw addr of registers etc @@ -34,7 +35,6 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = { .irq_dma = -1, .hw = (spi_dev_t *) &SPIMEM1, .func = MSPI_FUNC_NUM, - }, { .spiclk_out = FSPICLK_OUT_MUX_IDX, .spiclk_in = FSPICLK_IN_IDX, diff --git a/components/hal/esp32s3/include/hal/spi_ll.h b/components/esp_hal_gpspi/esp32s3/include/hal/spi_ll.h similarity index 99% rename from components/hal/esp32s3/include/hal/spi_ll.h rename to components/esp_hal_gpspi/esp32s3/include/hal/spi_ll.h index 50f83f4d03..fe247a0997 100644 --- a/components/hal/esp32s3/include/hal/spi_ll.h +++ b/components/esp_hal_gpspi/esp32s3/include/hal/spi_ll.h @@ -18,8 +18,8 @@ #include #include "esp_attr.h" #include "esp_types.h" -#include "soc/spi_periph.h" #include "soc/spi_struct.h" +#include "soc/spi_reg.h" #include "soc/system_struct.h" #include "hal/assert.h" #include "hal/misc.h" @@ -1126,7 +1126,6 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) item(SPI_LL_INTR_CMD9, dma_int_ena.cmd9, dma_int_raw.cmd9, dma_int_clr.cmd9, dma_int_set.cmd9_int_set) \ item(SPI_LL_INTR_CMDA, dma_int_ena.cmda, dma_int_raw.cmda, dma_int_clr.cmda, dma_int_set.cmda_int_set) - static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; @@ -1227,7 +1226,6 @@ static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) return hw->slave1.last_addr; } - /*------------------------------------------------------------------------------ * Segmented-Configure-Transfer *----------------------------------------------------------------------------*/ @@ -1268,7 +1266,6 @@ static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) #define SPI_LL_SCT_MAGIC_NUMBER (0x2) - /** * Set conf phase bits len to HW for segment config trans mode. * diff --git a/components/soc/esp32s3/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32s3/include/soc/spi_pins.h similarity index 97% rename from components/soc/esp32s3/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32s3/include/soc/spi_pins.h index 27aefe98dc..48b9fdf1dd 100644 --- a/components/soc/esp32s3/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32s3/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/soc/esp32s3/spi_periph.c b/components/esp_hal_gpspi/esp32s3/spi_periph.c similarity index 98% rename from components/soc/esp32s3/spi_periph.c rename to components/esp_hal_gpspi/esp32s3/spi_periph.c index 4e1a039c6c..59f671159d 100644 --- a/components/soc/esp32s3/spi_periph.c +++ b/components/esp_hal_gpspi/esp32s3/spi_periph.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include diff --git a/components/soc/esp32s31/include/soc/spi_pins.h b/components/esp_hal_gpspi/esp32s31/include/soc/spi_pins.h similarity index 97% rename from components/soc/esp32s31/include/soc/spi_pins.h rename to components/esp_hal_gpspi/esp32s31/include/soc/spi_pins.h index efd8e06b57..210b74b379 100644 --- a/components/soc/esp32s31/include/soc/spi_pins.h +++ b/components/esp_hal_gpspi/esp32s31/include/soc/spi_pins.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/components/hal/include/hal/spi_hal.h b/components/esp_hal_gpspi/include/hal/spi_hal.h similarity index 99% rename from components/hal/include/hal/spi_hal.h rename to components/esp_hal_gpspi/include/hal/spi_hal.h index 61a0fc2e27..022880d425 100644 --- a/components/hal/include/hal/spi_hal.h +++ b/components/esp_hal_gpspi/include/hal/spi_hal.h @@ -27,6 +27,7 @@ #pragma once #include "esp_err.h" #include "soc/soc_caps.h" +#include "soc/spi_periph.h" #include "hal/spi_types.h" #if SOC_GPSPI_SUPPORTED #include "hal/spi_ll.h" diff --git a/components/hal/include/hal/spi_slave_hal.h b/components/esp_hal_gpspi/include/hal/spi_slave_hal.h similarity index 100% rename from components/hal/include/hal/spi_slave_hal.h rename to components/esp_hal_gpspi/include/hal/spi_slave_hal.h diff --git a/components/hal/include/hal/spi_slave_hd_hal.h b/components/esp_hal_gpspi/include/hal/spi_slave_hd_hal.h similarity index 99% rename from components/hal/include/hal/spi_slave_hd_hal.h rename to components/esp_hal_gpspi/include/hal/spi_slave_hd_hal.h index 829272afd3..b718a8be6d 100644 --- a/components/hal/include/hal/spi_slave_hd_hal.h +++ b/components/esp_hal_gpspi/include/hal/spi_slave_hd_hal.h @@ -256,7 +256,6 @@ int spi_slave_hd_hal_get_rxlen(spi_slave_hd_hal_context_t *hal); */ int spi_slave_hd_hal_get_last_addr(spi_slave_hd_hal_context_t *hal); - //////////////////////////////////////////////////////////////////////////////// // Append Mode //////////////////////////////////////////////////////////////////////////////// diff --git a/components/hal/include/hal/spi_types.h b/components/esp_hal_gpspi/include/hal/spi_types.h similarity index 100% rename from components/hal/include/hal/spi_types.h rename to components/esp_hal_gpspi/include/hal/spi_types.h diff --git a/components/soc/include/soc/spi_periph.h b/components/esp_hal_gpspi/include/soc/spi_periph.h similarity index 86% rename from components/soc/include/soc/spi_periph.h rename to components/esp_hal_gpspi/include/soc/spi_periph.h index 55b437fe67..834b920cfb 100644 --- a/components/soc/include/soc/spi_periph.h +++ b/components/esp_hal_gpspi/include/soc/spi_periph.h @@ -1,42 +1,28 @@ /* * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include -#include "sdkconfig.h" #include "soc/soc.h" #include "soc/soc_caps.h" +#include "soc/interrupts.h" +#include "soc/gpio_sig_map.h" +#include "soc/spi_reg.h" +#include "soc/spi_struct.h" #include "soc/spi_pins.h" #if SOC_PAU_SUPPORTED #include "soc/regdma.h" #include "soc/retention_periph_defs.h" #endif -//include soc related (generated) definitions -#include "soc/interrupts.h" -#include "soc/spi_reg.h" -#include "soc/spi_struct.h" -#include "soc/gpio_sig_map.h" -#if SOC_MEMSPI_IS_INDEPENDENT -#include "soc/spi_mem_struct.h" -#include "soc/spi_mem_reg.h" -#endif - #ifdef __cplusplus extern "C" { #endif -#if CONFIG_IDF_TARGET_ESP32S2 -#define SPI_FREAD_DIO 0 -#define SPI_FREAD_QIO 0 -#define SPI_FWRITE_DIO 0 -#define SPI_FWRITE_QIO 0 -#endif - /* Stores a bunch of per-spi-peripheral data. */ diff --git a/components/hal/spi_hal.c b/components/esp_hal_gpspi/spi_hal.c similarity index 100% rename from components/hal/spi_hal.c rename to components/esp_hal_gpspi/spi_hal.c diff --git a/components/hal/spi_hal_iram.c b/components/esp_hal_gpspi/spi_hal_iram.c similarity index 98% rename from components/hal/spi_hal_iram.c rename to components/esp_hal_gpspi/spi_hal_iram.c index 88ef9add14..5ba8b577fc 100644 --- a/components/hal/spi_hal_iram.c +++ b/components/esp_hal_gpspi/spi_hal_iram.c @@ -54,7 +54,7 @@ esp_err_t spi_hal_cal_clock_conf(const spi_hal_timing_param_t *timing_param, spi if (!(timing_param->half_duplex || dummy == 0 || timing_param->no_compensate)) { // This only a short log used as a "key" of the idf hint system, see `hints.yml` - HAL_EARLY_LOGE(SPI_HAL_TAG,"The clock_speed_hz should less than %d", freq_limit); + HAL_EARLY_LOGE(SPI_HAL_TAG, "The clock_speed_hz should less than %d", freq_limit); return ESP_ERR_NOT_SUPPORTED; } #endif @@ -235,11 +235,13 @@ bool spi_hal_usr_is_done(const spi_hal_context_t *hal) } #if SOC_SPI_SUPPORT_SLAVE_HD_VER2 -bool spi_hal_get_intr_mask(spi_hal_context_t *hal, uint32_t mask) { +bool spi_hal_get_intr_mask(spi_hal_context_t *hal, uint32_t mask) +{ return spi_ll_get_intr(hal->hw, mask); } -void spi_hal_clear_intr_mask(spi_hal_context_t *hal, uint32_t mask) { +void spi_hal_clear_intr_mask(spi_hal_context_t *hal, uint32_t mask) +{ spi_ll_clear_intr(hal->hw, mask); } #endif @@ -266,7 +268,8 @@ void spi_hal_fetch_result(const spi_hal_context_t *hal) /*------------------------------------------------------------------------------ * Segmented-Configure-Transfer *----------------------------------------------------------------------------*/ -void spi_hal_sct_set_conf_bits_len(spi_hal_context_t *hal, uint32_t conf_len) { +void spi_hal_sct_set_conf_bits_len(spi_hal_context_t *hal, uint32_t conf_len) +{ spi_ll_set_conf_phase_bits_len(hal->hw, conf_len); } diff --git a/components/hal/spi_slave_hal.c b/components/esp_hal_gpspi/spi_slave_hal.c similarity index 88% rename from components/hal/spi_slave_hal.c rename to components/esp_hal_gpspi/spi_slave_hal.c index d279db8643..c638638ac5 100644 --- a/components/hal/spi_slave_hal.c +++ b/components/esp_hal_gpspi/spi_slave_hal.c @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "hal/spi_slave_hal.h" #include "hal/spi_ll.h" #include "soc/soc_caps.h" diff --git a/components/hal/spi_slave_hal_iram.c b/components/esp_hal_gpspi/spi_slave_hal_iram.c similarity index 96% rename from components/hal/spi_slave_hal_iram.c rename to components/esp_hal_gpspi/spi_slave_hal_iram.c index b7a6e669bb..1918e53a21 100644 --- a/components/hal/spi_slave_hal_iram.c +++ b/components/esp_hal_gpspi/spi_slave_hal_iram.c @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "hal/spi_slave_hal.h" #include "hal/spi_ll.h" #include "soc/soc_caps.h" diff --git a/components/hal/spi_slave_hd_hal.c b/components/esp_hal_gpspi/spi_slave_hd_hal.c similarity index 89% rename from components/hal/spi_slave_hd_hal.c rename to components/esp_hal_gpspi/spi_slave_hd_hal.c index 53a432939a..6da050fedc 100644 --- a/components/hal/spi_slave_hd_hal.c +++ b/components/esp_hal_gpspi/spi_slave_hd_hal.c @@ -10,14 +10,12 @@ #include "esp_types.h" #include "esp_attr.h" #include "esp_err.h" -#include "soc/spi_periph.h" #include "soc/lldesc.h" #include "soc/soc_caps.h" #include "soc/ext_mem_defs.h" //for SOC_NON_CACHEABLE_OFFSET #include "hal/spi_slave_hd_hal.h" #include "hal/assert.h" - void spi_slave_hd_hal_init(spi_slave_hd_hal_context_t *hal, const spi_slave_hd_hal_config_t *hal_config) { spi_dev_t *hw = SPI_LL_GET_HW(hal_config->host_id); @@ -26,8 +24,8 @@ void spi_slave_hd_hal_init(spi_slave_hd_hal_context_t *hal, const spi_slave_hd_h hal->append_mode = hal_config->append_mode; hal->tx_cur_desc = hal->dmadesc_tx; hal->rx_cur_desc = hal->dmadesc_rx; - hal->tx_dma_head = hal->dmadesc_tx + hal->dma_desc_num -1; - hal->rx_dma_head = hal->dmadesc_rx + hal->dma_desc_num -1; + hal->tx_dma_head = hal->dmadesc_tx + hal->dma_desc_num - 1; + hal->rx_dma_head = hal->dmadesc_rx + hal->dma_desc_num - 1; spi_ll_slave_hd_init(hw); spi_ll_set_addr_bitlen(hw, hal_config->address_bits); @@ -63,9 +61,9 @@ void spi_slave_hd_hal_init(spi_slave_hd_hal_context_t *hal, const spi_slave_hd_h } spi_ll_slave_hd_set_len_cond(hw, SPI_LL_TRANS_LEN_COND_WRBUF | - SPI_LL_TRANS_LEN_COND_WRDMA | - SPI_LL_TRANS_LEN_COND_RDBUF | - SPI_LL_TRANS_LEN_COND_RDDMA); + SPI_LL_TRANS_LEN_COND_WRDMA | + SPI_LL_TRANS_LEN_COND_RDBUF | + SPI_LL_TRANS_LEN_COND_RDDMA); spi_ll_slave_set_seg_mode(hal->dev, true); } @@ -86,12 +84,14 @@ static int s_desc_get_received_len_addr(spi_dma_desc_t* head, spi_dma_desc_t** o if (out_buff_head) { *out_buff_head = desc_cpu->buffer; } - while(head) { + while (head) { len += desc_cpu->dw0.length; bool eof = desc_cpu->dw0.suc_eof; desc_cpu = ADDR_DMA_2_CPU(desc_cpu->next); head = head->next; - if (eof) break; + if (eof) { + break; + } } if (out_next) { *out_next = head; @@ -130,13 +130,27 @@ void spi_slave_hd_hal_txdma(spi_slave_hd_hal_context_t *hal) static spi_ll_intr_t get_event_intr(spi_slave_hd_hal_context_t *hal, spi_event_t ev) { spi_ll_intr_t intr = 0; - if (ev & SPI_EV_SEND) intr |= SPI_LL_INTR_CMD8; - if (ev & SPI_EV_RECV) intr |= SPI_LL_INTR_CMD7; - if (ev & SPI_EV_BUF_TX) intr |= SPI_LL_INTR_RDBUF; - if (ev & SPI_EV_BUF_RX) intr |= SPI_LL_INTR_WRBUF; - if (ev & SPI_EV_CMD9) intr |= SPI_LL_INTR_CMD9; - if (ev & SPI_EV_CMDA) intr |= SPI_LL_INTR_CMDA; - if (ev & SPI_EV_TRANS) intr |= SPI_LL_INTR_TRANS_DONE; + if (ev & SPI_EV_SEND) { + intr |= SPI_LL_INTR_CMD8; + } + if (ev & SPI_EV_RECV) { + intr |= SPI_LL_INTR_CMD7; + } + if (ev & SPI_EV_BUF_TX) { + intr |= SPI_LL_INTR_RDBUF; + } + if (ev & SPI_EV_BUF_RX) { + intr |= SPI_LL_INTR_WRBUF; + } + if (ev & SPI_EV_CMD9) { + intr |= SPI_LL_INTR_CMD9; + } + if (ev & SPI_EV_CMDA) { + intr |= SPI_LL_INTR_CMDA; + } + if (ev & SPI_EV_TRANS) { + intr |= SPI_LL_INTR_TRANS_DONE; + } return intr; } diff --git a/components/esp_hal_mspi/CMakeLists.txt b/components/esp_hal_mspi/CMakeLists.txt index 3fc892961b..c8d73fe378 100644 --- a/components/esp_hal_mspi/CMakeLists.txt +++ b/components/esp_hal_mspi/CMakeLists.txt @@ -4,11 +4,6 @@ idf_build_get_property(esp_tee_build ESP_TEE_BUILD) set(srcs) set(includes "include" "${target}/include") -set(priv_requires) -if(${target} STREQUAL "esp32") - list(APPEND priv_requires esp_hal_gpio) -endif() - if(esp_tee_build) if(CONFIG_SECURE_TEE_EXT_FLASH_MEMPROT_SPI1) list(APPEND srcs "spi_flash_hal.c" "spi_flash_hal_iram.c") @@ -29,7 +24,9 @@ elseif(NOT BOOTLOADER_BUILD) endif() -idf_component_register(SRCS ${srcs} - INCLUDE_DIRS ${includes} - REQUIRES soc hal - PRIV_REQUIRES "${priv_requires}") +idf_component_register( + SRCS ${srcs} + INCLUDE_DIRS ${includes} + REQUIRES soc hal esp_hal_gpspi + PRIV_REQUIRES esp_hal_gpio +) diff --git a/components/esp_hal_mspi/esp32/include/hal/spi_flash_ll.h b/components/esp_hal_mspi/esp32/include/hal/spi_flash_ll.h index 27f6e82ab3..ad8e34b27c 100644 --- a/components/esp_hal_mspi/esp32/include/hal/spi_flash_ll.h +++ b/components/esp_hal_mspi/esp32/include/hal/spi_flash_ll.h @@ -15,9 +15,8 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" -#include "hal/spi_types.h" #include "hal/spi_flash_types.h" #include // For MIN/MAX #include diff --git a/components/esp_hal_mspi/esp32c2/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32c2/include/hal/gpspi_flash_ll.h index 7b63e6fb92..56dd2431ca 100644 --- a/components/esp_hal_mspi/esp32c2/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32c2/include/hal/gpspi_flash_ll.h @@ -13,7 +13,8 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" +#include "soc/spi_struct.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" #include // For MIN/MAX diff --git a/components/esp_hal_mspi/esp32c2/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32c2/include/hal/spimem_flash_ll.h index 8140fa4205..da92f82c40 100644 --- a/components/esp_hal_mspi/esp32c2/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32c2/include/hal/spimem_flash_ll.h @@ -19,7 +19,9 @@ #include #include #include "hal/misc.h" -#include "soc/spi_periph.h" +#include "soc/spi_mem_struct.h" +#include "soc/spi_mem_reg.h" +#include "soc/interrupts.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" diff --git a/components/esp_hal_mspi/esp32c3/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32c3/include/hal/gpspi_flash_ll.h index 28285336fe..95fa20b929 100644 --- a/components/esp_hal_mspi/esp32c3/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32c3/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" diff --git a/components/esp_hal_mspi/esp32c3/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32c3/include/hal/spimem_flash_ll.h index 1fd64092e1..95931b6cd8 100644 --- a/components/esp_hal_mspi/esp32c3/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32c3/include/hal/spimem_flash_ll.h @@ -18,9 +18,9 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "soc/interrupts.h" #include "hal/assert.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" diff --git a/components/esp_hal_mspi/esp32c5/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32c5/include/hal/gpspi_flash_ll.h index 67e588da2a..503d3417ec 100644 --- a/components/esp_hal_mspi/esp32c5/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32c5/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/pcr_struct.h" #include "hal/assert.h" diff --git a/components/esp_hal_mspi/esp32c5/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32c5/include/hal/spimem_flash_ll.h index afbb8ec472..738160fa51 100644 --- a/components/esp_hal_mspi/esp32c5/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32c5/include/hal/spimem_flash_ll.h @@ -18,18 +18,17 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" -#include "soc/spi_mem_struct.h" #include "soc/spi_mem_reg.h" +#include "soc/spi_mem_struct.h" +#include "soc/interrupts.h" +#include "soc/pcr_struct.h" +#include "soc/clk_tree_defs.h" #include "hal/assert.h" #include "hal/misc.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" -#include "soc/pcr_struct.h" -#include "esp_rom_sys.h" #include "hal/clk_tree_ll.h" -#include "soc/clk_tree_defs.h" +#include "esp_rom_sys.h" #ifdef __cplusplus extern "C" { diff --git a/components/esp_hal_mspi/esp32c6/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32c6/include/hal/gpspi_flash_ll.h index db096c7f18..08209651bc 100644 --- a/components/esp_hal_mspi/esp32c6/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32c6/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/pcr_struct.h" #include "hal/spi_types.h" diff --git a/components/esp_hal_mspi/esp32c6/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32c6/include/hal/spimem_flash_ll.h index 69d2475052..7dcde206b5 100644 --- a/components/esp_hal_mspi/esp32c6/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32c6/include/hal/spimem_flash_ll.h @@ -18,14 +18,14 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "soc/interrupts.h" +#include "soc/pcr_struct.h" #include "hal/assert.h" #include "hal/misc.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" -#include "soc/pcr_struct.h" #ifdef __cplusplus extern "C" { diff --git a/components/esp_hal_mspi/esp32c61/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32c61/include/hal/gpspi_flash_ll.h index 6a3ce7894d..3d3fb019c5 100644 --- a/components/esp_hal_mspi/esp32c61/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32c61/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/pcr_struct.h" #include "hal/spi_types.h" diff --git a/components/esp_hal_mspi/esp32c61/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32c61/include/hal/spimem_flash_ll.h index 892e08ca96..1392900320 100644 --- a/components/esp_hal_mspi/esp32c61/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32c61/include/hal/spimem_flash_ll.h @@ -18,17 +18,17 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "soc/interrupts.h" +#include "soc/pcr_struct.h" +#include "soc/clk_tree_defs.h" #include "hal/assert.h" #include "hal/misc.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" -#include "soc/pcr_struct.h" -#include "esp_rom_sys.h" #include "hal/clk_tree_ll.h" -#include "soc/clk_tree_defs.h" +#include "esp_rom_sys.h" #ifdef __cplusplus extern "C" { diff --git a/components/esp_hal_mspi/esp32h2/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32h2/include/hal/gpspi_flash_ll.h index 8c101b3ee9..136b12aebf 100644 --- a/components/esp_hal_mspi/esp32h2/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32h2/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/pcr_struct.h" #include "hal/spi_types.h" diff --git a/components/esp_hal_mspi/esp32h2/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32h2/include/hal/spimem_flash_ll.h index ac41f18087..d39bdf008c 100644 --- a/components/esp_hal_mspi/esp32h2/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32h2/include/hal/spimem_flash_ll.h @@ -18,14 +18,14 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "soc/interrupts.h" +#include "soc/pcr_struct.h" +#include "soc/clk_tree_defs.h" #include "hal/assert.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" -#include "soc/pcr_struct.h" -#include "soc/clk_tree_defs.h" #include "hal/misc.h" #ifdef __cplusplus diff --git a/components/esp_hal_mspi/esp32h21/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32h21/include/hal/gpspi_flash_ll.h index 49424e110d..c2705cbd89 100644 --- a/components/esp_hal_mspi/esp32h21/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32h21/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/pcr_struct.h" #include "hal/spi_types.h" diff --git a/components/esp_hal_mspi/esp32h21/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32h21/include/hal/spimem_flash_ll.h index be05c189cd..15b7d7c01f 100644 --- a/components/esp_hal_mspi/esp32h21/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32h21/include/hal/spimem_flash_ll.h @@ -18,18 +18,16 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "soc/interrupts.h" +#include "soc/pcr_struct.h" +#include "soc/clk_tree_defs.h" #include "hal/assert.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" -#include "soc/pcr_struct.h" -#include "soc/clk_tree_defs.h" #include "hal/misc.h" -//TODO: [ESP32H21] IDF-11609, inherit from h2 - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hal_mspi/esp32h4/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32h4/include/hal/gpspi_flash_ll.h index d46fcdeea3..bffcc612d4 100644 --- a/components/esp_hal_mspi/esp32h4/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32h4/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/pcr_struct.h" #include "hal/spi_types.h" diff --git a/components/esp_hal_mspi/esp32h4/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32h4/include/hal/spimem_flash_ll.h index e1e7c416fd..7bf08153ac 100644 --- a/components/esp_hal_mspi/esp32h4/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32h4/include/hal/spimem_flash_ll.h @@ -18,14 +18,14 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "soc/pcr_struct.h" +#include "soc/interrupts.h" #include "hal/assert.h" #include "hal/misc.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" -#include "soc/pcr_struct.h" #include "esp_rom_sys.h" #ifdef __cplusplus diff --git a/components/esp_hal_mspi/esp32p4/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32p4/include/hal/gpspi_flash_ll.h index 4ada4c24ed..a4db74e33c 100644 --- a/components/esp_hal_mspi/esp32p4/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32p4/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "soc/hp_sys_clkrst_struct.h" #include "hal/assert.h" diff --git a/components/esp_hal_mspi/esp32p4/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32p4/include/hal/spimem_flash_ll.h index eba6f06368..d887f1ad2e 100644 --- a/components/esp_hal_mspi/esp32p4/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32p4/include/hal/spimem_flash_ll.h @@ -18,17 +18,18 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" +#include "soc/spi_mem_struct.h" #include "soc/spi1_mem_c_struct.h" #include "soc/spi1_mem_c_reg.h" #include "soc/hp_sys_clkrst_struct.h" +#include "soc/interrupts.h" +#include "soc/chip_revision.h" #include "hal/assert.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" #include "hal/misc.h" #include "hal/efuse_hal.h" -#include "soc/chip_revision.h" #include "hal/clk_tree_ll.h" #include "hal/config.h" diff --git a/components/esp_hal_mspi/esp32s2/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32s2/include/hal/gpspi_flash_ll.h index b7ccf36148..834faeb0fe 100644 --- a/components/esp_hal_mspi/esp32s2/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32s2/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" diff --git a/components/esp_hal_mspi/esp32s2/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32s2/include/hal/spimem_flash_ll.h index 80ef0ecc1e..85813ca4c7 100644 --- a/components/esp_hal_mspi/esp32s2/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32s2/include/hal/spimem_flash_ll.h @@ -18,8 +18,7 @@ #include // For MIN/MAX #include #include - -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" #include "hal/assert.h" #include "hal/spi_types.h" diff --git a/components/esp_hal_mspi/esp32s3/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32s3/include/hal/gpspi_flash_ll.h index e19b44351a..71e3cfe103 100644 --- a/components/esp_hal_mspi/esp32s3/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32s3/include/hal/gpspi_flash_ll.h @@ -13,8 +13,8 @@ #pragma once #include -#include "soc/spi_periph.h" #include "soc/spi_struct.h" +#include "soc/spi_reg.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" #include // For MIN/MAX diff --git a/components/esp_hal_mspi/esp32s3/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32s3/include/hal/spimem_flash_ll.h index 1f7eccfb0b..5158b5ba1e 100644 --- a/components/esp_hal_mspi/esp32s3/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32s3/include/hal/spimem_flash_ll.h @@ -19,9 +19,10 @@ #include #include -#include "soc/spi_periph.h" -#include "hal/assert.h" +#include "soc/interrupts.h" +#include "soc/spi_mem_reg.h" #include "soc/spi_mem_struct.h" +#include "hal/assert.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" #include "hal/misc.h" diff --git a/components/esp_hal_mspi/esp32s31/include/hal/gpspi_flash_ll.h b/components/esp_hal_mspi/esp32s31/include/hal/gpspi_flash_ll.h index 79af59489c..0e2468388e 100644 --- a/components/esp_hal_mspi/esp32s31/include/hal/gpspi_flash_ll.h +++ b/components/esp_hal_mspi/esp32s31/include/hal/gpspi_flash_ll.h @@ -13,7 +13,7 @@ #pragma once #include -#include "soc/spi_periph.h" +#include "soc/spi_reg.h" #include "soc/spi_struct.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" diff --git a/components/esp_hal_mspi/esp32s31/include/hal/spimem_flash_ll.h b/components/esp_hal_mspi/esp32s31/include/hal/spimem_flash_ll.h index 9d4fefb9b4..b849e72edd 100644 --- a/components/esp_hal_mspi/esp32s31/include/hal/spimem_flash_ll.h +++ b/components/esp_hal_mspi/esp32s31/include/hal/spimem_flash_ll.h @@ -19,16 +19,18 @@ #include #include -#include "soc/spi_periph.h" +#include "soc/spi_mem_reg.h" +#include "soc/spi_mem_struct.h" #include "soc/spi1_mem_c_struct.h" #include "soc/spi1_mem_c_reg.h" #include "soc/hp_sys_clkrst_struct.h" +#include "soc/interrupts.h" +#include "soc/chip_revision.h" #include "hal/assert.h" #include "hal/spi_types.h" #include "hal/spi_flash_types.h" #include "hal/misc.h" #include "hal/efuse_hal.h" -#include "soc/chip_revision.h" #include "hal/clk_tree_ll.h" #ifdef __cplusplus diff --git a/components/esp_hal_touch_sens/esp32s2/touch_sensor_legacy_hal.c b/components/esp_hal_touch_sens/esp32s2/touch_sensor_legacy_hal.c index 4c11f843c1..306c096c8c 100644 --- a/components/esp_hal_touch_sens/esp32s2/touch_sensor_legacy_hal.c +++ b/components/esp_hal_touch_sens/esp32s2/touch_sensor_legacy_hal.c @@ -6,7 +6,6 @@ // The HAL layer for Touch Sensor (common part) -#include "soc/soc_pins.h" #include "hal/touch_sensor_legacy_hal.h" #include "hal/touch_sensor_legacy_types.h" diff --git a/components/esp_hal_touch_sens/esp32s3/touch_sensor_legacy_hal.c b/components/esp_hal_touch_sens/esp32s3/touch_sensor_legacy_hal.c index ed667f0b81..665ddbfcd4 100644 --- a/components/esp_hal_touch_sens/esp32s3/touch_sensor_legacy_hal.c +++ b/components/esp_hal_touch_sens/esp32s3/touch_sensor_legacy_hal.c @@ -6,7 +6,6 @@ // The HAL layer for Touch Sensor (common part) -#include "soc/soc_pins.h" #include "hal/touch_sensor_legacy_hal.h" #include "hal/touch_sensor_ll.h" #include "hal/touch_sensor_legacy_types.h" diff --git a/components/esp_hal_usb/include/soc/usb_periph.h b/components/esp_hal_usb/include/soc/usb_periph.h index 0002df78b1..edc96c6ac6 100644 --- a/components/esp_hal_usb/include/soc/usb_periph.h +++ b/components/esp_hal_usb/include/soc/usb_periph.h @@ -8,7 +8,7 @@ #include #include -#include "soc/soc_pins.h" +#include "soc/gpio_pins.h" #include "soc/soc_caps.h" #include "soc/gpio_sig_map.h" diff --git a/components/esp_psram/esp32/esp_psram_impl_quad.c b/components/esp_psram/esp32/esp_psram_impl_quad.c index 6a4f643c17..f5ba2ae2e4 100644 --- a/components/esp_psram/esp32/esp_psram_impl_quad.c +++ b/components/esp_psram/esp32/esp_psram_impl_quad.c @@ -23,7 +23,6 @@ #include "soc/dport_reg.h" #include "soc/efuse_periph.h" #include "soc/soc_caps.h" -#include "soc/spi_periph.h" #include "soc/chip_revision.h" #include "driver/gpio.h" #include "hal/efuse_hal.h" diff --git a/components/esp_psram/esp32s3/esp_psram_impl_octal.c b/components/esp_psram/esp32s3/esp_psram_impl_octal.c index bf80027722..a5e1aaf999 100644 --- a/components/esp_psram/esp32s3/esp_psram_impl_octal.c +++ b/components/esp_psram/esp32s3/esp_psram_impl_octal.c @@ -18,6 +18,7 @@ #include "esp32s3/rom/cache.h" #include "soc/gpio_periph.h" #include "soc/io_mux_reg.h" +#include "soc/spi_pins.h" #include "soc/syscon_reg.h" #include "esp_private/spi_flash_os.h" #include "esp_private/mspi_timing_tuning.h" diff --git a/components/esp_rom/patches/esp_rom_spiflash.c b/components/esp_rom/patches/esp_rom_spiflash.c index f66bc8b5f7..6d4573f9cb 100644 --- a/components/esp_rom/patches/esp_rom_spiflash.c +++ b/components/esp_rom/patches/esp_rom_spiflash.c @@ -5,7 +5,14 @@ */ #include "sdkconfig.h" -#include "soc/spi_periph.h" +#include "soc/soc_caps.h" +#include "soc/soc.h" +#include "soc/spi_reg.h" +#if SOC_MEMSPI_IS_INDEPENDENT +#include "soc/spi_mem_struct.h" +#include "soc/spi_mem_reg.h" +#endif + #include "esp_rom_spiflash.h" #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/spi_flash.h" diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index fbaef8f0fe..6b9367b5f3 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -148,20 +148,6 @@ elseif(NOT BOOTLOADER_BUILD) list(APPEND srcs "ppa_hal.c") endif() - if(CONFIG_SOC_GPSPI_SUPPORTED) - # Remember to add esp_hal_gpio to esp_hal_spi PRIV_REQUIRES!!! - list(APPEND srcs - "spi_hal.c" - "spi_hal_iram.c" - "spi_slave_hal.c" - "spi_slave_hal_iram.c" - ) - - if(CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2) - list(APPEND srcs "spi_slave_hd_hal.c") - endif() - endif() - if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED) list(APPEND srcs "sdio_slave_hal.c") endif() diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index 42fff8813a..2b920bb4bc 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -68,11 +68,6 @@ if(CONFIG_SOC_DEBUG_PROBE_SUPPORTED) list(APPEND srcs "${target_folder}/debug_probe_periph.c") endif() - -if(CONFIG_SOC_GPSPI_SUPPORTED) - list(APPEND srcs "${target_folder}/spi_periph.c") -endif() - if(CONFIG_SOC_LEDC_SUPPORTED) list(APPEND srcs "${target_folder}/ledc_periph.c") endif() diff --git a/components/soc/esp32/include/soc/soc_pins.h b/components/soc/esp32/include/soc/soc_pins.h deleted file mode 100644 index 3edba16fe4..0000000000 --- a/components/soc/esp32/include/soc/soc_pins.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2010-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" -#include "soc/sdio_slave_pins.h" -#include "soc/sdmmc_pins.h" diff --git a/components/soc/esp32/sdio_slave_periph.c b/components/soc/esp32/sdio_slave_periph.c index 6d253d0c11..1e9fe450d0 100644 --- a/components/soc/esp32/sdio_slave_periph.c +++ b/components/soc/esp32/sdio_slave_periph.c @@ -6,6 +6,7 @@ #include #include "soc/sdio_slave_periph.h" +#include "soc/sdio_slave_pins.h" /** * I/O slot of sdio slave: diff --git a/components/soc/esp32/sdmmc_periph.c b/components/soc/esp32/sdmmc_periph.c index eced0608fa..d236fc40af 100644 --- a/components/soc/esp32/sdmmc_periph.c +++ b/components/soc/esp32/sdmmc_periph.c @@ -5,6 +5,7 @@ */ #include "soc/sdmmc_periph.h" +#include "soc/sdmmc_pins.h" const sdmmc_slot_info_t sdmmc_slot_info[SOC_SDMMC_NUM_SLOTS] = { { diff --git a/components/soc/esp32c2/include/soc/soc_pins.h b/components/soc/esp32c2/include/soc/soc_pins.h deleted file mode 100644 index 2f504dac86..0000000000 --- a/components/soc/esp32c2/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32c3/include/soc/soc_pins.h b/components/soc/esp32c3/include/soc/soc_pins.h deleted file mode 100644 index fccf303153..0000000000 --- a/components/soc/esp32c3/include/soc/soc_pins.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32c5/include/soc/soc_pins.h b/components/soc/esp32c5/include/soc/soc_pins.h deleted file mode 100644 index 7b84e2ac05..0000000000 --- a/components/soc/esp32c5/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32c6/include/soc/soc_pins.h b/components/soc/esp32c6/include/soc/soc_pins.h deleted file mode 100644 index 0340b965a8..0000000000 --- a/components/soc/esp32c6/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32c61/include/soc/soc_pins.h b/components/soc/esp32c61/include/soc/soc_pins.h deleted file mode 100644 index 0340b965a8..0000000000 --- a/components/soc/esp32c61/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32h2/include/soc/soc_pins.h b/components/soc/esp32h2/include/soc/soc_pins.h deleted file mode 100644 index 2f504dac86..0000000000 --- a/components/soc/esp32h2/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32h21/include/soc/soc_pins.h b/components/soc/esp32h21/include/soc/soc_pins.h deleted file mode 100644 index 0340b965a8..0000000000 --- a/components/soc/esp32h21/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32h4/include/soc/soc_pins.h b/components/soc/esp32h4/include/soc/soc_pins.h deleted file mode 100644 index 0340b965a8..0000000000 --- a/components/soc/esp32h4/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32p4/include/soc/soc_pins.h b/components/soc/esp32p4/include/soc/soc_pins.h deleted file mode 100644 index 3000c4180f..0000000000 --- a/components/soc/esp32p4/include/soc/soc_pins.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" -#include "soc/sdmmc_pins.h" diff --git a/components/soc/esp32p4/sdio_slave_periph.c b/components/soc/esp32p4/sdio_slave_periph.c deleted file mode 100644 index 98984742eb..0000000000 --- a/components/soc/esp32p4/sdio_slave_periph.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ -#include -#include "soc/sdio_slave_periph.h" -#include "soc/sdio_slave_pins.h" - -const sdio_slave_slot_info_t sdio_slave_slot_info[1] = { - -}; diff --git a/components/soc/esp32p4/sdmmc_periph.c b/components/soc/esp32p4/sdmmc_periph.c index 74a62f2781..75aef4f3be 100644 --- a/components/soc/esp32p4/sdmmc_periph.c +++ b/components/soc/esp32p4/sdmmc_periph.c @@ -5,6 +5,8 @@ */ #include "soc/sdmmc_periph.h" +#include "soc/sdmmc_pins.h" + const sdmmc_slot_info_t sdmmc_slot_info[SOC_SDMMC_NUM_SLOTS] = { { .width = 8, diff --git a/components/soc/esp32s2/include/soc/soc_pins.h b/components/soc/esp32s2/include/soc/soc_pins.h deleted file mode 100644 index aa5d337198..0000000000 --- a/components/soc/esp32s2/include/soc/soc_pins.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#pragma once - -#include "soc/usb_pins.h" -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/esp32s3/include/soc/soc_pins.h b/components/soc/esp32s3/include/soc/soc_pins.h deleted file mode 100644 index c726129608..0000000000 --- a/components/soc/esp32s3/include/soc/soc_pins.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/usb_pins.h" -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" -#include "soc/sdmmc_pins.h" diff --git a/components/soc/esp32s3/sdmmc_periph.c b/components/soc/esp32s3/sdmmc_periph.c index a16cf9bb1f..9dc973c3b8 100644 --- a/components/soc/esp32s3/sdmmc_periph.c +++ b/components/soc/esp32s3/sdmmc_periph.c @@ -5,6 +5,7 @@ */ #include "soc/sdmmc_periph.h" +#include "soc/sdmmc_pins.h" const sdmmc_slot_info_t sdmmc_slot_info[SOC_SDMMC_NUM_SLOTS] = { { diff --git a/components/soc/esp32s31/include/soc/soc_pins.h b/components/soc/esp32s31/include/soc/soc_pins.h deleted file mode 100644 index 0340b965a8..0000000000 --- a/components/soc/esp32s31/include/soc/soc_pins.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -/* - * Pin definition header file. The long term plan is to have a single soc_pins.h for all - * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each - * peripheral and include them here to avoid developing conflicts in those header files. - */ - -#pragma once - -#include "soc/gpio_pins.h" -#include "soc/spi_pins.h" diff --git a/components/soc/include/soc/sdio_slave_periph.h b/components/soc/include/soc/sdio_slave_periph.h index 8cdcbc6b77..25e47da2bd 100644 --- a/components/soc/include/soc/sdio_slave_periph.h +++ b/components/soc/include/soc/sdio_slave_periph.h @@ -8,7 +8,6 @@ #include //include soc related (generated) definitions #include "soc/soc_caps.h" -#include "soc/soc_pins.h" #if SOC_SDIO_SLAVE_SUPPORTED #include "soc/sdio_slc_reg.h" #include "soc/sdio_slc_struct.h" diff --git a/components/soc/include/soc/sdmmc_periph.h b/components/soc/include/soc/sdmmc_periph.h index 592ed0af5d..71d34ab8b2 100644 --- a/components/soc/include/soc/sdmmc_periph.h +++ b/components/soc/include/soc/sdmmc_periph.h @@ -8,7 +8,6 @@ #include //include soc related (generated) definitions #include "soc/soc_caps.h" -#include "soc/soc_pins.h" #include "soc/gpio_num.h" #if SOC_SDMMC_HOST_SUPPORTED #include "soc/sdmmc_reg.h" diff --git a/components/soc/linux/include/soc/soc_pins.h b/components/soc/linux/include/soc/soc_pins.h deleted file mode 100644 index 7fc8c23f8e..0000000000 --- a/components/soc/linux/include/soc/soc_pins.h +++ /dev/null @@ -1,7 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#pragma once diff --git a/components/spi_flash/flash_ops.c b/components/spi_flash/flash_ops.c index bc332f8e11..4cf2e9cee9 100644 --- a/components/spi_flash/flash_ops.c +++ b/components/spi_flash/flash_ops.c @@ -16,6 +16,7 @@ #include #include #include "soc/io_mux_reg.h" +#include "soc/spi_pins.h" #include "sdkconfig.h" #include "esp_attr.h" #include "esp_cpu.h" diff --git a/components/ulp/CMakeLists.txt b/components/ulp/CMakeLists.txt index 9a6c0ae019..41ee4bbd5f 100644 --- a/components/ulp/CMakeLists.txt +++ b/components/ulp/CMakeLists.txt @@ -94,11 +94,8 @@ if(CONFIG_ULP_COPROC_TYPE_LP_CORE) endif() -idf_component_register(SRCS ${srcs} - INCLUDE_DIRS ${includes} - REQUIRES esp_adc - esp_driver_gpio - esp_driver_uart - esp_driver_i2s - esp_hal_i2c - esp_hal_touch_sens) +idf_component_register( + SRCS ${srcs} + INCLUDE_DIRS ${includes} + REQUIRES esp_adc esp_driver_gpio esp_driver_uart esp_driver_i2s esp_hal_i2c esp_hal_touch_sens esp_hal_gpspi +) diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index f2c21af387..3cd69920ed 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -168,6 +168,7 @@ INPUT = \ $(PROJECT_PATH)/components/esp_hal_gpio/include/hal/gpio_types.h \ $(PROJECT_PATH)/components/esp_hal_gpio/include/hal/rtc_io_types.h \ $(PROJECT_PATH)/components/esp_hal_gpio/include/hal/sdm_types.h \ + $(PROJECT_PATH)/components/esp_hal_gpspi/include/hal/spi_types.h \ $(PROJECT_PATH)/components/esp_hal_timg/include/hal/timer_types.h \ $(PROJECT_PATH)/components/esp_hal_i2c/include/hal/i2c_types.h \ $(PROJECT_PATH)/components/esp_hal_i2s/include/hal/i2s_types.h \ @@ -267,7 +268,6 @@ INPUT = \ $(PROJECT_PATH)/components/hal/include/hal/ledc_types.h \ $(PROJECT_PATH)/components/hal/include/hal/mcpwm_types.h \ $(PROJECT_PATH)/components/hal/include/hal/sdio_slave_types.h \ - $(PROJECT_PATH)/components/hal/include/hal/spi_types.h \ $(PROJECT_PATH)/components/hal/include/hal/temperature_sensor_types.h \ $(PROJECT_PATH)/components/hal/include/hal/uart_types.h \ $(PROJECT_PATH)/components/hal/include/hal/efuse_hal.h \ diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index eae744a8fc..8420a51c2f 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -460,8 +460,6 @@ components/fatfs/src/ff.h components/fatfs/src/ffconf.h components/fatfs/src/ffsystem.c components/fatfs/src/ffunicode.c -components/hal/spi_slave_hal.c -components/hal/spi_slave_hal_iram.c components/idf_test/include/idf_performance.h components/log/host_test/log_test/main/log_test.cpp components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/test_gen_crt_bundle.py diff --git a/tools/test_apps/system/g1_components/CMakeLists.txt b/tools/test_apps/system/g1_components/CMakeLists.txt index 1fe32a80b8..c07ada24d9 100644 --- a/tools/test_apps/system/g1_components/CMakeLists.txt +++ b/tools/test_apps/system/g1_components/CMakeLists.txt @@ -28,6 +28,7 @@ set(esp_hal_components esp_hal_usb esp_hal_wdt esp_hal_twai + esp_hal_gpspi ) set(COMPONENTS ${g0_components} ${g1_components} ${esp_hal_components} main)