From 193fca5b95610b8eb37a8b9f8bfe6825facd4b7b Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 15 Sep 2026 17:54:14 +0800 Subject: [PATCH] refactor(hal): extract cache && mmu HAL into esp_hal_cache --- .../main/ld/esp32/bootloader.sections.ld.in | 2 +- .../main/ld/esp32c2/bootloader.sections.ld.in | 4 +- .../main/ld/esp32c3/bootloader.sections.ld.in | 4 +- .../main/ld/esp32c5/bootloader.sections.ld.in | 4 +- .../main/ld/esp32c6/bootloader.sections.ld.in | 4 +- .../ld/esp32c61/bootloader.sections.ld.in | 4 +- .../main/ld/esp32h2/bootloader.sections.ld.in | 4 +- .../ld/esp32h21/bootloader.sections.ld.in | 4 +- .../main/ld/esp32h4/bootloader.sections.ld.in | 4 +- .../main/ld/esp32p4/bootloader.sections.ld.in | 8 +- .../main/ld/esp32s2/bootloader.sections.ld.in | 4 +- .../main/ld/esp32s3/bootloader.sections.ld.in | 4 +- .../ld/esp32s31/bootloader.sections.ld.in | 4 +- components/bootloader_support/CMakeLists.txt | 6 +- .../test_apps/esp_common/main/CMakeLists.txt | 2 +- components/esp_driver_dma/CMakeLists.txt | 2 +- .../test_apps/parlio/main/CMakeLists.txt | 2 +- components/esp_hal_cache/CMakeLists.txt | 38 ++++++ components/esp_hal_cache/README.md | 39 ++++++ components/{hal => esp_hal_cache}/cache_hal.c | 2 - .../esp32/cache_hal_esp32.c | 0 .../esp32/include/hal/cache_ll.h | 0 .../esp32/include/hal/mmu_ll.h | 0 .../esp32c2/include/hal/cache_ll.h | 0 .../esp32c2/include/hal/mmu_ll.h | 0 .../esp32c3/include/hal/cache_ll.h | 0 .../esp32c3/include/hal/mmu_ll.h | 0 .../esp32c5/cache_periph.c | 0 .../esp32c5/include/hal/cache_ll.h | 0 .../esp32c5/include/hal/mmu_ll.h | 0 .../esp32c6/cache_periph.c | 0 .../esp32c6/include/hal/cache_ll.h | 0 .../esp32c6/include/hal/mmu_ll.h | 0 .../esp32c61/cache_periph.c | 0 .../esp32c61/include/hal/cache_ll.h | 0 .../esp32c61/include/hal/mmu_ll.h | 0 .../esp32h2/cache_periph.c | 0 .../esp32h2/include/hal/cache_ll.h | 0 .../esp32h2/include/hal/mmu_ll.h | 0 .../esp32h21/cache_periph.c | 0 .../esp32h21/include/hal/cache_ll.h | 0 .../esp32h21/include/hal/mmu_ll.h | 0 .../esp32h4/cache_periph.c | 0 .../esp32h4/include/hal/cache_ll.h | 0 .../esp32h4/include/hal/mmu_ll.h | 0 .../esp32p4/cache_periph.c | 0 .../esp32p4/include/hal/cache_ll.h | 0 .../esp32p4/include/hal/mmu_ll.h | 0 .../esp32s2/include/hal/cache_ll.h | 0 .../esp32s2/include/hal/mmu_ll.h | 13 -- .../esp32s3/include/hal/cache_ll.h | 0 .../esp32s3/include/hal/mmu_ll.h | 0 .../esp32s31/cache_periph.c | 0 .../esp32s31/include/hal/cache_ll.h | 0 .../esp32s31/include/hal/mmu_ll.h | 0 .../include/hal/cache_hal.h | 0 .../include/hal/cache_periph.h | 0 .../include/hal/cache_types.h | 0 .../include/hal/mmu_hal.h | 0 .../include/hal/mmu_types.h | 0 components/{hal => esp_hal_cache}/linker.lf | 6 +- components/{hal => esp_hal_cache}/mmu_hal.c | 0 .../esp_hal_debug_assist/CMakeLists.txt | 4 + .../esp32p4/debug_probe_periph.c | 4 +- .../include/hal}/debug_probe_targets.h | 2 +- .../esp32s31/debug_probe_periph.c | 4 +- .../include/hal}/debug_probe_targets.h | 2 +- .../include/hal}/debug_probe_periph.h | 2 +- .../esp_hal_gpio/esp32h4/rtc_io_periph.c | 2 +- components/esp_hal_pmu/CMakeLists.txt | 1 + components/esp_hal_pmu/README.md | 3 + .../esp32}/power_supply_periph.c | 4 +- .../esp32c2}/power_supply_periph.c | 4 +- .../esp32c3}/power_supply_periph.c | 4 +- .../esp32c5/power_supply_periph.c | 4 +- .../esp32c6/power_supply_periph.c | 4 +- .../esp32c61/power_supply_periph.c | 4 +- .../esp32h2/power_supply_periph.c | 4 +- .../esp32h21/power_supply_periph.c | 11 ++ .../esp32h4/power_supply_periph.c | 4 +- .../esp32p4/power_supply_periph.c | 4 +- .../esp32s2}/power_supply_periph.c | 4 +- .../esp_hal_pmu/esp32s3/power_supply_periph.c | 11 ++ .../esp32s31/power_supply_periph.c | 4 +- .../include/hal}/power_supply_periph.h | 2 +- .../esp32s2/include/hal/sha_ll.h | 17 ++- components/esp_hw_support/CMakeLists.txt | 2 +- .../esp_hw_support/debug_probe/debug_probe.c | 2 +- .../include/esp_private/debug_probe_types.h | 2 +- .../esp_hw_support/power_supply/brownout.c | 2 +- components/esp_hw_support/power_supply/vbat.c | 2 +- components/esp_image_verify/CMakeLists.txt | 2 +- .../test_apps/newlib/main/CMakeLists.txt | 2 +- components/esp_mm/CMakeLists.txt | 3 + components/esp_mspi/CMakeLists.txt | 2 +- .../main/CMakeLists.txt | 3 +- components/esp_tee/CMakeLists.txt | 2 +- .../subproject/main/ld/esp32c5/esp_tee.ld.in | 8 +- .../subproject/main/ld/esp32c6/esp_tee.ld.in | 8 +- .../subproject/main/ld/esp32c61/esp_tee.ld.in | 8 +- .../subproject/main/ld/esp32h2/esp_tee.ld.in | 8 +- .../test_apps/freertos/kernel/CMakeLists.txt | 2 +- components/hal/CMakeLists.txt | 27 +---- .../test_apps/heap_tests/main/CMakeLists.txt | 2 +- components/mbedtls/CMakeLists.txt | 2 +- components/soc/CMakeLists.txt | 8 -- components/soc/esp32/pcnt_periph.c | 114 ------------------ components/soc/esp32h21/power_supply_periph.c | 11 -- components/soc/esp32s3/power_supply_periph.c | 11 -- components/spi_flash/CMakeLists.txt | 2 +- .../flash_suspend/main/CMakeLists.txt | 3 +- 111 files changed, 226 insertions(+), 285 deletions(-) create mode 100644 components/esp_hal_cache/CMakeLists.txt create mode 100644 components/esp_hal_cache/README.md rename components/{hal => esp_hal_cache}/cache_hal.c (99%) rename components/{hal => esp_hal_cache}/esp32/cache_hal_esp32.c (100%) rename components/{hal => esp_hal_cache}/esp32/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c2/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c2/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c3/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c3/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c5/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32c5/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c5/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c6/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32c6/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c6/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c61/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32c61/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32c61/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32h2/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32h2/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32h2/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32h21/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32h21/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32h21/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32h4/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32h4/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32h4/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32p4/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32p4/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32p4/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32s2/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32s2/include/hal/mmu_ll.h (96%) rename components/{hal => esp_hal_cache}/esp32s3/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32s3/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32s31/cache_periph.c (100%) rename components/{hal => esp_hal_cache}/esp32s31/include/hal/cache_ll.h (100%) rename components/{hal => esp_hal_cache}/esp32s31/include/hal/mmu_ll.h (100%) rename components/{hal => esp_hal_cache}/include/hal/cache_hal.h (100%) rename components/{hal => esp_hal_cache}/include/hal/cache_periph.h (100%) rename components/{hal => esp_hal_cache}/include/hal/cache_types.h (100%) rename components/{hal => esp_hal_cache}/include/hal/mmu_hal.h (100%) rename components/{hal => esp_hal_cache}/include/hal/mmu_types.h (100%) rename components/{hal => esp_hal_cache}/linker.lf (78%) rename components/{hal => esp_hal_cache}/mmu_hal.c (100%) rename components/{soc => esp_hal_debug_assist}/esp32p4/debug_probe_periph.c (95%) rename components/{soc/esp32p4/include/soc => esp_hal_debug_assist/esp32p4/include/hal}/debug_probe_targets.h (98%) rename components/{soc => esp_hal_debug_assist}/esp32s31/debug_probe_periph.c (95%) rename components/{soc/esp32s31/include/soc => esp_hal_debug_assist/esp32s31/include/hal}/debug_probe_targets.h (98%) rename components/{soc/include/soc => esp_hal_debug_assist/include/hal}/debug_probe_periph.h (91%) rename components/{soc/esp32s2 => esp_hal_pmu/esp32}/power_supply_periph.c (68%) rename components/{soc/esp32 => esp_hal_pmu/esp32c2}/power_supply_periph.c (68%) rename components/{soc/esp32c2 => esp_hal_pmu/esp32c3}/power_supply_periph.c (68%) rename components/{soc => esp_hal_pmu}/esp32c5/power_supply_periph.c (69%) rename components/{soc => esp_hal_pmu}/esp32c6/power_supply_periph.c (69%) rename components/{soc => esp_hal_pmu}/esp32c61/power_supply_periph.c (69%) rename components/{soc => esp_hal_pmu}/esp32h2/power_supply_periph.c (69%) create mode 100644 components/esp_hal_pmu/esp32h21/power_supply_periph.c rename components/{soc => esp_hal_pmu}/esp32h4/power_supply_periph.c (69%) rename components/{soc => esp_hal_pmu}/esp32p4/power_supply_periph.c (69%) rename components/{soc/esp32c3 => esp_hal_pmu/esp32s2}/power_supply_periph.c (68%) create mode 100644 components/esp_hal_pmu/esp32s3/power_supply_periph.c rename components/{soc => esp_hal_pmu}/esp32s31/power_supply_periph.c (69%) rename components/{soc/include/soc => esp_hal_pmu/include/hal}/power_supply_periph.h (87%) delete mode 100644 components/soc/esp32/pcnt_periph.c delete mode 100644 components/soc/esp32h21/power_supply_periph.c delete mode 100644 components/soc/esp32s3/power_supply_periph.c diff --git a/components/bootloader/subproject/main/ld/esp32/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32/bootloader.sections.ld.in index 9c55f7cdf2f..c262c1b1b99 100644 --- a/components/bootloader/subproject/main/ld/esp32/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32/bootloader.sections.ld.in @@ -31,7 +31,7 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32c2/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32c2/bootloader.sections.ld.in index 62355c0e853..3f7b3a90e5d 100644 --- a/components/bootloader/subproject/main/ld/esp32c2/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32c2/bootloader.sections.ld.in @@ -30,8 +30,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32c3/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32c3/bootloader.sections.ld.in index 11f13c9d6c3..e9a4fc7ed29 100644 --- a/components/bootloader/subproject/main/ld/esp32c3/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32c3/bootloader.sections.ld.in @@ -29,8 +29,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in index 912ca71e9c3..0aafa65c27f 100644 --- a/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in @@ -31,8 +31,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32c6/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32c6/bootloader.sections.ld.in index b9d5348acf3..80acb8184e5 100644 --- a/components/bootloader/subproject/main/ld/esp32c6/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32c6/bootloader.sections.ld.in @@ -32,8 +32,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32c61/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32c61/bootloader.sections.ld.in index a431188a747..4bdb8dee1d4 100644 --- a/components/bootloader/subproject/main/ld/esp32c61/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32c61/bootloader.sections.ld.in @@ -31,8 +31,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32h2/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32h2/bootloader.sections.ld.in index cdb0356aaa1..e32480d31ae 100644 --- a/components/bootloader/subproject/main/ld/esp32h2/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32h2/bootloader.sections.ld.in @@ -30,8 +30,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32h21/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32h21/bootloader.sections.ld.in index cdb0356aaa1..e32480d31ae 100644 --- a/components/bootloader/subproject/main/ld/esp32h21/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32h21/bootloader.sections.ld.in @@ -30,8 +30,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32h4/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32h4/bootloader.sections.ld.in index a431188a747..4bdb8dee1d4 100644 --- a/components/bootloader/subproject/main/ld/esp32h4/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32h4/bootloader.sections.ld.in @@ -31,8 +31,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in index 4f8d7eb7869..71da6670bd5 100644 --- a/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in @@ -30,8 +30,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ @@ -72,8 +72,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:key_mgr_hal.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32s2/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32s2/bootloader.sections.ld.in index 4dcc26c67c2..da4bdfd55ff 100644 --- a/components/bootloader/subproject/main/ld/esp32s2/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32s2/bootloader.sections.ld.in @@ -31,8 +31,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32s3/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32s3/bootloader.sections.ld.in index f5a70c3cdd4..4c4c1cc4bbe 100644 --- a/components/bootloader/subproject/main/ld/esp32s3/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32s3/bootloader.sections.ld.in @@ -31,8 +31,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in index 912ca71e9c3..0aafa65c27f 100644 --- a/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in @@ -31,8 +31,8 @@ *libesp_image_verify.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*) \ *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*) \ *libspi_flash.a:*.*(.literal .text .literal.* .text.*) \ - *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*) \ - *libhal.a:cache_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:mmu_hal.*(.literal .text .literal.* .text.*) \ + *libesp_hal_cache.a:cache_hal.*(.literal .text .literal.* .text.*) \ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader_support/CMakeLists.txt b/components/bootloader_support/CMakeLists.txt index 9ab4564f8fd..0fe12293d46 100644 --- a/components/bootloader_support/CMakeLists.txt +++ b/components/bootloader_support/CMakeLists.txt @@ -27,7 +27,7 @@ if(esp_tee_build) # from bootloader_utility_tee.c. idf_component_register(SRCS ${tee_srcs} INCLUDE_DIRS ${tee_inc_dirs} - PRIV_REQUIRES efuse esp_app_format esptool_py esp_hal_security + PRIV_REQUIRES efuse esp_app_format esptool_py esp_hal_security esp_hal_cache esp_image_verify) return() endif() @@ -74,7 +74,7 @@ if(BOOTLOADER_BUILD OR CONFIG_APP_BUILD_TYPE_RAM) # micro-ecc is only needed for secure boot sources built under BOOTLOADER_BUILD. # For CONFIG_APP_BUILD_TYPE_RAM (loadable ELF app) we don't build those sources, # and micro-ecc lives in the bootloader subproject so it isn't available in app builds. - set(priv_requires spi_flash efuse esp_bootloader_format esp_app_format esptool_py) + set(priv_requires spi_flash efuse esp_bootloader_format esp_app_format esptool_py esp_hal_cache) if(BOOTLOADER_BUILD) list(APPEND priv_requires micro-ecc esp_image_verify) endif() @@ -97,7 +97,7 @@ else() set(include_dirs "include" "bootloader_flash/include") set(priv_include_dirs "private_include") # heap is required for `heap_memory_layout.h`. - set(priv_requires spi_flash efuse heap esp_bootloader_format esp_app_format + set(priv_requires spi_flash efuse heap esp_bootloader_format esp_app_format esp_hal_cache esptool_py) # `esp_hal_ana_conv` is required by bootloader_random_esp32xx.c list(APPEND priv_requires esp_mspi esp_hal_wdt esp_hal_gpio esp_hal_uart esp_hal_ana_conv diff --git a/components/esp_common/test_apps/esp_common/main/CMakeLists.txt b/components/esp_common/test_apps/esp_common/main/CMakeLists.txt index 41a7666f672..0c1c5d5483d 100644 --- a/components/esp_common/test_apps/esp_common/main/CMakeLists.txt +++ b/components/esp_common/test_apps/esp_common/main/CMakeLists.txt @@ -4,5 +4,5 @@ idf_component_register(SRCS "test_app_main.c" "test_esp_err_to_name.c" "test_esp_macro.c" INCLUDE_DIRS "." - PRIV_REQUIRES unity esp_mm esp_psram + PRIV_REQUIRES unity esp_mm esp_psram esp_hal_cache WHOLE_ARCHIVE) diff --git a/components/esp_driver_dma/CMakeLists.txt b/components/esp_driver_dma/CMakeLists.txt index 527b23899e2..d3165dd8c97 100644 --- a/components/esp_driver_dma/CMakeLists.txt +++ b/components/esp_driver_dma/CMakeLists.txt @@ -4,7 +4,7 @@ if(${target} STREQUAL "linux") endif() set(public_include "include") -set(requires esp_hal_dma) +set(requires esp_hal_dma esp_hal_cache) set(srcs "src/esp_dma_utils.c" "src/gdma_link.c") if(CONFIG_SOC_GDMA_SUPPORTED) diff --git a/components/esp_driver_parlio/test_apps/parlio/main/CMakeLists.txt b/components/esp_driver_parlio/test_apps/parlio/main/CMakeLists.txt index 928db0ab8ba..8ac023b7a48 100644 --- a/components/esp_driver_parlio/test_apps/parlio/main/CMakeLists.txt +++ b/components/esp_driver_parlio/test_apps/parlio/main/CMakeLists.txt @@ -19,7 +19,7 @@ endif() idf_component_register(SRCS ${srcs} PRIV_REQUIRES unity esp_driver_parlio esp_driver_gpio esp_driver_i2s esp_driver_spi esp_psram - esp_driver_bitscrambler + esp_driver_bitscrambler esp_hal_cache WHOLE_ARCHIVE) if(CONFIG_SOC_BITSCRAMBLER_SUPPORTED) diff --git a/components/esp_hal_cache/CMakeLists.txt b/components/esp_hal_cache/CMakeLists.txt new file mode 100644 index 00000000000..f9d369f9045 --- /dev/null +++ b/components/esp_hal_cache/CMakeLists.txt @@ -0,0 +1,38 @@ +idf_build_get_property(target IDF_TARGET) + +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + +set(srcs) +set(includes "include" "${target}/include") + +# The cache HAL is always built for normal apps, where the flash cache is enabled. +# Pure RAM apps do not use the flash cache, except on chips where internal memory +# accesses also go through the L1 cache (e.g. ESP32-P4): cache synchronization is +# still required around internal RAM DMA operations on such chips. +if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP OR CONFIG_SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE) + if(${target} STREQUAL "esp32") + list(APPEND srcs "esp32/cache_hal_esp32.c") + else() + list(APPEND srcs "cache_hal.c") + endif() +endif() + +# The MMU HAL implements external memory (flash/PSRAM) address translation. +# Pure RAM apps do not map any external memory, so it is not built for them. +if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP AND CONFIG_SOC_MMU_PERIPH_NUM) + list(APPEND srcs "mmu_hal.c") +endif() + +# Target-specific cache peripheral data +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/cache_periph.c") + list(APPEND srcs "${target}/cache_periph.c") +endif() + +idf_component_register( + SRCS ${srcs} + INCLUDE_DIRS ${includes} + REQUIRES soc hal + LDFRAGMENTS linker.lf +) diff --git a/components/esp_hal_cache/README.md b/components/esp_hal_cache/README.md new file mode 100644 index 00000000000..5da0119f3c9 --- /dev/null +++ b/components/esp_hal_cache/README.md @@ -0,0 +1,39 @@ +# ESP Hardware Abstraction Layer for Cache and MMU + +> [!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_cache` component provides a **Hardware Abstraction Layer** for the cache and the external-memory MMU across all ESP-IDF supported targets. It serves as a foundation for higher-level drivers (DMA drivers, `esp_mm`, `spi_flash`, etc.) by offering a consistent interface to cache maintenance and external-memory address translation, 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 the cache and MMU, including: + - Cache initialization, enabling and disabling + - Cache maintenance operations (writeback, invalidate, writeback + invalidate, sync) + - Cache freezing and preloading on supported chips + - MMU mapping operations (virtual-to-physical address translation for flash and PSRAM) + +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 (`/include/hal/cache_ll.h` and `/include/hal/mmu_ll.h`) + - Chip-specific register configurations + - Hardware feature compatibility + +Implementation notes: + +- `cache_hal.c` implements the target-independent HAL sequences; ESP32 uses its dedicated ROM-compatible implementation (`esp32/cache_hal_esp32.c`). +- `/cache_periph.c` contains target-specific cache peripheral data. + +## Usage + +This component is primarily used by ESP-IDF drivers and system components such as `esp_driver_dma`, `esp_mm`, `esp_mspi`, `spi_flash` and `esp_psram`, as well as by the bootloader. + +For advanced developers implementing custom DMA or memory-management 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. + +## Dependencies + +- `soc`: Provides cache and MMU register definitions and SoC capabilities +- `hal`: Core hardware abstraction utilities and macros diff --git a/components/hal/cache_hal.c b/components/esp_hal_cache/cache_hal.c similarity index 99% rename from components/hal/cache_hal.c rename to components/esp_hal_cache/cache_hal.c index b5bae5dc2a8..2e365452be2 100644 --- a/components/hal/cache_hal.c +++ b/components/esp_hal_cache/cache_hal.c @@ -12,8 +12,6 @@ #include "hal/cache_hal.h" #include "hal/cache_types.h" #include "hal/cache_ll.h" -#include "hal/mmu_hal.h" -#include "hal/mmu_ll.h" #include "soc/soc_caps.h" /*------------------------------------------------------------------------------ diff --git a/components/hal/esp32/cache_hal_esp32.c b/components/esp_hal_cache/esp32/cache_hal_esp32.c similarity index 100% rename from components/hal/esp32/cache_hal_esp32.c rename to components/esp_hal_cache/esp32/cache_hal_esp32.c diff --git a/components/hal/esp32/include/hal/cache_ll.h b/components/esp_hal_cache/esp32/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32/include/hal/cache_ll.h diff --git a/components/hal/esp32/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32/include/hal/mmu_ll.h diff --git a/components/hal/esp32c2/include/hal/cache_ll.h b/components/esp_hal_cache/esp32c2/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32c2/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32c2/include/hal/cache_ll.h diff --git a/components/hal/esp32c2/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32c2/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32c2/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32c2/include/hal/mmu_ll.h diff --git a/components/hal/esp32c3/include/hal/cache_ll.h b/components/esp_hal_cache/esp32c3/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32c3/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32c3/include/hal/cache_ll.h diff --git a/components/hal/esp32c3/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32c3/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32c3/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32c3/include/hal/mmu_ll.h diff --git a/components/hal/esp32c5/cache_periph.c b/components/esp_hal_cache/esp32c5/cache_periph.c similarity index 100% rename from components/hal/esp32c5/cache_periph.c rename to components/esp_hal_cache/esp32c5/cache_periph.c diff --git a/components/hal/esp32c5/include/hal/cache_ll.h b/components/esp_hal_cache/esp32c5/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32c5/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32c5/include/hal/cache_ll.h diff --git a/components/hal/esp32c5/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32c5/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32c5/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32c5/include/hal/mmu_ll.h diff --git a/components/hal/esp32c6/cache_periph.c b/components/esp_hal_cache/esp32c6/cache_periph.c similarity index 100% rename from components/hal/esp32c6/cache_periph.c rename to components/esp_hal_cache/esp32c6/cache_periph.c diff --git a/components/hal/esp32c6/include/hal/cache_ll.h b/components/esp_hal_cache/esp32c6/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32c6/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32c6/include/hal/cache_ll.h diff --git a/components/hal/esp32c6/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32c6/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32c6/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32c6/include/hal/mmu_ll.h diff --git a/components/hal/esp32c61/cache_periph.c b/components/esp_hal_cache/esp32c61/cache_periph.c similarity index 100% rename from components/hal/esp32c61/cache_periph.c rename to components/esp_hal_cache/esp32c61/cache_periph.c diff --git a/components/hal/esp32c61/include/hal/cache_ll.h b/components/esp_hal_cache/esp32c61/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32c61/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32c61/include/hal/cache_ll.h diff --git a/components/hal/esp32c61/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32c61/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32c61/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32c61/include/hal/mmu_ll.h diff --git a/components/hal/esp32h2/cache_periph.c b/components/esp_hal_cache/esp32h2/cache_periph.c similarity index 100% rename from components/hal/esp32h2/cache_periph.c rename to components/esp_hal_cache/esp32h2/cache_periph.c diff --git a/components/hal/esp32h2/include/hal/cache_ll.h b/components/esp_hal_cache/esp32h2/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32h2/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32h2/include/hal/cache_ll.h diff --git a/components/hal/esp32h2/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32h2/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32h2/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32h2/include/hal/mmu_ll.h diff --git a/components/hal/esp32h21/cache_periph.c b/components/esp_hal_cache/esp32h21/cache_periph.c similarity index 100% rename from components/hal/esp32h21/cache_periph.c rename to components/esp_hal_cache/esp32h21/cache_periph.c diff --git a/components/hal/esp32h21/include/hal/cache_ll.h b/components/esp_hal_cache/esp32h21/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32h21/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32h21/include/hal/cache_ll.h diff --git a/components/hal/esp32h21/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32h21/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32h21/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32h21/include/hal/mmu_ll.h diff --git a/components/hal/esp32h4/cache_periph.c b/components/esp_hal_cache/esp32h4/cache_periph.c similarity index 100% rename from components/hal/esp32h4/cache_periph.c rename to components/esp_hal_cache/esp32h4/cache_periph.c diff --git a/components/hal/esp32h4/include/hal/cache_ll.h b/components/esp_hal_cache/esp32h4/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32h4/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32h4/include/hal/cache_ll.h diff --git a/components/hal/esp32h4/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32h4/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32h4/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32h4/include/hal/mmu_ll.h diff --git a/components/hal/esp32p4/cache_periph.c b/components/esp_hal_cache/esp32p4/cache_periph.c similarity index 100% rename from components/hal/esp32p4/cache_periph.c rename to components/esp_hal_cache/esp32p4/cache_periph.c diff --git a/components/hal/esp32p4/include/hal/cache_ll.h b/components/esp_hal_cache/esp32p4/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32p4/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32p4/include/hal/cache_ll.h diff --git a/components/hal/esp32p4/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32p4/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32p4/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32p4/include/hal/mmu_ll.h diff --git a/components/hal/esp32s2/include/hal/cache_ll.h b/components/esp_hal_cache/esp32s2/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32s2/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32s2/include/hal/cache_ll.h diff --git a/components/hal/esp32s2/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32s2/include/hal/mmu_ll.h similarity index 96% rename from components/hal/esp32s2/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32s2/include/hal/mmu_ll.h index 9e1663028cf..36fd7cc0fa6 100644 --- a/components/hal/esp32s2/include/hal/mmu_ll.h +++ b/components/esp_hal_cache/esp32s2/include/hal/mmu_ll.h @@ -379,19 +379,6 @@ static inline uint32_t mmu_ll_entry_id_to_vaddr_base(uint32_t mmu_id, uint32_t e return vaddr_base + (entry_id << 16); } -/** - * Check if the external memory vaddr belongs to the DPORT bus region - * - * @param vaddr start of the virtual address - * - * @return True for valid - */ -__attribute__((always_inline)) -static inline bool mmu_ll_vaddr_in_dport_bus_region(uint32_t vaddr) -{ - return (vaddr >= SOC_DPORT_CACHE_ADDRESS_LOW && vaddr < SOC_DPORT_CACHE_ADDRESS_HIGH); -} - #ifdef __cplusplus } #endif diff --git a/components/hal/esp32s3/include/hal/cache_ll.h b/components/esp_hal_cache/esp32s3/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32s3/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32s3/include/hal/cache_ll.h diff --git a/components/hal/esp32s3/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32s3/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32s3/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32s3/include/hal/mmu_ll.h diff --git a/components/hal/esp32s31/cache_periph.c b/components/esp_hal_cache/esp32s31/cache_periph.c similarity index 100% rename from components/hal/esp32s31/cache_periph.c rename to components/esp_hal_cache/esp32s31/cache_periph.c diff --git a/components/hal/esp32s31/include/hal/cache_ll.h b/components/esp_hal_cache/esp32s31/include/hal/cache_ll.h similarity index 100% rename from components/hal/esp32s31/include/hal/cache_ll.h rename to components/esp_hal_cache/esp32s31/include/hal/cache_ll.h diff --git a/components/hal/esp32s31/include/hal/mmu_ll.h b/components/esp_hal_cache/esp32s31/include/hal/mmu_ll.h similarity index 100% rename from components/hal/esp32s31/include/hal/mmu_ll.h rename to components/esp_hal_cache/esp32s31/include/hal/mmu_ll.h diff --git a/components/hal/include/hal/cache_hal.h b/components/esp_hal_cache/include/hal/cache_hal.h similarity index 100% rename from components/hal/include/hal/cache_hal.h rename to components/esp_hal_cache/include/hal/cache_hal.h diff --git a/components/hal/include/hal/cache_periph.h b/components/esp_hal_cache/include/hal/cache_periph.h similarity index 100% rename from components/hal/include/hal/cache_periph.h rename to components/esp_hal_cache/include/hal/cache_periph.h diff --git a/components/hal/include/hal/cache_types.h b/components/esp_hal_cache/include/hal/cache_types.h similarity index 100% rename from components/hal/include/hal/cache_types.h rename to components/esp_hal_cache/include/hal/cache_types.h diff --git a/components/hal/include/hal/mmu_hal.h b/components/esp_hal_cache/include/hal/mmu_hal.h similarity index 100% rename from components/hal/include/hal/mmu_hal.h rename to components/esp_hal_cache/include/hal/mmu_hal.h diff --git a/components/hal/include/hal/mmu_types.h b/components/esp_hal_cache/include/hal/mmu_types.h similarity index 100% rename from components/hal/include/hal/mmu_types.h rename to components/esp_hal_cache/include/hal/mmu_types.h diff --git a/components/hal/linker.lf b/components/esp_hal_cache/linker.lf similarity index 78% rename from components/hal/linker.lf rename to components/esp_hal_cache/linker.lf index 54719b3a53b..24e97c0fc8b 100644 --- a/components/hal/linker.lf +++ b/components/esp_hal_cache/linker.lf @@ -1,9 +1,9 @@ -[mapping:hal] -archive: libhal.a +[mapping:esp_hal_cache] +archive: libesp_hal_cache.a entries: if APP_BUILD_TYPE_PURE_RAM_APP = n: - mmu_hal (noflash) if IDF_TARGET_ESP32 = y: cache_hal_esp32 (noflash) else: cache_hal (noflash) + mmu_hal (noflash) diff --git a/components/hal/mmu_hal.c b/components/esp_hal_cache/mmu_hal.c similarity index 100% rename from components/hal/mmu_hal.c rename to components/esp_hal_cache/mmu_hal.c diff --git a/components/esp_hal_debug_assist/CMakeLists.txt b/components/esp_hal_debug_assist/CMakeLists.txt index 9680e80a4a7..67cb1c6edc4 100644 --- a/components/esp_hal_debug_assist/CMakeLists.txt +++ b/components/esp_hal_debug_assist/CMakeLists.txt @@ -6,6 +6,10 @@ endif() set(srcs) set(public_include "include" "${target}/include") +if(CONFIG_SOC_DEBUG_PROBE_SUPPORTED) + list(APPEND srcs "${target}/debug_probe_periph.c") +endif() + if(CONFIG_SOC_RISCV_TRACE_SUPPORTED) list(APPEND srcs "riscv_trace_hal.c") endif() diff --git a/components/soc/esp32p4/debug_probe_periph.c b/components/esp_hal_debug_assist/esp32p4/debug_probe_periph.c similarity index 95% rename from components/soc/esp32p4/debug_probe_periph.c rename to components/esp_hal_debug_assist/esp32p4/debug_probe_periph.c index bec4a2d1be9..a25f4268a1f 100644 --- a/components/soc/esp32p4/debug_probe_periph.c +++ b/components/esp_hal_debug_assist/esp32p4/debug_probe_periph.c @@ -1,12 +1,12 @@ /* * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/gpio_sig_map.h" #include "soc/lp_gpio_sig_map.h" -#include "soc/debug_probe_periph.h" +#include "hal/debug_probe_periph.h" const debug_probe_signal_conn_t debug_probe_periph_signals = { .units = { diff --git a/components/soc/esp32p4/include/soc/debug_probe_targets.h b/components/esp_hal_debug_assist/esp32p4/include/hal/debug_probe_targets.h similarity index 98% rename from components/soc/esp32p4/include/soc/debug_probe_targets.h rename to components/esp_hal_debug_assist/esp32p4/include/hal/debug_probe_targets.h index 349f47044e8..b13eec34c3c 100644 --- a/components/soc/esp32p4/include/soc/debug_probe_targets.h +++ b/components/esp_hal_debug_assist/esp32p4/include/hal/debug_probe_targets.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2023-2026 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/esp32s31/debug_probe_periph.c b/components/esp_hal_debug_assist/esp32s31/debug_probe_periph.c similarity index 95% rename from components/soc/esp32s31/debug_probe_periph.c rename to components/esp_hal_debug_assist/esp32s31/debug_probe_periph.c index bec4a2d1be9..a25f4268a1f 100644 --- a/components/soc/esp32s31/debug_probe_periph.c +++ b/components/esp_hal_debug_assist/esp32s31/debug_probe_periph.c @@ -1,12 +1,12 @@ /* * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/gpio_sig_map.h" #include "soc/lp_gpio_sig_map.h" -#include "soc/debug_probe_periph.h" +#include "hal/debug_probe_periph.h" const debug_probe_signal_conn_t debug_probe_periph_signals = { .units = { diff --git a/components/soc/esp32s31/include/soc/debug_probe_targets.h b/components/esp_hal_debug_assist/esp32s31/include/hal/debug_probe_targets.h similarity index 98% rename from components/soc/esp32s31/include/soc/debug_probe_targets.h rename to components/esp_hal_debug_assist/esp32s31/include/hal/debug_probe_targets.h index a7bfe756eb2..2ca3a2b2fe7 100644 --- a/components/soc/esp32s31/include/soc/debug_probe_targets.h +++ b/components/esp_hal_debug_assist/esp32s31/include/hal/debug_probe_targets.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2023-2026 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/include/soc/debug_probe_periph.h b/components/esp_hal_debug_assist/include/hal/debug_probe_periph.h similarity index 91% rename from components/soc/include/soc/debug_probe_periph.h rename to components/esp_hal_debug_assist/include/hal/debug_probe_periph.h index 8104eb4cd7d..8e3ad66c469 100644 --- a/components/soc/include/soc/debug_probe_periph.h +++ b/components/esp_hal_debug_assist/include/hal/debug_probe_periph.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2023-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/esp_hal_gpio/esp32h4/rtc_io_periph.c b/components/esp_hal_gpio/esp32h4/rtc_io_periph.c index ce0a5f6ebc0..fae0fbe03e3 100644 --- a/components/esp_hal_gpio/esp32h4/rtc_io_periph.c +++ b/components/esp_hal_gpio/esp32h4/rtc_io_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 "hal/rtc_io_periph.h" diff --git a/components/esp_hal_pmu/CMakeLists.txt b/components/esp_hal_pmu/CMakeLists.txt index 4c361cd479b..24e8a73bb89 100644 --- a/components/esp_hal_pmu/CMakeLists.txt +++ b/components/esp_hal_pmu/CMakeLists.txt @@ -36,6 +36,7 @@ endif() if(CONFIG_SOC_BOD_SUPPORTED) list(APPEND srcs "brownout_hal.c") + list(APPEND srcs "${target}/power_supply_periph.c") endif() if(CONFIG_SOC_VBAT_SUPPORTED) diff --git a/components/esp_hal_pmu/README.md b/components/esp_hal_pmu/README.md index b9912eda538..cae9850a422 100644 --- a/components/esp_hal_pmu/README.md +++ b/components/esp_hal_pmu/README.md @@ -39,6 +39,9 @@ The HAL architecture consists of two primary layers: - Control ready wait cycle configuration (isolate/reset) - Power mode transitions (active, sleep, modem) +### Brownout Detection +- Brownout detector control (enable/disable, thresholds, reset behavior) + ### Sleep and Wakeup - Sleep mode configuration - Wakeup source management diff --git a/components/soc/esp32s2/power_supply_periph.c b/components/esp_hal_pmu/esp32/power_supply_periph.c similarity index 68% rename from components/soc/esp32s2/power_supply_periph.c rename to components/esp_hal_pmu/esp32/power_supply_periph.c index 243757aac6e..e3139969514 100644 --- a/components/soc/esp32s2/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_RTC_CORE_INTR_SOURCE, diff --git a/components/soc/esp32/power_supply_periph.c b/components/esp_hal_pmu/esp32c2/power_supply_periph.c similarity index 68% rename from components/soc/esp32/power_supply_periph.c rename to components/esp_hal_pmu/esp32c2/power_supply_periph.c index 243757aac6e..e3139969514 100644 --- a/components/soc/esp32/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32c2/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_RTC_CORE_INTR_SOURCE, diff --git a/components/soc/esp32c2/power_supply_periph.c b/components/esp_hal_pmu/esp32c3/power_supply_periph.c similarity index 68% rename from components/soc/esp32c2/power_supply_periph.c rename to components/esp_hal_pmu/esp32c3/power_supply_periph.c index 243757aac6e..e3139969514 100644 --- a/components/soc/esp32c2/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32c3/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_RTC_CORE_INTR_SOURCE, diff --git a/components/soc/esp32c5/power_supply_periph.c b/components/esp_hal_pmu/esp32c5/power_supply_periph.c similarity index 69% rename from components/soc/esp32c5/power_supply_periph.c rename to components/esp_hal_pmu/esp32c5/power_supply_periph.c index 63617abdd71..356fddd8897 100644 --- a/components/soc/esp32c5/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32c5/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, diff --git a/components/soc/esp32c6/power_supply_periph.c b/components/esp_hal_pmu/esp32c6/power_supply_periph.c similarity index 69% rename from components/soc/esp32c6/power_supply_periph.c rename to components/esp_hal_pmu/esp32c6/power_supply_periph.c index 63617abdd71..356fddd8897 100644 --- a/components/soc/esp32c6/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32c6/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, diff --git a/components/soc/esp32c61/power_supply_periph.c b/components/esp_hal_pmu/esp32c61/power_supply_periph.c similarity index 69% rename from components/soc/esp32c61/power_supply_periph.c rename to components/esp_hal_pmu/esp32c61/power_supply_periph.c index 63617abdd71..356fddd8897 100644 --- a/components/soc/esp32c61/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32c61/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, diff --git a/components/soc/esp32h2/power_supply_periph.c b/components/esp_hal_pmu/esp32h2/power_supply_periph.c similarity index 69% rename from components/soc/esp32h2/power_supply_periph.c rename to components/esp_hal_pmu/esp32h2/power_supply_periph.c index 63617abdd71..356fddd8897 100644 --- a/components/soc/esp32h2/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32h2/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, diff --git a/components/esp_hal_pmu/esp32h21/power_supply_periph.c b/components/esp_hal_pmu/esp32h21/power_supply_periph.c new file mode 100644 index 00000000000..356fddd8897 --- /dev/null +++ b/components/esp_hal_pmu/esp32h21/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "hal/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, +}; diff --git a/components/soc/esp32h4/power_supply_periph.c b/components/esp_hal_pmu/esp32h4/power_supply_periph.c similarity index 69% rename from components/soc/esp32h4/power_supply_periph.c rename to components/esp_hal_pmu/esp32h4/power_supply_periph.c index fa571d89fe6..709c38de7bb 100644 --- a/components/soc/esp32h4/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32h4/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, diff --git a/components/soc/esp32p4/power_supply_periph.c b/components/esp_hal_pmu/esp32p4/power_supply_periph.c similarity index 69% rename from components/soc/esp32p4/power_supply_periph.c rename to components/esp_hal_pmu/esp32p4/power_supply_periph.c index 856b05e0d13..51882d03515 100644 --- a/components/soc/esp32p4/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32p4/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_ANAPERI_INTR_SOURCE, diff --git a/components/soc/esp32c3/power_supply_periph.c b/components/esp_hal_pmu/esp32s2/power_supply_periph.c similarity index 68% rename from components/soc/esp32c3/power_supply_periph.c rename to components/esp_hal_pmu/esp32s2/power_supply_periph.c index 243757aac6e..e3139969514 100644 --- a/components/soc/esp32c3/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32s2/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_RTC_CORE_INTR_SOURCE, diff --git a/components/esp_hal_pmu/esp32s3/power_supply_periph.c b/components/esp_hal_pmu/esp32s3/power_supply_periph.c new file mode 100644 index 00000000000..e3139969514 --- /dev/null +++ b/components/esp_hal_pmu/esp32s3/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "hal/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_RTC_CORE_INTR_SOURCE, +}; diff --git a/components/soc/esp32s31/power_supply_periph.c b/components/esp_hal_pmu/esp32s31/power_supply_periph.c similarity index 69% rename from components/soc/esp32s31/power_supply_periph.c rename to components/esp_hal_pmu/esp32s31/power_supply_periph.c index e45ea11026c..cc0bcd798a6 100644 --- a/components/soc/esp32s31/power_supply_periph.c +++ b/components/esp_hal_pmu/esp32s31/power_supply_periph.c @@ -1,10 +1,10 @@ /* * SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" const power_supply_signal_conn_t power_supply_periph_signal = { .irq = ETS_LP_ANAPERI_INTR_SOURCE, diff --git a/components/soc/include/soc/power_supply_periph.h b/components/esp_hal_pmu/include/hal/power_supply_periph.h similarity index 87% rename from components/soc/include/soc/power_supply_periph.h rename to components/esp_hal_pmu/include/hal/power_supply_periph.h index ee03e751e2c..d87985639f6 100644 --- a/components/soc/include/soc/power_supply_periph.h +++ b/components/esp_hal_pmu/include/hal/power_supply_periph.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/esp_hal_security/esp32s2/include/hal/sha_ll.h b/components/esp_hal_security/esp32s2/include/hal/sha_ll.h index 3bc6574b8f2..57b94f9d540 100644 --- a/components/esp_hal_security/esp32s2/include/hal/sha_ll.h +++ b/components/esp_hal_security/esp32s2/include/hal/sha_ll.h @@ -10,12 +10,25 @@ #include "soc/hwcrypto_reg.h" #include "hal/sha_types.h" #include "soc/dport_reg.h" -#include "hal/mmu_ll.h" +#include "soc/ext_mem_defs.h" #ifdef __cplusplus extern "C" { #endif +/** + * Check if the external memory vaddr belongs to the DPORT bus region + * + * @param vaddr start of the virtual address + * + * @return True for valid + */ +__attribute__((always_inline)) +static inline bool _vaddr_in_dport_bus_region(uint32_t vaddr) +{ + return (vaddr >= SOC_DPORT_CACHE_ADDRESS_LOW && vaddr < SOC_DPORT_CACHE_ADDRESS_HIGH); +} + /** * @brief Enable the bus clock for SHA peripheral module * @@ -158,7 +171,7 @@ static inline void sha_ll_fill_text_block(const void *input_text, size_t block_w * Thus, when accessing data from these addresses we need to ensure * the operations are word-aligned. */ - if (mmu_ll_vaddr_in_dport_bus_region((uint32_t)input_text)) { + if (_vaddr_in_dport_bus_region((uint32_t)input_text)) { force_word_aligned_access = true; } diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index c06029deca0..77e3fde7d0e 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -38,7 +38,7 @@ if(__ULP_BUILDV2) return() endif() -set(requires esp_hal_gpio esp_hal_usb esp_hal_pmu esp_hal_regi2c esp_hal_uart esp_hal_debug_assist) +set(requires esp_hal_gpio esp_hal_usb esp_hal_pmu esp_hal_regi2c esp_hal_uart esp_hal_debug_assist esp_hal_cache) set(priv_requires efuse # only esp_hw_support/adc_share_hw_ctrl.c requires efuse component esp_mspi bootloader_support diff --git a/components/esp_hw_support/debug_probe/debug_probe.c b/components/esp_hw_support/debug_probe/debug_probe.c index 6dd56b6061a..a99af04edcd 100644 --- a/components/esp_hw_support/debug_probe/debug_probe.c +++ b/components/esp_hw_support/debug_probe/debug_probe.c @@ -14,7 +14,7 @@ #include "esp_check.h" #include "esp_heap_caps.h" #include "soc/soc_caps.h" -#include "soc/debug_probe_periph.h" +#include "hal/debug_probe_periph.h" #include "soc/io_mux_reg.h" #include "driver/rtc_io.h" #include "driver/lp_io.h" diff --git a/components/esp_hw_support/debug_probe/include/esp_private/debug_probe_types.h b/components/esp_hw_support/debug_probe/include/esp_private/debug_probe_types.h index a12967bd32b..dc91eda9ee1 100644 --- a/components/esp_hw_support/debug_probe/include/esp_private/debug_probe_types.h +++ b/components/esp_hw_support/debug_probe/include/esp_private/debug_probe_types.h @@ -12,7 +12,7 @@ #include "soc/soc_caps.h" #include "hal/debug_probe_types.h" #if SOC_DEBUG_PROBE_SUPPORTED -#include "soc/debug_probe_targets.h" +#include "hal/debug_probe_targets.h" #endif #ifdef __cplusplus diff --git a/components/esp_hw_support/power_supply/brownout.c b/components/esp_hw_support/power_supply/brownout.c index 6dc655dfc78..01f71fc5bc7 100644 --- a/components/esp_hw_support/power_supply/brownout.c +++ b/components/esp_hw_support/power_supply/brownout.c @@ -25,7 +25,7 @@ #include "sdkconfig.h" #include "esp_rom_serial_output.h" #include "hal/uart_ll.h" -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" #include "esp_brownout.h" #include "esp_check.h" #include "esp_memory_utils.h" diff --git a/components/esp_hw_support/power_supply/vbat.c b/components/esp_hw_support/power_supply/vbat.c index 200857acdab..31389911613 100644 --- a/components/esp_hw_support/power_supply/vbat.c +++ b/components/esp_hw_support/power_supply/vbat.c @@ -24,7 +24,7 @@ #include "esp_check.h" #include "soc/rtc.h" #include "soc/clk_tree_defs.h" -#include "soc/power_supply_periph.h" +#include "hal/power_supply_periph.h" #if CONFIG_ESP_VBAT_INIT_AUTO #if CONFIG_ESP_VBAT_ISR_CACHE_SAFE diff --git a/components/esp_image_verify/CMakeLists.txt b/components/esp_image_verify/CMakeLists.txt index 9d3ddadb52a..96a740465da 100644 --- a/components/esp_image_verify/CMakeLists.txt +++ b/components/esp_image_verify/CMakeLists.txt @@ -54,7 +54,7 @@ endif() # from bootloader_support's public include path. set(requires bootloader_support esp_app_format esp_bootloader_format) -set(priv_requires spi_flash efuse esp_hal_security) +set(priv_requires spi_flash efuse esp_hal_security esp_hal_cache) if(BOOTLOADER_BUILD) list(APPEND priv_requires micro-ecc) diff --git a/components/esp_libc/test_apps/newlib/main/CMakeLists.txt b/components/esp_libc/test_apps/newlib/main/CMakeLists.txt index 410b85d6fee..24198d712cb 100644 --- a/components/esp_libc/test_apps/newlib/main/CMakeLists.txt +++ b/components/esp_libc/test_apps/newlib/main/CMakeLists.txt @@ -21,5 +21,5 @@ if(CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS) endif() idf_component_register(SRCS "${srcs}" - PRIV_REQUIRES unity vfs cmock esp_timer esp_mspi test_utils pthread esp_psram + PRIV_REQUIRES unity vfs cmock esp_timer esp_mspi esp_hal_cache test_utils pthread esp_psram WHOLE_ARCHIVE) diff --git a/components/esp_mm/CMakeLists.txt b/components/esp_mm/CMakeLists.txt index 6ad14a87ea3..2c29ac6206e 100644 --- a/components/esp_mm/CMakeLists.txt +++ b/components/esp_mm/CMakeLists.txt @@ -7,6 +7,8 @@ endif() set(includes "include") # Note: requires esp_mspi for cache_utils +# REQUIRES esp_hal_cache — esp_mmu_map.h (public header) includes hal/mmu_types.h +set(requires esp_hal_cache) set(priv_requires heap esp_hal_dma esp_mspi) set(srcs) @@ -28,5 +30,6 @@ endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${includes} + REQUIRES ${requires} PRIV_REQUIRES ${priv_requires} LDFRAGMENTS linker.lf) diff --git a/components/esp_mspi/CMakeLists.txt b/components/esp_mspi/CMakeLists.txt index 8b390a16379..fca43c2c65a 100644 --- a/components/esp_mspi/CMakeLists.txt +++ b/components/esp_mspi/CMakeLists.txt @@ -11,7 +11,7 @@ endif() if(non_os_build OR CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) # efuse is required by esp_mspi_align.c to query the flash encryption state set(priv_requires bootloader_support soc esp_hal_gpio efuse) - set(requires hal esp_hal_mspi) + set(requires esp_hal_mspi esp_hal_cache) set(srcs "spi_flash_wrap.c" "spi_flash_os_tee_stub.c") if(NOT BOOTLOADER_BUILD) list(APPEND srcs "esp_mspi_align/esp_mspi_align.c") diff --git a/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt b/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt index 4ac7300c83b..fc11b8819ef 100644 --- a/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt +++ b/components/esp_system/test_apps/esp_system_unity_tests/main/CMakeLists.txt @@ -5,7 +5,8 @@ set(requires "unity" "esp_hal_wdt" "esp_timer" "nvs_flash" - "esp_psram") + "esp_psram" + "esp_hal_cache") set(SRC "test_app_main.c" "test_backtrace.c" diff --git a/components/esp_tee/CMakeLists.txt b/components/esp_tee/CMakeLists.txt index dd7feffe202..5eef665eab9 100644 --- a/components/esp_tee/CMakeLists.txt +++ b/components/esp_tee/CMakeLists.txt @@ -82,7 +82,7 @@ else() idf_component_register(INCLUDE_DIRS include SRCS ${srcs} PRIV_REQUIRES efuse esp_hal_wdt esp_security esp_stdio - esp_system esptool_py mbedtls spi_flash esp_mspi) + esp_system esptool_py mbedtls spi_flash esp_mspi esp_hal_cache) if(CONFIG_SECURE_ENABLE_TEE) set(EXTRA_LINK_FLAGS) list(APPEND EXTRA_LINK_FLAGS "-u esp_tee_app_config") diff --git a/components/esp_tee/subproject/main/ld/esp32c5/esp_tee.ld.in b/components/esp_tee/subproject/main/ld/esp32c5/esp_tee.ld.in index 35d11cfcc6f..7d452038f71 100644 --- a/components/esp_tee/subproject/main/ld/esp32c5/esp_tee.ld.in +++ b/components/esp_tee/subproject/main/ld/esp32c5/esp_tee.ld.in @@ -101,8 +101,8 @@ SECTIONS *libmain.a:esp_tee_intr.c*(.literal .text .literal.* .text.*) *libmain.a:esp_tee_apm_intr.c*(.literal .text .literal.* .text.*) /* HAL */ - *libhal.a:mmu_hal.c*(.literal .text .literal.* .text.*) - *libhal.a:cache_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:mmu_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:cache_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_security.a:apm_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_mspi.a:*(.literal .text .literal.* .text.*) *libesp_hal_wdt.a:*(.literal .text .literal.* .text.*) @@ -175,8 +175,8 @@ SECTIONS *libmain.a:panic_helper_riscv.*(.rodata .srodata .rodata.* .srodata.*) *libmain.a:esp_tee_apm_intr.c.*(.rodata .srodata .rodata.* .srodata.*) /* HAL (noflash) */ - *libhal.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) - *libhal.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) *libesp_hal_mspi.a:*(.rodata .srodata .rodata.* .srodata.*) *libesp_mspi.a:*(.rodata .rodata.* .srodata .srodata.*) _tee_rodata_end = ABSOLUTE(.); diff --git a/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in b/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in index dbc3ad39c2f..abf4dbc046e 100644 --- a/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in +++ b/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in @@ -99,8 +99,8 @@ SECTIONS *libmain.a:esp_tee_intr.c*(.literal .text .literal.* .text.*) *libmain.a:esp_tee_apm_intr.c*(.literal .text .literal.* .text.*) /* HAL */ - *libhal.a:mmu_hal.c*(.literal .text .literal.* .text.*) - *libhal.a:cache_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:mmu_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:cache_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_security.a:apm_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_mspi.a:*(.literal .text .literal.* .text.*) *libesp_hal_wdt.a:*(.literal .text .literal.* .text.*) @@ -173,8 +173,8 @@ SECTIONS *libmain.a:panic_helper_riscv.*(.rodata .srodata .rodata.* .srodata.*) *libmain.a:esp_tee_apm_intr.c.*(.rodata .srodata .rodata.* .srodata.*) /* HAL (noflash) */ - *libhal.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) - *libhal.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) *libesp_hal_mspi.a:*(.rodata .srodata .rodata.* .srodata.*) *libesp_mspi.a:*(.rodata .rodata.* .srodata .srodata.*) _tee_rodata_end = ABSOLUTE(.); diff --git a/components/esp_tee/subproject/main/ld/esp32c61/esp_tee.ld.in b/components/esp_tee/subproject/main/ld/esp32c61/esp_tee.ld.in index 884fbf4c0f5..6045753b004 100644 --- a/components/esp_tee/subproject/main/ld/esp32c61/esp_tee.ld.in +++ b/components/esp_tee/subproject/main/ld/esp32c61/esp_tee.ld.in @@ -99,8 +99,8 @@ SECTIONS *libmain.a:esp_tee_intr.c*(.literal .text .literal.* .text.*) *libmain.a:esp_tee_apm_intr.c*(.literal .text .literal.* .text.*) /* HAL */ - *libhal.a:mmu_hal.c*(.literal .text .literal.* .text.*) - *libhal.a:cache_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:mmu_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:cache_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_security.a:apm_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_mspi.a:*(.literal .text .literal.* .text.*) *libesp_hal_wdt.a:*(.literal .text .literal.* .text.*) @@ -173,8 +173,8 @@ SECTIONS *libmain.a:panic_helper_riscv.*(.rodata .srodata .rodata.* .srodata.*) *libmain.a:esp_tee_apm_intr.c.*(.rodata .srodata .rodata.* .srodata.*) /* HAL (noflash) */ - *libhal.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) - *libhal.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) *libesp_hal_mspi.a:*(.rodata .srodata .rodata.* .srodata.*) *libesp_mspi.a:*(.rodata .rodata.* .srodata .srodata.*) _tee_rodata_end = ABSOLUTE(.); diff --git a/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in b/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in index 5800c53c04d..fe27d130693 100644 --- a/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in +++ b/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in @@ -99,8 +99,8 @@ SECTIONS *libmain.a:esp_tee_intr.c*(.literal .text .literal.* .text.*) *libmain.a:esp_tee_apm_intr.c*(.literal .text .literal.* .text.*) /* HAL */ - *libhal.a:mmu_hal.c*(.literal .text .literal.* .text.*) - *libhal.a:cache_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:mmu_hal.c*(.literal .text .literal.* .text.*) + *libesp_hal_cache.a:cache_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_security.a:apm_hal.c*(.literal .text .literal.* .text.*) *libesp_hal_mspi.a:*(.literal .text .literal.* .text.*) *libesp_hal_wdt.a:*(.literal .text .literal.* .text.*) @@ -173,8 +173,8 @@ SECTIONS *libmain.a:panic_helper_riscv.*(.rodata .srodata .rodata.* .srodata.*) *libmain.a:esp_tee_apm_intr.c.*(.rodata .srodata .rodata.* .srodata.*) /* HAL (noflash) */ - *libhal.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) - *libhal.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:mmu_hal.c*(.rodata .srodata .rodata.* .srodata.*) + *libesp_hal_cache.a:cache_hal.c*(.rodata .srodata .rodata.* .srodata.*) *libesp_hal_mspi.a:*(.rodata .srodata .rodata.* .srodata.*) *libesp_mspi.a:*(.rodata .rodata.* .srodata .srodata.*) _tee_rodata_end = ABSOLUTE(.); diff --git a/components/freertos/test_apps/freertos/kernel/CMakeLists.txt b/components/freertos/test_apps/freertos/kernel/CMakeLists.txt index ac17ddcf9e4..f402022b40c 100644 --- a/components/freertos/test_apps/freertos/kernel/CMakeLists.txt +++ b/components/freertos/test_apps/freertos/kernel/CMakeLists.txt @@ -19,5 +19,5 @@ set(priv_include_dirs # the final elf, the component can be registered as WHOLE_ARCHIVE idf_component_register(SRC_DIRS ${src_dirs} PRIV_INCLUDE_DIRS ${priv_include_dirs} - PRIV_REQUIRES test_utils esp_driver_gptimer + PRIV_REQUIRES test_utils esp_driver_gptimer esp_hal_cache WHOLE_ARCHIVE) diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index dbb3cbbbf52..6e3a2849d80 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -28,28 +28,6 @@ if(CONFIG_SOC_EFUSE_SUPPORTED) list(APPEND srcs "efuse_hal.c" "${target}/efuse_hal.c") endif() -if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) - if(CONFIG_SOC_MMU_PERIPH_NUM) - list(APPEND srcs "mmu_hal.c") - endif() - - # We wrap Cache ROM APIs as Cache HAL APIs for: 1. internal ram ; 2. unified APIs - # ESP32 cache structure / ROM APIs are different and we have a patch `cache_hal_esp32.c` for it. - if(${target} STREQUAL "esp32") - list(APPEND srcs "esp32/cache_hal_esp32.c") - elseif(NOT ${target} STREQUAL "linux") - list(APPEND srcs "cache_hal.c") - endif() -else() - if(CONFIG_SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE) - list(APPEND srcs "cache_hal.c") - endif() -endif() - -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/cache_periph.c") - list(APPEND srcs "${target}/cache_periph.c") -endif() - if(NOT esp_tee_build AND NOT BOOTLOADER_BUILD) list(APPEND srcs "color_hal.c") @@ -62,13 +40,10 @@ if(NOT esp_tee_build AND NOT BOOTLOADER_BUILD) endif() endif() -set(ldfragments linker.lf) - idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${includes} PRIV_INCLUDE_DIRS ${priv_include} - REQUIRES ${requires} - LDFRAGMENTS ${ldfragments}) + REQUIRES ${requires}) if(CONFIG_HAL_DEFAULT_ASSERTION_LEVEL EQUAL 1) target_link_libraries(${COMPONENT_LIB} INTERFACE "-u abort") diff --git a/components/heap/test_apps/heap_tests/main/CMakeLists.txt b/components/heap/test_apps/heap_tests/main/CMakeLists.txt index f054f818ff0..1cf9235f2a9 100644 --- a/components/heap/test_apps/heap_tests/main/CMakeLists.txt +++ b/components/heap/test_apps/heap_tests/main/CMakeLists.txt @@ -14,5 +14,5 @@ set(src_test "test_heap_main.c" idf_component_register(SRCS ${src_test} INCLUDE_DIRS "." - REQUIRES unity esp_psram esp_mm esp_mspi esp_timer + REQUIRES unity esp_psram esp_mm esp_mspi esp_hal_cache esp_timer WHOLE_ARCHIVE) diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index 491dd0baf42..f7168a4e8da 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -24,7 +24,7 @@ elseif(BOOTLOADER_BUILD) # TODO: IDF-11673 idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "${include_dirs}" - PRIV_REQUIRES esp_hal_dma) + PRIV_REQUIRES esp_hal_dma esp_hal_cache) if(public_compile_definitions) target_compile_definitions(${COMPONENT_LIB} PUBLIC ${public_compile_definitions}) endif() diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index d3bc737c720..c239234d06e 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -62,18 +62,10 @@ if(target STREQUAL "esp32") list(APPEND srcs "${target_folder}/dport_access.c") endif() -if(CONFIG_SOC_DEBUG_PROBE_SUPPORTED) - list(APPEND srcs "${target_folder}/debug_probe_periph.c") -endif() - if(CONFIG_SOC_MPI_SUPPORTED) list(APPEND srcs "${target_folder}/mpi_periph.c") endif() -if(CONFIG_SOC_BOD_SUPPORTED) - list(APPEND srcs "${target_folder}/power_supply_periph.c") -endif() - set(ldfragments "linker.lf") idf_component_register(SRCS ${srcs} diff --git a/components/soc/esp32/pcnt_periph.c b/components/soc/esp32/pcnt_periph.c deleted file mode 100644 index fb1b1d7630b..00000000000 --- a/components/soc/esp32/pcnt_periph.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#include "hal/pcnt_periph.h" -#include "soc/gpio_sig_map.h" -#include "soc/soc.h" - -const soc_pcnt_signal_desc_t soc_pcnt_signals[1] = { - [0] = { - .irq_id = ETS_PCNT_INTR_SOURCE, - .module_name = "pcnt0", - .units = { - [0] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN0_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN0_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN0_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN0_IDX - } - } - }, - [1] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN1_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN1_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN1_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN1_IDX - } - } - }, - [2] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN2_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN2_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN2_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN2_IDX - } - } - }, - [3] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN3_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN3_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN3_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN3_IDX - } - } - }, - [4] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN4_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN4_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN4_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN4_IDX - } - } - }, - [5] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN5_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN5_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN5_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN5_IDX - } - } - }, - [6] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN6_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN6_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN6_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN6_IDX - } - } - }, - [7] = { - .channels = { - [0] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH0_IN7_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH0_IN7_IDX - }, - [1] = { - .ctl_sig_id_matrix = PCNT_CTRL_CH1_IN7_IDX, - .pulse_sig_id_matrix = PCNT_SIG_CH1_IN7_IDX - } - } - } - } - } -}; diff --git a/components/soc/esp32h21/power_supply_periph.c b/components/soc/esp32h21/power_supply_periph.c deleted file mode 100644 index 63617abdd71..00000000000 --- a/components/soc/esp32h21/power_supply_periph.c +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#include "soc/power_supply_periph.h" - -const power_supply_signal_conn_t power_supply_periph_signal = { - .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, -}; diff --git a/components/soc/esp32s3/power_supply_periph.c b/components/soc/esp32s3/power_supply_periph.c deleted file mode 100644 index 243757aac6e..00000000000 --- a/components/soc/esp32s3/power_supply_periph.c +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#include "soc/power_supply_periph.h" - -const power_supply_signal_conn_t power_supply_periph_signal = { - .irq = ETS_RTC_CORE_INTR_SOURCE, -}; diff --git a/components/spi_flash/CMakeLists.txt b/components/spi_flash/CMakeLists.txt index 813ec029f3b..e91028496b2 100644 --- a/components/spi_flash/CMakeLists.txt +++ b/components/spi_flash/CMakeLists.txt @@ -12,7 +12,7 @@ endif() if(non_os_build OR CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) set(srcs "") - set(priv_requires bootloader_support soc esp_hal_gpio) + set(priv_requires bootloader_support soc esp_hal_gpio esp_hal_cache) else() set(srcs "") diff --git a/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt b/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt index 797abc6094f..516d6a551cb 100644 --- a/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt +++ b/components/spi_flash/test_apps/flash_suspend/main/CMakeLists.txt @@ -4,5 +4,6 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity test_utils spi_flash esp_partition esp_driver_i2c esp_driver_gptimer + PRIV_REQUIRES unity test_utils spi_flash esp_partition + esp_driver_i2c esp_driver_gptimer esp_hal_cache WHOLE_ARCHIVE)