forked from espressif/esp-idf
change(esp_hw_support): update some modules sleep retention init dependency bitmap
This commit is contained in:
@@ -612,7 +612,7 @@ static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra)
|
||||
int retention_args = extra;
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = sleep_modem_ble_mac_retention_init, .arg = &retention_args } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_BT_BB)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(BT_BB)
|
||||
};
|
||||
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BLE_MAC, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
|
@@ -603,7 +603,7 @@ static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra)
|
||||
int retention_args = extra;
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = sleep_modem_ble_mac_retention_init, .arg = &retention_args } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_BT_BB)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(BT_BB)
|
||||
};
|
||||
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BLE_MAC, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
|
@@ -41,7 +41,7 @@ static void gptimer_create_retention_module(gptimer_t *timer)
|
||||
int group_id = timer->group->group_id;
|
||||
int timer_id = timer->timer_id;
|
||||
sleep_retention_module_t module = tg_timer_reg_retention_info[group_id][timer_id].module;
|
||||
if ((sleep_retention_get_inited_modules() & BIT(module)) && !(sleep_retention_get_created_modules() & BIT(module))) {
|
||||
if (sleep_retention_is_module_inited(module) && !sleep_retention_is_module_created(module)) {
|
||||
if (sleep_retention_module_allocate(module) != ESP_OK) {
|
||||
// even though the sleep retention module create failed, GPTimer driver should still work, so just warning here
|
||||
ESP_LOGW(TAG, "create retention link failed on TimerGroup%d Timer%d, power domain won't be turned off during sleep", group_id, timer_id);
|
||||
@@ -86,7 +86,7 @@ static esp_err_t gptimer_register_to_group(gptimer_t *timer)
|
||||
.arg = (void *)timer
|
||||
},
|
||||
},
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_SYSTEM)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
|
||||
};
|
||||
if (sleep_retention_module_init(module, &init_param) != ESP_OK) {
|
||||
// even though the sleep retention module init failed, RMT driver should still work, so just warning here
|
||||
@@ -107,7 +107,7 @@ static void gptimer_unregister_from_group(gptimer_t *timer)
|
||||
|
||||
#if GPTIMER_USE_RETENTION_LINK
|
||||
sleep_retention_module_t module = tg_timer_reg_retention_info[group->group_id][timer_id].module;
|
||||
if (sleep_retention_get_created_modules() & BIT(module)) {
|
||||
if (sleep_retention_is_module_created(module)) {
|
||||
sleep_retention_module_free(module);
|
||||
}
|
||||
sleep_retention_module_deinit(module);
|
||||
|
@@ -223,7 +223,7 @@ static void uart_module_enable(uart_port_t uart_num)
|
||||
.arg = &uart_context[uart_num],
|
||||
},
|
||||
},
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_SYSTEM),
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
|
||||
};
|
||||
if (sleep_retention_module_init(module, &init_param) == ESP_OK) {
|
||||
uart_context[uart_num].retention_link_inited = true;
|
||||
|
@@ -36,7 +36,7 @@ static esp_err_t sleep_gdma_channel_retention_init(void *arg)
|
||||
int group_id = parg->group_id;
|
||||
int pair_id = parg->pair_id;
|
||||
|
||||
sleep_retention_module_bitmap_t module = GDMA_CH_RETENTION_GET_MODULE_ID(group_id, pair_id);
|
||||
sleep_retention_module_t module = GDMA_CH_RETENTION_GET_MODULE_ID(group_id, pair_id);
|
||||
esp_err_t err = sleep_retention_entries_create(gdma_chx_regs_retention[group_id][pair_id].link_list, gdma_chx_regs_retention[group_id][pair_id].link_num, REGDMA_LINK_PRI_GDMA, module);
|
||||
if (err == ESP_OK) {
|
||||
ESP_LOGD(TAG, "GDMA pair (%d, %d) retention initialization", group_id, pair_id);
|
||||
@@ -51,9 +51,9 @@ esp_err_t gdma_sleep_retention_init(int group_id, int pair_id)
|
||||
gdma_channel_retention_arg_t arg = { .group_id = group_id, .pair_id = pair_id };
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = sleep_gdma_channel_retention_init, .arg = &arg } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_SYSTEM)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
|
||||
};
|
||||
sleep_retention_module_bitmap_t module = GDMA_CH_RETENTION_GET_MODULE_ID(group_id, pair_id);
|
||||
sleep_retention_module_t module = GDMA_CH_RETENTION_GET_MODULE_ID(group_id, pair_id);
|
||||
esp_err_t err = sleep_retention_module_init(module, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
err = sleep_retention_module_allocate(module);
|
||||
|
@@ -63,7 +63,7 @@ void esp_btbb_enable(void)
|
||||
#if SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = btbb_sleep_retention_init, .arg = NULL } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_MODEM)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
|
||||
};
|
||||
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BT_BB, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
|
@@ -520,7 +520,7 @@ void esp_mac_bb_pd_mem_init(void)
|
||||
#elif SOC_PM_MODEM_RETENTION_BY_REGDMA
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = sleep_retention_wifi_bb_init, .arg = NULL } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_MODEM)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
|
||||
};
|
||||
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_BB, &init_param);
|
||||
if (err != ESP_OK) {
|
||||
|
@@ -72,7 +72,7 @@ static esp_err_t esp_int_wdt_retention_enable(uint32_t group_id)
|
||||
{
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = sleep_int_wdt_retention_init, .arg = &group_id } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_SYSTEM)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
|
||||
};
|
||||
esp_err_t err = sleep_retention_module_init((group_id == 0) ? SLEEP_RETENTION_MODULE_TG0_WDT : SLEEP_RETENTION_MODULE_TG1_WDT, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
|
@@ -65,7 +65,7 @@ static esp_err_t esp_task_wdt_retention_enable(uint32_t group_id)
|
||||
{
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = sleep_task_wdt_retention_init, .arg = &group_id } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_CLOCK_SYSTEM)
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
|
||||
};
|
||||
esp_err_t err = sleep_retention_module_init((group_id == 0) ? SLEEP_RETENTION_MODULE_TG0_WDT : SLEEP_RETENTION_MODULE_TG1_WDT, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
|
@@ -352,8 +352,9 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
||||
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = init_wifi_mac_sleep_retention, .arg = NULL } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_WIFI_BB) | BIT(SLEEP_RETENTION_MODULE_CLOCK_MODEM)
|
||||
};
|
||||
init_param.depends.bitmap[SLEEP_RETENTION_MODULE_WIFI_BB >> 5] |= BIT(SLEEP_RETENTION_MODULE_WIFI_BB % 32);
|
||||
init_param.depends.bitmap[SLEEP_RETENTION_MODULE_CLOCK_MODEM >> 5] |= BIT(SLEEP_RETENTION_MODULE_CLOCK_MODEM % 32);
|
||||
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_MAC, &init_param);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGW(TAG, "WiFi MAC sleep retention init failed");
|
||||
|
@@ -1009,10 +1009,9 @@ static esp_err_t ieee802154_sleep_init(void)
|
||||
{
|
||||
esp_err_t err = ESP_OK;
|
||||
#if CONFIG_PM_ENABLE
|
||||
sleep_retention_module_init_param_t init_param = {
|
||||
.cbs = { .create = { .handle = ieee802154_sleep_retention_init, .arg = NULL } },
|
||||
.depends = BIT(SLEEP_RETENTION_MODULE_BT_BB) | BIT(SLEEP_RETENTION_MODULE_CLOCK_MODEM)
|
||||
};
|
||||
sleep_retention_module_init_param_t init_param = { .cbs = { .create = { .handle = ieee802154_sleep_retention_init, .arg = NULL } } };
|
||||
init_param.depends.bitmap[SLEEP_RETENTION_MODULE_BT_BB >> 5] |= BIT(SLEEP_RETENTION_MODULE_BT_BB % 32);
|
||||
init_param.depends.bitmap[SLEEP_RETENTION_MODULE_CLOCK_MODEM >> 5] |= BIT(SLEEP_RETENTION_MODULE_CLOCK_MODEM % 32);
|
||||
err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_802154_MAC, &init_param);
|
||||
if (err == ESP_OK) {
|
||||
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_802154_MAC);
|
||||
|
Reference in New Issue
Block a user