From aa208256597199799b78bb516104ffc8783369f1 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Mon, 26 Dec 2022 21:57:52 +0800 Subject: [PATCH] soc_caps: rename ESP_PD_DOMAIN_RTC8M to ESP_PD_DOMAIN_FOSC --- components/driver/ledc.c | 2 +- components/esp_hw_support/include/esp_sleep.h | 7 ++++--- components/esp_hw_support/sleep_modes.c | 2 +- .../soc/esp32/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32/include/soc/soc_caps.h | 1 + .../soc/esp32c2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32c2/include/soc/soc_caps.h | 1 + .../soc/esp32c3/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32c3/include/soc/soc_caps.h | 5 +---- .../soc/esp32c6/include/soc/Kconfig.soc_caps.in | 2 +- components/soc/esp32c6/include/soc/soc_caps.h | 9 +-------- .../soc/esp32h2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h2/include/soc/soc_caps.h | 5 +---- .../soc/esp32h4/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h4/include/soc/soc_caps.h | 4 +--- .../soc/esp32s2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32s2/include/soc/soc_caps.h | 1 + .../soc/esp32s3/include/soc/Kconfig.soc_caps.in | 14 +++++++++----- components/soc/esp32s3/include/soc/soc_caps.h | 12 ++++-------- 19 files changed, 51 insertions(+), 38 deletions(-) diff --git a/components/driver/ledc.c b/components/driver/ledc.c index 621abdb831..1db5044220 100644 --- a/components/driver/ledc.c +++ b/components/driver/ledc.c @@ -573,7 +573,7 @@ static esp_err_t ledc_set_timer_div(ledc_mode_t speed_mode, ledc_timer_t timer_n #endif ESP_LOGD(LEDC_TAG, "In slow speed mode, global clk set: %d", glb_clk); - /* keep ESP_PD_DOMAIN_RTC8M on during light sleep */ + /* keep ESP_PD_DOMAIN_RC_FAST on during light sleep */ esp_sleep_periph_use_8m(glb_clk == LEDC_SLOW_CLK_RTC8M); portENTER_CRITICAL(&ledc_spinlock); diff --git a/components/esp_hw_support/include/esp_sleep.h b/components/esp_hw_support/include/esp_sleep.h index 7909cf443d..17550d8aab 100644 --- a/components/esp_hw_support/include/esp_sleep.h +++ b/components/esp_hw_support/include/esp_sleep.h @@ -53,17 +53,18 @@ typedef enum { #if SOC_PM_SUPPORT_RC32K_PD ESP_PD_DOMAIN_RC32K, #endif -#if SOC_PM_SUPPORT_FOSC_PD - ESP_PD_DOMAIN_FOSC, +#if SOC_PM_SUPPORT_RC_FAST_PD + ESP_PD_DOMAIN_RC_FAST, //!< Internal Fast oscillator #endif #if SOC_PM_SUPPORT_CPU_PD ESP_PD_DOMAIN_CPU, //!< CPU core #endif - ESP_PD_DOMAIN_RTC8M, //!< Internal 8M oscillator ESP_PD_DOMAIN_VDDSDIO, //!< VDD_SDIO ESP_PD_DOMAIN_MAX //!< Number of domains } esp_sleep_pd_domain_t; +#define ESP_PD_DOMAIN_RTC8M _Pragma("GCC warning \"'ESP_PD_DOMAIN_RTC8M' enum is deprecated\"") ESP_PD_DOMAIN_RC_FAST + /** * @brief Power down options */ diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 844d446698..067ef09a91 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -1399,7 +1399,7 @@ static uint32_t get_power_down_flags(void) pd_flags |= RTC_SLEEP_PD_CPU; } #endif - if (s_config.pd_options[ESP_PD_DOMAIN_RTC8M] != ESP_PD_OPTION_ON) { + if (s_config.pd_options[ESP_PD_DOMAIN_RC_FAST] != ESP_PD_OPTION_ON) { pd_flags |= RTC_SLEEP_PD_INT_8M; } if (s_config.pd_options[ESP_PD_DOMAIN_XTAL] != ESP_PD_OPTION_ON) { diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index 30e5a3df62..3c1e3ebb8b 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -719,6 +719,10 @@ config SOC_PM_SUPPORT_RTC_SLOW_MEM_PD bool default y +config SOC_PM_SUPPORT_RC_FAST_PD + bool + default y + config SOC_CLK_APLL_SUPPORTED bool default y diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 84234e014e..c99948a251 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -366,6 +366,7 @@ #define SOC_PM_SUPPORT_RTC_PERIPH_PD (1) #define SOC_PM_SUPPORT_RTC_FAST_MEM_PD (1) #define SOC_PM_SUPPORT_RTC_SLOW_MEM_PD (1) +#define SOC_PM_SUPPORT_RC_FAST_PD (1) /*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/ #define SOC_CLK_APLL_SUPPORTED (1) diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index adcf5f6602..1b0a5008c9 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -575,6 +575,10 @@ config SOC_PM_SUPPORT_BT_PD bool default n +config SOC_PM_SUPPORT_RC_FAST_PD + bool + default y + config SOC_CLK_RC_FAST_D256_SUPPORTED bool default y diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index c3e2f5ef20..edad367a10 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -279,6 +279,7 @@ #define SOC_PM_SUPPORT_CPU_PD (0) #define SOC_PM_SUPPORT_WIFI_PD (0) #define SOC_PM_SUPPORT_BT_PD (0) +#define SOC_PM_SUPPORT_RC_FAST_PD (1) /*--------------------------- CLOCK SUBSYSTEM CAPS -------------------------- */ #define SOC_CLK_RC_FAST_D256_SUPPORTED (1) diff --git a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in index cfb7b79d42..871bb7d359 100644 --- a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in @@ -819,6 +819,10 @@ config SOC_PM_SUPPORT_BT_PD bool default y +config SOC_PM_SUPPORT_RC_FAST_PD + bool + default y + config SOC_CLK_RC_FAST_D256_SUPPORTED bool default y diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index dca91106e9..e8b25f27ca 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -366,14 +366,11 @@ /*-------------------------- Power Management CAPS ----------------------------*/ #define SOC_PM_SUPPORT_WIFI_WAKEUP (1) - #define SOC_PM_SUPPORT_BT_WAKEUP (1) - #define SOC_PM_SUPPORT_CPU_PD (1) - #define SOC_PM_SUPPORT_WIFI_PD (1) - #define SOC_PM_SUPPORT_BT_PD (1) +#define SOC_PM_SUPPORT_RC_FAST_PD (1) /*--------------------------- CLOCK SUBSYSTEM CAPS -------------------------- */ #define SOC_CLK_RC_FAST_D256_SUPPORTED (1) diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index b72fbf6aa7..085a860374 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -923,7 +923,7 @@ config SOC_PM_SUPPORT_RC32K_PD bool default y -config SOC_PM_SUPPORT_FOSC_PD +config SOC_PM_SUPPORT_RC_FAST_PD bool default y diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index b30dd8dfdb..4b78381fb4 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -419,20 +419,13 @@ // TODO: IDF-5351 (Copy from esp32c3, need check) /*-------------------------- Power Management CAPS ----------------------------*/ #define SOC_PM_SUPPORT_WIFI_WAKEUP (1) - #define SOC_PM_SUPPORT_BT_WAKEUP (1) - #define SOC_PM_SUPPORT_CPU_PD (1) - #define SOC_PM_SUPPORT_WIFI_PD (1) - #define SOC_PM_SUPPORT_BT_PD (1) - #define SOC_PM_SUPPORT_XTAL32K_PD (1) - #define SOC_PM_SUPPORT_RC32K_PD (1) - -#define SOC_PM_SUPPORT_FOSC_PD (1) +#define SOC_PM_SUPPORT_RC_FAST_PD (1) /*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/ #define SOC_CLK_RC_FAST_SUPPORT_CALIBRATION (1) diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index 361403d3d4..e4df424186 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -751,6 +751,10 @@ config SOC_PM_SUPPORT_BT_PD bool default y +config SOC_PM_SUPPORT_RC_FAST_PD + bool + default y + config SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC bool default y diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index 2cc4114bfb..40c064e800 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -403,14 +403,11 @@ // TODO: IDF-6270 (Copy from esp32c6, need check) /*-------------------------- Power Management CAPS ----------------------------*/ #define SOC_PM_SUPPORT_WIFI_WAKEUP (1) - #define SOC_PM_SUPPORT_BT_WAKEUP (1) - #define SOC_PM_SUPPORT_CPU_PD (1) - #define SOC_PM_SUPPORT_WIFI_PD (1) - #define SOC_PM_SUPPORT_BT_PD (1) +#define SOC_PM_SUPPORT_RC_FAST_PD (1) // TODO: IDF-6229 (Copy from esp32c6, need check) /*-------------------------- Temperature Sensor CAPS -------------------------------------*/ diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index ad28130f48..efec18599b 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -767,6 +767,10 @@ config SOC_PM_SUPPORT_BT_PD bool default y +config SOC_PM_SUPPORT_RC_FAST_PD + bool + default y + config SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC bool default y diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index 9c945a4e4a..1a745d54b0 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -362,12 +362,10 @@ #define SOC_PHY_DIG_REGS_MEM_SIZE (21*4) /*-------------------------- Power Management CAPS ----------------------------*/ - #define SOC_PM_SUPPORT_BT_WAKEUP (1) - #define SOC_PM_SUPPORT_CPU_PD (1) - #define SOC_PM_SUPPORT_BT_PD (1) +#define SOC_PM_SUPPORT_RC_FAST_PD (1) /*-------------------------- Temperature Sensor CAPS -------------------------------------*/ #define SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC (1) diff --git a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in index 469453abce..352f0622dd 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -907,6 +907,10 @@ config SOC_PM_SUPPORT_RTC_SLOW_MEM_PD bool default y +config SOC_PM_SUPPORT_RC_FAST_PD + bool + default y + config SOC_CLK_APLL_SUPPORTED bool default y diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index 3915e17c18..5fc78fd97d 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -401,6 +401,7 @@ #define SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP (1) /*!