forked from espressif/esp-idf
fix(pm): remove unuse extra_refs related code
This commit is contained in:
@@ -45,7 +45,7 @@ void mac_bb_power_up_cb_execute(void);
|
|||||||
* @brief MAC and baseband power down operation
|
* @brief MAC and baseband power down operation
|
||||||
*
|
*
|
||||||
* In light sleep mode, execute IEEE802154/Bluetooth module MAC and baseband
|
* In light sleep mode, execute IEEE802154/Bluetooth module MAC and baseband
|
||||||
* power up and backup prepare operations.
|
* power down and backup prepare operations.
|
||||||
*/
|
*/
|
||||||
void mac_bb_power_down_prepare(void);
|
void mac_bb_power_down_prepare(void);
|
||||||
|
|
||||||
|
@@ -108,8 +108,6 @@ void sleep_retention_entries_get(sleep_retention_entries_t *entries);
|
|||||||
* or false for restore to register from memory
|
* or false for restore to register from memory
|
||||||
*/
|
*/
|
||||||
void sleep_retention_do_extra_retention(bool backup_or_restore);
|
void sleep_retention_do_extra_retention(bool backup_or_restore);
|
||||||
|
|
||||||
void sleep_retention_module_deinit(void);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -94,15 +94,11 @@ typedef struct {
|
|||||||
uint32_t modules;
|
uint32_t modules;
|
||||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||||
#define EXTRA_LINK_NUM (REGDMA_LINK_ENTRY_NUM - 1)
|
#define EXTRA_LINK_NUM (REGDMA_LINK_ENTRY_NUM - 1)
|
||||||
int extra_refs;
|
|
||||||
#endif
|
#endif
|
||||||
} sleep_retention_t;
|
} sleep_retention_t;
|
||||||
|
|
||||||
static DRAM_ATTR __attribute__((unused)) sleep_retention_t s_retention = {
|
static DRAM_ATTR __attribute__((unused)) sleep_retention_t s_retention = {
|
||||||
.highpri = (uint8_t)-1, .modules = 0
|
.highpri = (uint8_t)-1, .modules = 0
|
||||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
|
||||||
, .extra_refs = 0
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SLEEP_RETENTION_ENTRY_BITMAP_MASK (BIT(REGDMA_LINK_ENTRY_NUM) - 1)
|
#define SLEEP_RETENTION_ENTRY_BITMAP_MASK (BIT(REGDMA_LINK_ENTRY_NUM) - 1)
|
||||||
@@ -509,30 +505,13 @@ void sleep_retention_do_extra_retention(bool backup_or_restore)
|
|||||||
s_retention.highpri > SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) {
|
s_retention.highpri > SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const uint32_t clk_bug_modules = SLEEP_RETENTION_MODULE_BLE_MAC | SLEEP_RETENTION_MODULE_802154_MAC;
|
|
||||||
const int cnt_modules = __builtin_popcount(clk_bug_modules & s_retention.modules);
|
|
||||||
// Set extra linked list head pointer to hardware
|
// Set extra linked list head pointer to hardware
|
||||||
pau_regdma_set_extra_link_addr(s_retention.lists[s_retention.highpri].entries[EXTRA_LINK_NUM]);
|
pau_regdma_set_extra_link_addr(s_retention.lists[s_retention.highpri].entries[EXTRA_LINK_NUM]);
|
||||||
if (backup_or_restore) {
|
if (backup_or_restore) {
|
||||||
if (s_retention.extra_refs++ == (cnt_modules - 1)) {
|
pau_regdma_trigger_extra_link_backup();
|
||||||
pau_regdma_trigger_extra_link_backup();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (--s_retention.extra_refs == (cnt_modules - 1)) {
|
pau_regdma_trigger_extra_link_restore();
|
||||||
pau_regdma_trigger_extra_link_restore();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int refs = s_retention.extra_refs;
|
|
||||||
assert(refs >= 0 && refs <= cnt_modules);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sleep_retention_module_deinit(void)
|
|
||||||
{
|
|
||||||
_lock_acquire_recursive(&s_retention.lock);
|
|
||||||
if (s_retention.extra_refs) {
|
|
||||||
s_retention.extra_refs--;
|
|
||||||
}
|
|
||||||
_lock_release_recursive(&s_retention.lock);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user