diff --git a/components/esp_hw_support/include/esp_private/sleep_retention.h b/components/esp_hw_support/include/esp_private/sleep_retention.h index c2b8d58c7dc..97f44d00814 100644 --- a/components/esp_hw_support/include/esp_private/sleep_retention.h +++ b/components/esp_hw_support/include/esp_private/sleep_retention.h @@ -17,7 +17,7 @@ extern "C" { #include "esp_regdma.h" #include "soc/retention_periph_defs.h" -#define SLEEP_RETENTION_MODULE_BITMAP_SZ ((SLEEP_RETENTION_MODULE_MAX >> 5) + 1) +#define SLEEP_RETENTION_MODULE_BITMAP_SZ (((SLEEP_RETENTION_MODULE_MAX - 1) >> 5) + 1) /** * @file sleep_retention.h diff --git a/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock_icg.c b/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock_icg.c index f6696a44b5e..0131aa1bdc2 100644 --- a/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock_icg.c +++ b/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock_icg.c @@ -42,7 +42,7 @@ static int16_t s_sleep_clock_icg_refs[ESP_SLEEP_CLOCK_MAX]; #define RETENTION_COMMON PMU_CLK_ICGS( REGDMA, HPCORE ) | RETENTION_SYS_CLK -static const uint32_t s_retention_module_retention_clocks[SLEEP_RETENTION_MODULE_MAX + 1] = { +static const uint32_t s_retention_module_retention_clocks[SLEEP_RETENTION_MODULE_MAX] = { [SLEEP_RETENTION_MODULE_NULL] = 0, [SLEEP_RETENTION_MODULE_CLOCK_SYSTEM] = RETENTION_COMMON, [SLEEP_RETENTION_MODULE_SYS_PERIPH] = RETENTION_COMMON | PMU_CLK_ICGS( IOMUX, SYSTIMER, SEC, MSPI ) | RETENTION_CONSOLE_UART, @@ -85,7 +85,7 @@ void sleep_clock_icg_retention_clock_config(sleep_retention_module_bitmap_t *mod /* Check if the last word holds bit above MODULE_MAX. */ assert(!module_bitmap->bitmap[SLEEP_RETENTION_MODULE_BITMAP_SZ - 1] || ((31 - __builtin_clz(module_bitmap->bitmap[SLEEP_RETENTION_MODULE_BITMAP_SZ - 1])) + - ((SLEEP_RETENTION_MODULE_BITMAP_SZ - 1) << 5)) <= SLEEP_RETENTION_MODULE_MAX); + ((SLEEP_RETENTION_MODULE_BITMAP_SZ - 1) << 5)) < SLEEP_RETENTION_MODULE_MAX); uint32_t clocks_mask = 0; sleep_retention_module_t module = 0; diff --git a/components/esp_hw_support/lowpower/port/esp32h4/sleep_clock_icg.c b/components/esp_hw_support/lowpower/port/esp32h4/sleep_clock_icg.c index 2717101ae44..d2407e7f2c5 100644 --- a/components/esp_hw_support/lowpower/port/esp32h4/sleep_clock_icg.c +++ b/components/esp_hw_support/lowpower/port/esp32h4/sleep_clock_icg.c @@ -42,7 +42,7 @@ static int16_t s_sleep_clock_icg_refs[ESP_SLEEP_CLOCK_MAX]; #define RETENTION_COMMON PMU_CLK_ICGS( HPCORE ) | RETENTION_SYS_CLK -static const uint32_t s_retention_module_retention_clocks[SLEEP_RETENTION_MODULE_MAX + 1] = { +static const uint32_t s_retention_module_retention_clocks[SLEEP_RETENTION_MODULE_MAX] = { [SLEEP_RETENTION_MODULE_NULL] = 0, [SLEEP_RETENTION_MODULE_CLOCK_SYSTEM] = RETENTION_COMMON, [SLEEP_RETENTION_MODULE_SYS_PERIPH] = RETENTION_COMMON | PMU_CLK_ICGS( IOMUX, SYSTIMER, SEC, MSPI ) | RETENTION_CONSOLE_UART, @@ -90,7 +90,7 @@ void sleep_clock_icg_retention_clock_config(sleep_retention_module_bitmap_t *mod /* Check if the last word holds bit above MODULE_MAX. */ assert(!module_bitmap->bitmap[SLEEP_RETENTION_MODULE_BITMAP_SZ - 1] || ((31 - __builtin_clz(module_bitmap->bitmap[SLEEP_RETENTION_MODULE_BITMAP_SZ - 1])) + - ((SLEEP_RETENTION_MODULE_BITMAP_SZ - 1) << 5)) <= SLEEP_RETENTION_MODULE_MAX); + ((SLEEP_RETENTION_MODULE_BITMAP_SZ - 1) << 5)) < SLEEP_RETENTION_MODULE_MAX); uint32_t clocks_mask = 0; sleep_retention_module_t module = 0; diff --git a/components/esp_hw_support/lowpower/port/esp32s31/sleep_clock_icg.c b/components/esp_hw_support/lowpower/port/esp32s31/sleep_clock_icg.c index 3950ed0b963..817309eb715 100644 --- a/components/esp_hw_support/lowpower/port/esp32s31/sleep_clock_icg.c +++ b/components/esp_hw_support/lowpower/port/esp32s31/sleep_clock_icg.c @@ -46,7 +46,7 @@ static int16_t s_sleep_clock_icg_refs[ESP_SLEEP_CLOCK_MAX]; #define RETENTION_COMMON PMU_CLK_ICGS( REGDMA, HPCORE0, HPCORE1 ) | RETENTION_SYS_CLK -static const uint64_t s_retention_module_retention_clocks[SLEEP_RETENTION_MODULE_MAX + 1] = { +static const uint64_t s_retention_module_retention_clocks[SLEEP_RETENTION_MODULE_MAX] = { [SLEEP_RETENTION_MODULE_NULL] = 0, [SLEEP_RETENTION_MODULE_CLOCK_SYSTEM] = RETENTION_COMMON, [SLEEP_RETENTION_MODULE_SYS_PERIPH] = RETENTION_COMMON | PMU_CLK_ICGS( IOMUX, SYSTIMER, SEC, MSPI_FLASH, MSPI_PSRAM ) | RETENTION_CONSOLE_UART, @@ -112,7 +112,7 @@ void sleep_clock_icg_retention_clock_config(sleep_retention_module_bitmap_t *mod /* Check if the last word holds bit above MODULE_MAX. */ assert(!module_bitmap->bitmap[SLEEP_RETENTION_MODULE_BITMAP_SZ - 1] || ((31 - __builtin_clz(module_bitmap->bitmap[SLEEP_RETENTION_MODULE_BITMAP_SZ - 1])) + - ((SLEEP_RETENTION_MODULE_BITMAP_SZ - 1) << 5)) <= SLEEP_RETENTION_MODULE_MAX); + ((SLEEP_RETENTION_MODULE_BITMAP_SZ - 1) << 5)) < SLEEP_RETENTION_MODULE_MAX); uint64_t clocks_mask = 0; sleep_retention_module_t module = 0; diff --git a/components/esp_hw_support/sleep_retention.c b/components/esp_hw_support/sleep_retention.c index 22bf85061d0..ad8f40150d5 100644 --- a/components/esp_hw_support/sleep_retention.c +++ b/components/esp_hw_support/sleep_retention.c @@ -180,7 +180,7 @@ struct module_sleep_retention_context { #define SLEEP_RETENTION_REGDMA_LINK_NR_PRIORITIES (8u) #define SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY (0) #define SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY (SLEEP_RETENTION_REGDMA_LINK_NR_PRIORITIES - 1) -#define SLEEP_RETENTION_MODULE_INVALID ((sleep_retention_module_t)(-1)) /* the final node does not belong to any module */ +#define SLEEP_RETENTION_MODULE_INVALID ((sleep_retention_module_t)(SLEEP_RETENTION_MODULE_MAX)) /* the final node does not belong to any module */ struct { sleep_retention_entries_t entries; uint32_t entries_bitmap: REGDMA_LINK_ENTRY_NUM; @@ -258,7 +258,7 @@ typedef struct { void *final_default; - struct sleep_retention_module_object instance[SLEEP_RETENTION_MODULE_MAX + 1]; + struct sleep_retention_module_object instance[SLEEP_RETENTION_MODULE_MAX]; #define EXTRA_LINK_NUM (REGDMA_LINK_ENTRY_NUM - 1) } sleep_retention_t; @@ -425,7 +425,7 @@ static void * entries_try_create_bonding(const regdma_link_config_t *config, uin void sleep_retention_dump_modules(FILE *out) { - for (int i = SLEEP_RETENTION_MODULE_MIN; i <= SLEEP_RETENTION_MODULE_MAX; i++) { + for (int i = SLEEP_RETENTION_MODULE_MIN; i < SLEEP_RETENTION_MODULE_MAX; i++) { bool inited = sleep_retention_is_module_inited(i); bool created = sleep_retention_is_module_created(i); bool is_top = is_top_domain_module(i); @@ -624,8 +624,10 @@ static void entries_do_destroy(sleep_retention_module_t module) memset(&next_entries, 0, sizeof(sleep_retention_entries_t)); _lock_acquire_recursive(&s_retention.lock); - s_retention.retention_modules.bitmap[module >> 5] &= ~BIT(module % 32); - s_retention.created_modules.bitmap[module >> 5] &= ~BIT(module % 32); + if (module < SLEEP_RETENTION_MODULE_MAX) { + s_retention.retention_modules.bitmap[module >> 5] &= ~BIT(module % 32); + s_retention.created_modules.bitmap[module >> 5] &= ~BIT(module % 32); + } int index = module_runtime_attach(instance(module)) ? 1 : 0; struct module_sleep_retention_context *ctx = &s_retention.context[index]; regdma_link_priority_t priority = 0; @@ -647,7 +649,7 @@ static void entries_do_destroy(sleep_retention_module_t module) static void entries_destroy(sleep_retention_module_t module) { - assert(SLEEP_RETENTION_MODULE_MIN <= module && module <= SLEEP_RETENTION_MODULE_MAX); + assert(SLEEP_RETENTION_MODULE_MIN <= module && module <= SLEEP_RETENTION_MODULE_INVALID); _lock_acquire_recursive(&s_retention.lock); if (!module_runtime_attach(instance(module))) { retention_entries_join(); @@ -660,7 +662,7 @@ static void entries_destroy(sleep_retention_module_t module) static void sleep_retention_entries_destroy(sleep_retention_module_t module) { - assert(SLEEP_RETENTION_MODULE_MIN <= module && module <= SLEEP_RETENTION_MODULE_MAX); + assert(SLEEP_RETENTION_MODULE_MIN <= module && module < SLEEP_RETENTION_MODULE_MAX); _lock_acquire_recursive(&s_retention.lock); entries_destroy(module); uint32_t created_modules = 0; @@ -819,7 +821,7 @@ esp_err_t sleep_retention_entries_create(const sleep_retention_entries_config_t if (priority >= SLEEP_RETENTION_REGDMA_LINK_NR_PRIORITIES) { return ESP_ERR_INVALID_ARG; } - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } esp_err_t err = check_and_create_final_default(); @@ -857,7 +859,7 @@ sleep_retention_module_bitmap_t IRAM_ATTR sleep_retention_get_retained_modules(v bool sleep_retention_is_module_inited(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return false; } _lock_acquire_recursive(&s_retention.lock); @@ -868,7 +870,7 @@ bool sleep_retention_is_module_inited(sleep_retention_module_t module) bool sleep_retention_is_module_created(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return false; } _lock_acquire_recursive(&s_retention.lock); @@ -879,7 +881,7 @@ bool sleep_retention_is_module_created(sleep_retention_module_t module) bool sleep_retention_is_module_attached(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return false; } _lock_acquire_recursive(&s_retention.lock); @@ -972,7 +974,7 @@ static esp_err_t module_action_wrapper(sleep_retention_module_t module, int arg, esp_err_t sleep_retention_module_init(sleep_retention_module_t module, sleep_retention_module_init_param_t *param) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } if (param == NULL || param->cbs.create.handle == NULL) { @@ -1005,7 +1007,7 @@ esp_err_t sleep_retention_module_init(sleep_retention_module_t module, sleep_ret esp_err_t sleep_retention_module_deinit(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } @@ -1036,7 +1038,7 @@ esp_err_t sleep_retention_module_deinit(sleep_retention_module_t module) static esp_err_t passive_module_allocate(sleep_retention_module_t module) { - assert(module >= SLEEP_RETENTION_MODULE_MIN && module <= SLEEP_RETENTION_MODULE_MAX); + assert(module >= SLEEP_RETENTION_MODULE_MIN && module < SLEEP_RETENTION_MODULE_MAX); esp_err_t err = ESP_OK; _lock_acquire_recursive(&s_retention.lock); @@ -1057,7 +1059,7 @@ static esp_err_t passive_module_allocate(sleep_retention_module_t module) esp_err_t sleep_retention_module_allocate(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } @@ -1084,7 +1086,7 @@ esp_err_t sleep_retention_module_allocate(sleep_retention_module_t module) static esp_err_t passive_module_free(sleep_retention_module_t module) { - assert(module >= SLEEP_RETENTION_MODULE_MIN && module <= SLEEP_RETENTION_MODULE_MAX); + assert(module >= SLEEP_RETENTION_MODULE_MIN && module < SLEEP_RETENTION_MODULE_MAX); esp_err_t err = ESP_OK; _lock_acquire_recursive(&s_retention.lock); @@ -1111,7 +1113,7 @@ static esp_err_t passive_module_free(sleep_retention_module_t module) esp_err_t sleep_retention_module_free(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } @@ -1161,7 +1163,7 @@ static void module_entries_move(sleep_retention_module_t module, struct module_s static esp_err_t passive_module_attach(sleep_retention_module_t module) { - assert(module >= SLEEP_RETENTION_MODULE_MIN && module <= SLEEP_RETENTION_MODULE_MAX); + assert(module >= SLEEP_RETENTION_MODULE_MIN && module < SLEEP_RETENTION_MODULE_MAX); esp_err_t err = ESP_OK; _lock_acquire_recursive(&s_retention.lock); @@ -1180,7 +1182,7 @@ static esp_err_t passive_module_attach(sleep_retention_module_t module) esp_err_t sleep_retention_module_attach(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } @@ -1208,7 +1210,7 @@ esp_err_t sleep_retention_module_attach(sleep_retention_module_t module) static esp_err_t passive_module_detach(sleep_retention_module_t module) { - assert(module >= SLEEP_RETENTION_MODULE_MIN && module <= SLEEP_RETENTION_MODULE_MAX); + assert(module >= SLEEP_RETENTION_MODULE_MIN && module < SLEEP_RETENTION_MODULE_MAX); esp_err_t err = ESP_OK; _lock_acquire_recursive(&s_retention.lock); @@ -1229,7 +1231,7 @@ static esp_err_t passive_module_detach(sleep_retention_module_t module) esp_err_t sleep_retention_module_detach(sleep_retention_module_t module) { - if (module < SLEEP_RETENTION_MODULE_MIN || module > SLEEP_RETENTION_MODULE_MAX) { + if (module < SLEEP_RETENTION_MODULE_MIN || module >= SLEEP_RETENTION_MODULE_MAX) { return ESP_ERR_INVALID_ARG; } diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index 9023a83634e..87cb0251cbc 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -1431,10 +1431,6 @@ config SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED bool default y -config SOC_PM_RETENTION_MODULE_NUM - int - default 40 - config SOC_PM_FLASH_KEEP_POWER_IN_LSLP bool default y diff --git a/components/soc/esp32c5/include/soc/retention_periph_defs.h b/components/soc/esp32c5/include/soc/retention_periph_defs.h index 70b88570a1c..ce1bfbfe813 100644 --- a/components/soc/esp32c5/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c5/include/soc/retention_periph_defs.h @@ -7,7 +7,6 @@ #pragma once #include -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -57,7 +56,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MODEM_PHY = 31, SLEEP_RETENTION_MODULE_PHY_FE = 32, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) (m <= SLEEP_RETENTION_MODULE_SDM0) diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index 3d481cb6f68..f4bed4b404c 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -577,8 +577,6 @@ #define SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED (1) -#define SOC_PM_RETENTION_MODULE_NUM (40) - #define SOC_PM_FLASH_KEEP_POWER_IN_LSLP (1) /*! -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -56,7 +55,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_802154_MAC = 30, SLEEP_RETENTION_MODULE_PHY_FE = 31, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) (m <= SLEEP_RETENTION_MODULE_SDM0) diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index dd5cf8b57f6..2ae34d2b7c0 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -481,8 +481,6 @@ #define SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE (1) #define SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED (1) -#define SOC_PM_RETENTION_MODULE_NUM (32) - #define SOC_PM_TOP_DEPENDS_ON_RTC_PERIPH (1) /*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/ diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index 0c5a1c339ed..485dadbad61 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -1083,10 +1083,6 @@ config SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED bool default y -config SOC_PM_RETENTION_MODULE_NUM - int - default 32 - config SOC_PM_FLASH_KEEP_POWER_IN_LSLP bool default y diff --git a/components/soc/esp32c61/include/soc/retention_periph_defs.h b/components/soc/esp32c61/include/soc/retention_periph_defs.h index 24b0883b775..52e21ae9d8c 100644 --- a/components/soc/esp32c61/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c61/include/soc/retention_periph_defs.h @@ -7,7 +7,6 @@ #pragma once #include -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -49,7 +48,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_802154_MAC = 30, SLEEP_RETENTION_MODULE_PHY_FE = 31, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) (m <= SLEEP_RETENTION_MODULE_TEMP_SENSOR) diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index d6a5c95f701..34f76fcee3a 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -444,8 +444,6 @@ #define SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE (1) #define SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED (1) -#define SOC_PM_RETENTION_MODULE_NUM (32) - #define SOC_PM_FLASH_KEEP_POWER_IN_LSLP (1) /*! -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -53,7 +52,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_BT_BB = 29, SLEEP_RETENTION_MODULE_802154_MAC = 30, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) ((m) <= SLEEP_RETENTION_MODULE_SDM0) diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index b165ab36a77..c7a4ca6823a 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -480,8 +480,6 @@ #define SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE (1) -#define SOC_PM_RETENTION_MODULE_NUM (32) - #define SOC_EXT_MEM_CACHE_TAG_IN_CPU_DOMAIN (1) #define SOC_PM_CPU_RETENTION_BY_SW (1) #define SOC_PM_MODEM_RETENTION_BY_REGDMA (1) diff --git a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in index b798b9856d5..4d9ba755b81 100644 --- a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in @@ -1027,10 +1027,6 @@ config SOC_PM_PAU_LINK_NUM int default 5 -config SOC_PM_RETENTION_MODULE_NUM - int - default 32 - config SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE bool default y diff --git a/components/soc/esp32h21/include/soc/retention_periph_defs.h b/components/soc/esp32h21/include/soc/retention_periph_defs.h index d8d21b5d9a0..379bc9f9e25 100644 --- a/components/soc/esp32h21/include/soc/retention_periph_defs.h +++ b/components/soc/esp32h21/include/soc/retention_periph_defs.h @@ -7,7 +7,6 @@ #pragma once #include -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -53,7 +52,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_BT_BB = 29, SLEEP_RETENTION_MODULE_802154_MAC = 30, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) ((m) <= SLEEP_RETENTION_MODULE_SDM0) diff --git a/components/soc/esp32h21/include/soc/soc_caps.h b/components/soc/esp32h21/include/soc/soc_caps.h index 9234e0f5267..9618eb8584c 100644 --- a/components/soc/esp32h21/include/soc/soc_caps.h +++ b/components/soc/esp32h21/include/soc/soc_caps.h @@ -449,7 +449,6 @@ #define SOC_PM_SUPPORT_VDDSDIO_PD (1) #define SOC_PM_SUPPORT_TOP_PD (1) #define SOC_PM_PAU_LINK_NUM (5) -#define SOC_PM_RETENTION_MODULE_NUM (32) #define SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE (1) #define SOC_PM_CPU_RETENTION_BY_SW (1) #define SOC_PM_MODEM_RETENTION_BY_REGDMA (1) diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index 8c65b2507ef..c6a0f35ed07 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -1211,10 +1211,6 @@ config SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE bool default y -config SOC_PM_RETENTION_MODULE_NUM - int - default 64 - config SOC_PM_TOP_DEPENDS_ON_RTC_PERIPH bool default y diff --git a/components/soc/esp32h4/include/soc/retention_periph_defs.h b/components/soc/esp32h4/include/soc/retention_periph_defs.h index a1ab02d76e0..b08ce1af922 100644 --- a/components/soc/esp32h4/include/soc/retention_periph_defs.h +++ b/components/soc/esp32h4/include/soc/retention_periph_defs.h @@ -7,7 +7,6 @@ #pragma once #include -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -59,7 +58,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_802154_MAC = 33, SLEEP_RETENTION_MODULE_POWER = 34, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) ((m) <= SLEEP_RETENTION_MODULE_ASRC) diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index bb928858d8c..c81e9e4ce47 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -504,7 +504,6 @@ #define SOC_PM_PAU_LINK_NUM (4) #define SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE (1) -#define SOC_PM_RETENTION_MODULE_NUM (64) #define SOC_PM_TOP_DEPENDS_ON_RTC_PERIPH (1) // In ESP32H4, RTC_PERIPH should be pd only together with TOP, otherwise there is some current leak. #define SOC_PM_BBPLL_PD_IN_MODEM_STATE (1) diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index 6a226079256..20fd8615a5a 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1803,10 +1803,6 @@ config SOC_SLEEP_TGWDT_STOP_WORKAROUND bool default y -config SOC_PM_RETENTION_MODULE_NUM - int - default 64 - config SOC_MAIN_POWER_CONTROL_SUPPORTED bool default y diff --git a/components/soc/esp32p4/include/soc/retention_periph_defs.h b/components/soc/esp32p4/include/soc/retention_periph_defs.h index 36a115e42ae..30dc2a53e8f 100644 --- a/components/soc/esp32p4/include/soc/retention_periph_defs.h +++ b/components/soc/esp32p4/include/soc/retention_periph_defs.h @@ -7,7 +7,6 @@ #pragma once #include -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -68,9 +67,9 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_PPA = 42, /* PMU REGDMA clock icg */ - SLEEP_RETENTION_MODULE_CLOCK_ICG = SOC_PM_RETENTION_MODULE_NUM - 2, + SLEEP_RETENTION_MODULE_CLOCK_ICG = 43, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) (((m) <= SLEEP_RETENTION_MODULE_PPA) || ((m) == SLEEP_RETENTION_MODULE_CLOCK_ICG)) diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index 9bd4a3b45c8..9514d95895c 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -682,8 +682,6 @@ #define SOC_SLEEP_SYSTIMER_STALL_WORKAROUND 1 //TODO IDF-11381: replace with all xtal field clk gate control #define SOC_SLEEP_TGWDT_STOP_WORKAROUND 1 //TODO IDF-11381: replace with all xtal field clk gate control -#define SOC_PM_RETENTION_MODULE_NUM (64) - #define SOC_MAIN_POWER_CONTROL_SUPPORTED (1) /*! -#include "soc_caps.h" #ifdef __cplusplus extern "C" { @@ -82,7 +81,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_ASRC = 53, - SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 + SLEEP_RETENTION_MODULE_MAX, } periph_retention_module_t; #define is_top_domain_module(m) ((m >= SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) && ((m <= SLEEP_RETENTION_MODULE_PPA))) diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index 1c095b038ef..0dc1f8a43eb 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -602,8 +602,6 @@ */ #define SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED (1) -#define SOC_PM_RETENTION_MODULE_NUM (64) - #define SOC_PM_SUPPORT_BUS_CLK_AUTO_GATE (1) /*!