-
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/gdma_retention_support_p4_c5_c61' into 'master'
feat(gdma): add retention support for esp32p4, esp32c5, esp32c61 Closes IDF-9225, IDF-9929, and IDF-10380 See merge request espressif/esp-idf!33733
- Loading branch information
Showing
36 changed files
with
624 additions
and
128 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
36 changes: 36 additions & 0 deletions
36
components/esp_hw_support/test_apps/dma/main/gdma_test_utils.c
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,36 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/task.h" | ||
#include "soc/soc_caps.h" | ||
#include "gdma_test_utils.h" | ||
#include "esp_private/sleep_retention.h" | ||
#include "hal/gdma_ll.h" | ||
|
||
void test_gdma_trigger_retention_backup(gdma_channel_handle_t chan, ...) | ||
{ | ||
#if SOC_PAU_SUPPORTED && SOC_GDMA_SUPPORT_SLEEP_RETENTION | ||
// trigger a software retention to test GDMA retention correctnesss | ||
// 1. backup gdma register context | ||
sleep_retention_do_extra_retention(true); | ||
|
||
// 2. reset gdma registers to default value | ||
gdma_channel_handle_t chan_itor = chan; | ||
va_list args; | ||
int group_id = -1; | ||
va_start(args, chan); | ||
while (chan_itor) { | ||
gdma_get_group_channel_id(chan_itor, &group_id, NULL); | ||
_gdma_ll_reset_register(group_id); | ||
chan_itor = va_arg(args, gdma_channel_handle_t); | ||
} | ||
va_end(args); | ||
|
||
// 3. restore gdma register context | ||
sleep_retention_do_extra_retention(false); | ||
#endif | ||
vTaskDelay(pdMS_TO_TICKS(10)); | ||
} |
28 changes: 28 additions & 0 deletions
28
components/esp_hw_support/test_apps/dma/main/gdma_test_utils.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,28 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdbool.h> | ||
#include "esp_private/gdma.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Trigger a "fake" sleep retention process. | ||
* | ||
* @note Call this help function after the gdma set up is completed. Then check the gdma functionality is still working. | ||
* | ||
* @param chan GDMA channel handle to be reset | ||
* @param ... Other GDMA channel handle if any | ||
*/ | ||
void test_gdma_trigger_retention_backup(gdma_channel_handle_t chan, ...); | ||
|
||
#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
Oops, something went wrong.