From 410fb091d96a9ea0f11d5863676def3405824d66 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Mon, 10 Mar 2025 11:49:25 +0800 Subject: [PATCH] change(esp_hw_support): change for pmu build pass --- components/esp_hw_support/CMakeLists.txt | 6 ++++-- components/esp_hw_support/sleep_modes.c | 3 ++- .../hal/esp32h21/include/hal/lp_aon_hal.h | 19 +++++++++++++++++++ components/soc/CMakeLists.txt | 2 +- .../esp32h21/include/soc/Kconfig.soc_caps.in | 4 ---- .../soc/esp32h21/include/soc/soc_caps.h | 2 +- 6 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 components/hal/esp32h21/include/hal/lp_aon_hal.h diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index 267adb7ef1..0e8ea4bc83 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -33,11 +33,13 @@ if(NOT non_os_build) "sar_periph_ctrl_common.c" "port/${target}/io_mux.c" "port/${target}/esp_clk_tree.c" - "port/esp_clk_tree_common.c" "dma/esp_dma_utils.c" "dma/gdma_link.c" "spi_bus_lock.c" "clk_utils.c") + if(CONFIG_SOC_CLK_TREE_SUPPORTED) + list(APPEND srcs "port/esp_clk_tree_common.c") + endif() if(CONFIG_SOC_GPSPI_SUPPORTED) list(APPEND srcs "spi_share_hw_ctrl.c") endif() @@ -58,7 +60,7 @@ if(NOT non_os_build) "sleep_gpio.c" "sleep_event.c" ) - if(CONFIG_SOC_PAU_SUPPORTED) + if(CONFIG_SOC_PAU_SUPPORTED AND CONFIG_SOC_PM_SUPPORT_TOP_PD) list(APPEND srcs "sleep_system_peripheral.c") endif() endif() diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index db2629e21e..54452ccab6 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -1642,10 +1642,11 @@ esp_err_t esp_sleep_enable_ulp_wakeup(void) esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us) { +#if CONFIG_SOC_CLK_TREE_SUPPORTED if (time_in_us > ((BIT64(SOC_LP_TIMER_BIT_WIDTH_LO + SOC_LP_TIMER_BIT_WIDTH_HI) - 1) / esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_APPROX)) * MHZ ) { return ESP_ERR_INVALID_ARG; } - +#endif s_config.wakeup_triggers |= RTC_TIMER_TRIG_EN; s_config.sleep_duration = time_in_us; return ESP_OK; diff --git a/components/hal/esp32h21/include/hal/lp_aon_hal.h b/components/hal/esp32h21/include/hal/lp_aon_hal.h new file mode 100644 index 0000000000..dab6415e9a --- /dev/null +++ b/components/hal/esp32h21/include/hal/lp_aon_hal.h @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "hal/lp_aon_ll.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define lp_aon_hal_inform_wakeup_type(dslp) lp_aon_ll_inform_wakeup_type(dslp) + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index e446e96994..5c95fddb84 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -165,7 +165,7 @@ if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED) list(APPEND srcs "${target_folder}/sdio_slave_periph.c") endif() -if(CONFIG_SOC_PAU_SUPPORTED AND CONFIG_SOC_LIGHT_SLEEP_SUPPORTED) +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() diff --git a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in index ac5914ed1e..a37d41c1d9 100644 --- a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in @@ -779,10 +779,6 @@ config SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY bool default y -config SOC_CLK_RC_FAST_SUPPORT_CALIBRATION - bool - default y - config SOC_CLK_XTAL32K_SUPPORTED bool default y diff --git a/components/soc/esp32h21/include/soc/soc_caps.h b/components/soc/esp32h21/include/soc/soc_caps.h index f95220466a..13c7a1c1a0 100644 --- a/components/soc/esp32h21/include/soc/soc_caps.h +++ b/components/soc/esp32h21/include/soc/soc_caps.h @@ -538,7 +538,7 @@ #define SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY (1) /*!