-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/support_gdma_retention' into 'master'
feature: support gdma retention in pd_top lightsleep Closes IDF-7704 and IDFGH-11389 See merge request espressif/esp-idf!27246
- Loading branch information
Showing
29 changed files
with
304 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <stdlib.h> | ||
#include <string.h> | ||
#include "sdkconfig.h" | ||
#include "soc/gdma_periph.h" | ||
#include "soc/soc_caps.h" | ||
|
||
#include "esp_err.h" | ||
#include "esp_check.h" | ||
#include "esp_log.h" | ||
#include "esp_private/sleep_retention.h" | ||
#include "esp_private/esp_regdma.h" | ||
|
||
#include "hal/gdma_ll.h" | ||
|
||
static const char *TAG = "gdma"; | ||
|
||
esp_err_t gdma_sleep_retention_init(int group_id, int pair_id) | ||
{ | ||
sleep_retention_module_bitmap_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_LOGI(TAG, "GDMA pair (%d, %d) retention initialization", group_id, pair_id); | ||
} | ||
|
||
ESP_RETURN_ON_ERROR(err, TAG, "Failed to create sleep retention linked list for GDMA pair (%d, %d) retention", group_id, pair_id); | ||
return err; | ||
} | ||
|
||
esp_err_t gdma_sleep_retention_deinit(int group_id, int pair_id) | ||
{ | ||
esp_err_t err = ESP_OK; | ||
sleep_retention_entries_destroy(GDMA_CH_RETENTION_GET_MODULE_ID(group_id, pair_id)); | ||
return err; | ||
} |
40 changes: 40 additions & 0 deletions
40
components/esp_hw_support/include/esp_private/gdma_sleep_retention.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// DO NOT USE THESE APIS IN ANY APPLICATIONS | ||
// GDMA driver is not public for end users, but for ESP-IDF developers. | ||
|
||
#pragma once | ||
|
||
#include "esp_err.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* Initialize GDMA channel retention link for powerdown the TOP powerdomain during lightsleep | ||
* @param group_id Group id | ||
* @param pair_id Pair id | ||
* @return | ||
* - ESP_OK: Create DMA retention link successfully | ||
* - ESP_ERR_NO_MEM: Create DMA retention link failed because out of memory | ||
*/ | ||
esp_err_t gdma_sleep_retention_init(int group_id, int pair_id); | ||
|
||
/** | ||
* Destroy GDMA channel retention link | ||
* @param group_id Group id | ||
* @param pair_id Pair id | ||
* @return | ||
* - ESP_OK: GDMA channel retention link destrory successfully | ||
* - ESP_ERR_INVALID_STATE: GDMA channel retention link not create yet | ||
*/ | ||
esp_err_t gdma_sleep_retention_deinit(int group_id, int pair_id); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.