mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
change(esp_hw_support): rename interface name of get modules bitmap to get created modules
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -104,6 +104,18 @@ void * sleep_retention_find_link_by_id(int id);
|
|||||||
*/
|
*/
|
||||||
void sleep_retention_entries_get(sleep_retention_entries_t *entries);
|
void sleep_retention_entries_get(sleep_retention_entries_t *entries);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get all created modules that require sleep retention
|
||||||
|
*
|
||||||
|
* This is an unprotected interface for getting a bitmap of all modules that
|
||||||
|
* require sleep retention.
|
||||||
|
*
|
||||||
|
* It can only be called by the sleep procedure.
|
||||||
|
*
|
||||||
|
* @return the bitmap of all modules requiring sleep retention
|
||||||
|
*/
|
||||||
|
uint32_t sleep_retention_get_created_modules(void);
|
||||||
|
|
||||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||||
/**
|
/**
|
||||||
* @brief Software trigger REGDMA to do extra linked list retention
|
* @brief Software trigger REGDMA to do extra linked list retention
|
||||||
@ -114,18 +126,6 @@ void sleep_retention_entries_get(sleep_retention_entries_t *entries);
|
|||||||
void sleep_retention_do_extra_retention(bool backup_or_restore);
|
void sleep_retention_do_extra_retention(bool backup_or_restore);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get all registered modules that require sleep retention
|
|
||||||
*
|
|
||||||
* This is an unprotected interface for getting a bitmap of all modules that
|
|
||||||
* require sleep retention.
|
|
||||||
*
|
|
||||||
* It can only be called by the sleep procedure.
|
|
||||||
*
|
|
||||||
* @return the bitmap of all modules requiring sleep retention
|
|
||||||
*/
|
|
||||||
uint32_t sleep_retention_get_modules(void);
|
|
||||||
|
|
||||||
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
|
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
|
||||||
/**
|
/**
|
||||||
* @brief Software trigger REGDMA to do system linked list retention
|
* @brief Software trigger REGDMA to do system linked list retention
|
||||||
|
@ -78,14 +78,14 @@ void sleep_clock_modem_retention_deinit(void)
|
|||||||
|
|
||||||
bool clock_domain_pd_allowed(void)
|
bool clock_domain_pd_allowed(void)
|
||||||
{
|
{
|
||||||
const uint32_t modules = sleep_retention_get_modules();
|
const uint32_t created_modules = sleep_retention_get_created_modules();
|
||||||
const uint32_t mask = (const uint32_t) (
|
const uint32_t mask = (const uint32_t) (
|
||||||
SLEEP_RETENTION_MODULE_CLOCK_SYSTEM
|
SLEEP_RETENTION_MODULE_CLOCK_SYSTEM
|
||||||
#if CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE
|
#if CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE
|
||||||
| SLEEP_RETENTION_MODULE_CLOCK_MODEM
|
| SLEEP_RETENTION_MODULE_CLOCK_MODEM
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
return ((modules & mask) == mask);
|
return ((created_modules & mask) == mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP || CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE
|
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP || CONFIG_MAC_BB_PD || CONFIG_BT_LE_SLEEP_ENABLE || CONFIG_IEEE802154_SLEEP_ENABLE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -285,16 +285,16 @@ inline __attribute__((always_inline)) bool sleep_modem_wifi_modem_link_done(void
|
|||||||
bool modem_domain_pd_allowed(void)
|
bool modem_domain_pd_allowed(void)
|
||||||
{
|
{
|
||||||
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
|
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
|
||||||
const uint32_t modules = sleep_retention_get_modules();
|
const uint32_t created_modules = sleep_retention_get_created_modules();
|
||||||
const uint32_t mask_wifi = (const uint32_t) (SLEEP_RETENTION_MODULE_WIFI_MAC |
|
const uint32_t mask_wifi = (const uint32_t) (SLEEP_RETENTION_MODULE_WIFI_MAC |
|
||||||
SLEEP_RETENTION_MODULE_WIFI_BB);
|
SLEEP_RETENTION_MODULE_WIFI_BB);
|
||||||
const uint32_t mask_ble = (const uint32_t) (SLEEP_RETENTION_MODULE_BLE_MAC |
|
const uint32_t mask_ble = (const uint32_t) (SLEEP_RETENTION_MODULE_BLE_MAC |
|
||||||
SLEEP_RETENTION_MODULE_BT_BB);
|
SLEEP_RETENTION_MODULE_BT_BB);
|
||||||
const uint32_t mask_154 = (const uint32_t) (SLEEP_RETENTION_MODULE_802154_MAC |
|
const uint32_t mask_154 = (const uint32_t) (SLEEP_RETENTION_MODULE_802154_MAC |
|
||||||
SLEEP_RETENTION_MODULE_BT_BB);
|
SLEEP_RETENTION_MODULE_BT_BB);
|
||||||
return (((modules & mask_wifi) == mask_wifi) ||
|
return (((created_modules & mask_wifi) == mask_wifi) ||
|
||||||
((modules & mask_ble) == mask_ble) ||
|
((created_modules & mask_ble) == mask_ble) ||
|
||||||
((modules & mask_154) == mask_154));
|
((created_modules & mask_154) == mask_154));
|
||||||
#else
|
#else
|
||||||
return false; /* MODEM power domain is controlled by each module (WiFi, Bluetooth or 15.4) of modem */
|
return false; /* MODEM power domain is controlled by each module (WiFi, Bluetooth or 15.4) of modem */
|
||||||
#endif
|
#endif
|
||||||
|
@ -493,7 +493,7 @@ void sleep_retention_entries_get(sleep_retention_entries_t *entries)
|
|||||||
_lock_release_recursive(&s_retention.lock);
|
_lock_release_recursive(&s_retention.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t IRAM_ATTR sleep_retention_get_modules(void)
|
uint32_t IRAM_ATTR sleep_retention_get_created_modules(void)
|
||||||
{
|
{
|
||||||
return s_retention.created_modules;
|
return s_retention.created_modules;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ error:
|
|||||||
|
|
||||||
bool peripheral_domain_pd_allowed(void)
|
bool peripheral_domain_pd_allowed(void)
|
||||||
{
|
{
|
||||||
const uint32_t modules = sleep_retention_get_modules();
|
const uint32_t created_modules = sleep_retention_get_created_modules();
|
||||||
const uint32_t mask = (const uint32_t) (
|
const uint32_t mask = (const uint32_t) (
|
||||||
SLEEP_RETENTION_MODULE_INTR_MATRIX | \
|
SLEEP_RETENTION_MODULE_INTR_MATRIX | \
|
||||||
SLEEP_RETENTION_MODULE_HP_SYSTEM | \
|
SLEEP_RETENTION_MODULE_HP_SYSTEM | \
|
||||||
@ -255,7 +255,7 @@ bool peripheral_domain_pd_allowed(void)
|
|||||||
SLEEP_RETENTION_MODULE_IOMUX | \
|
SLEEP_RETENTION_MODULE_IOMUX | \
|
||||||
SLEEP_RETENTION_MODULE_SPIMEM | \
|
SLEEP_RETENTION_MODULE_SPIMEM | \
|
||||||
SLEEP_RETENTION_MODULE_SYSTIMER);
|
SLEEP_RETENTION_MODULE_SYSTIMER);
|
||||||
return ((modules & mask) == mask);
|
return ((created_modules & mask) == mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||||
|
Reference in New Issue
Block a user