From f2d3448fa20d9fbfb51052a801713abb3b98a9b8 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Mon, 15 Jun 2026 17:09:58 +0800 Subject: [PATCH] refactor(esp_hw_support): move system_periph_retention from soc to esp_hw_support --- components/esp_hw_support/CMakeLists.txt | 3 ++- .../port}/esp32c5/include/soc/system_periph_retention.h | 2 +- .../port/esp32c5/system_periph_retention.c} | 2 +- .../port}/esp32c6/include/soc/system_periph_retention.h | 2 +- .../port/esp32c6/system_periph_retention.c} | 2 +- .../port}/esp32c61/include/soc/system_periph_retention.h | 2 +- .../port/esp32c61/system_periph_retention.c} | 2 +- .../port}/esp32h2/include/soc/system_periph_retention.h | 2 +- .../port/esp32h2/system_periph_retention.c} | 2 +- .../port}/esp32h21/include/soc/system_periph_retention.h | 2 +- .../port/esp32h21/system_periph_retention.c} | 2 +- .../port}/esp32h4/include/soc/system_periph_retention.h | 2 +- .../port/esp32h4/system_periph_retention.c} | 2 +- .../port}/esp32p4/include/soc/system_periph_retention.h | 2 +- .../port/esp32p4/system_periph_retention.c} | 3 ++- .../port}/esp32s31/include/soc/system_periph_retention.h | 2 +- .../port/esp32s31/system_periph_retention.c} | 3 ++- components/soc/CMakeLists.txt | 4 ---- 18 files changed, 20 insertions(+), 21 deletions(-) rename components/{soc => esp_hw_support/port}/esp32c5/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32c5/system_retention_periph.c => esp_hw_support/port/esp32c5/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32c6/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32c6/system_retention_periph.c => esp_hw_support/port/esp32c6/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32c61/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32c61/system_retention_periph.c => esp_hw_support/port/esp32c61/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32h2/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32h2/system_retention_periph.c => esp_hw_support/port/esp32h2/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32h21/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32h21/system_retention_periph.c => esp_hw_support/port/esp32h21/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32h4/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32h4/system_retention_periph.c => esp_hw_support/port/esp32h4/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32p4/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32p4/system_retention_periph.c => esp_hw_support/port/esp32p4/system_periph_retention.c} (99%) rename components/{soc => esp_hw_support/port}/esp32s31/include/soc/system_periph_retention.h (98%) rename components/{soc/esp32s31/system_retention_periph.c => esp_hw_support/port/esp32s31/system_periph_retention.c} (99%) diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index 728b91040d0..b8fcd6c4e89 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -78,7 +78,8 @@ if(NOT non_os_build) ) if(CONFIG_SOC_PAU_SUPPORTED AND CONFIG_SOC_PM_SUPPORT_TOP_PD) list(APPEND srcs "sleep_system_peripheral.c") - list(APPEND srcs "port/${target}/peripheral_domain_pd.c") + list(APPEND srcs "port/${target}/peripheral_domain_pd.c" + "port/${target}/system_periph_retention.c") endif() endif() diff --git a/components/soc/esp32c5/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32c5/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32c5/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32c5/include/soc/system_periph_retention.h index b310fb6858e..9756b051908 100644 --- a/components/soc/esp32c5/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32c5/include/soc/system_periph_retention.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/esp32c5/system_retention_periph.c b/components/esp_hw_support/port/esp32c5/system_periph_retention.c similarity index 99% rename from components/soc/esp32c5/system_retention_periph.c rename to components/esp_hw_support/port/esp32c5/system_periph_retention.c index b040a755b63..341ef7fe286 100644 --- a/components/soc/esp32c5/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32c5/system_periph_retention.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/regdma.h" diff --git a/components/soc/esp32c6/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32c6/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32c6/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32c6/include/soc/system_periph_retention.h index eb59862c9b2..50abcd23e47 100644 --- a/components/soc/esp32c6/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32c6/include/soc/system_periph_retention.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/soc/esp32c6/system_retention_periph.c b/components/esp_hw_support/port/esp32c6/system_periph_retention.c similarity index 99% rename from components/soc/esp32c6/system_retention_periph.c rename to components/esp_hw_support/port/esp32c6/system_periph_retention.c index 2ed5ed13425..303d78702cd 100644 --- a/components/soc/esp32c6/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32c6/system_periph_retention.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 "soc/regdma.h" diff --git a/components/soc/esp32c61/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32c61/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32c61/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32c61/include/soc/system_periph_retention.h index bd57e42bd52..8b64685f8fb 100644 --- a/components/soc/esp32c61/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32c61/include/soc/system_periph_retention.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/esp32c61/system_retention_periph.c b/components/esp_hw_support/port/esp32c61/system_periph_retention.c similarity index 99% rename from components/soc/esp32c61/system_retention_periph.c rename to components/esp_hw_support/port/esp32c61/system_periph_retention.c index 7a392804cd9..645bbf268de 100644 --- a/components/soc/esp32c61/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32c61/system_periph_retention.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/regdma.h" diff --git a/components/soc/esp32h2/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32h2/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32h2/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32h2/include/soc/system_periph_retention.h index b37b239bc57..d8124e923e1 100644 --- a/components/soc/esp32h2/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32h2/include/soc/system_periph_retention.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/soc/esp32h2/system_retention_periph.c b/components/esp_hw_support/port/esp32h2/system_periph_retention.c similarity index 99% rename from components/soc/esp32h2/system_retention_periph.c rename to components/esp_hw_support/port/esp32h2/system_periph_retention.c index 908c16e7fe4..1f9e790b5f0 100644 --- a/components/soc/esp32h2/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32h2/system_periph_retention.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 "soc/regdma.h" diff --git a/components/soc/esp32h21/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32h21/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32h21/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32h21/include/soc/system_periph_retention.h index ca56d58da3c..5f629161b72 100644 --- a/components/soc/esp32h21/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32h21/include/soc/system_periph_retention.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/esp32h21/system_retention_periph.c b/components/esp_hw_support/port/esp32h21/system_periph_retention.c similarity index 99% rename from components/soc/esp32h21/system_retention_periph.c rename to components/esp_hw_support/port/esp32h21/system_periph_retention.c index db9a80de2d8..7b5f20963c8 100644 --- a/components/soc/esp32h21/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32h21/system_periph_retention.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/regdma.h" diff --git a/components/soc/esp32h4/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32h4/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32h4/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32h4/include/soc/system_periph_retention.h index 3b3a42c6759..3f76ea47b42 100644 --- a/components/soc/esp32h4/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32h4/include/soc/system_periph_retention.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/system_retention_periph.c b/components/esp_hw_support/port/esp32h4/system_periph_retention.c similarity index 99% rename from components/soc/esp32h4/system_retention_periph.c rename to components/esp_hw_support/port/esp32h4/system_periph_retention.c index 729477fd8ec..26c2f5ea53d 100644 --- a/components/soc/esp32h4/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32h4/system_periph_retention.c @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ #include "soc/regdma.h" diff --git a/components/soc/esp32p4/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32p4/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32p4/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32p4/include/soc/system_periph_retention.h index 3e95cb002fd..b2c221e08a1 100644 --- a/components/soc/esp32p4/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32p4/include/soc/system_periph_retention.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/soc/esp32p4/system_retention_periph.c b/components/esp_hw_support/port/esp32p4/system_periph_retention.c similarity index 99% rename from components/soc/esp32p4/system_retention_periph.c rename to components/esp_hw_support/port/esp32p4/system_periph_retention.c index cfca9276f6f..8638c8b1c91 100644 --- a/components/soc/esp32p4/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32p4/system_periph_retention.c @@ -1,9 +1,10 @@ /* * SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" #include "soc/cache_reg.h" #include "soc/gpio_reg.h" #include "soc/hp_system_reg.h" diff --git a/components/soc/esp32s31/include/soc/system_periph_retention.h b/components/esp_hw_support/port/esp32s31/include/soc/system_periph_retention.h similarity index 98% rename from components/soc/esp32s31/include/soc/system_periph_retention.h rename to components/esp_hw_support/port/esp32s31/include/soc/system_periph_retention.h index aab9a5ae082..07e81110678 100644 --- a/components/soc/esp32s31/include/soc/system_periph_retention.h +++ b/components/esp_hw_support/port/esp32s31/include/soc/system_periph_retention.h @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2025-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/system_retention_periph.c b/components/esp_hw_support/port/esp32s31/system_periph_retention.c similarity index 99% rename from components/soc/esp32s31/system_retention_periph.c rename to components/esp_hw_support/port/esp32s31/system_periph_retention.c index a518b940d26..f8288d7a80a 100644 --- a/components/soc/esp32s31/system_retention_periph.c +++ b/components/esp_hw_support/port/esp32s31/system_periph_retention.c @@ -1,8 +1,9 @@ /* * SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 OR MIT + * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" #include "soc/cache_reg.h" #include "soc/gpio_reg.h" #include "soc/hp_system_reg.h" diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index 483fcc96830..9ba726fe800 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -51,10 +51,6 @@ if(CONFIG_SOC_MPI_SUPPORTED) list(APPEND srcs "${target_folder}/mpi_periph.c") endif() -if(CONFIG_SOC_PAU_SUPPORTED AND CONFIG_SOC_LIGHT_SLEEP_SUPPORTED AND CONFIG_SOC_PM_SUPPORT_TOP_PD) - list(APPEND srcs "${target_folder}/system_retention_periph.c") -endif() - if(CONFIG_SOC_BOD_SUPPORTED) list(APPEND srcs "${target_folder}/power_supply_periph.c") endif()