Skip to content

Commit 1b44d4d

Browse files
committed
Merge branch 'fix/fix_tg_retention_failure' into 'master'
fix(esp_driver_gptimer): do gptimer retention by timer unit rather than timer group Closes PM-233 and IDFCI-2427 See merge request espressif/esp-idf!35284
2 parents 1b7bdcb + 3ae1929 commit 1b44d4d

File tree

17 files changed

+311
-221
lines changed

17 files changed

+311
-221
lines changed

components/esp_driver_gptimer/src/gptimer.c

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ static const char *TAG = "gptimer";
2525

2626
static void gptimer_default_isr(void *args);
2727

28+
#if GPTIMER_USE_RETENTION_LINK
29+
static esp_err_t gptimer_create_sleep_retention_link_cb(void *timer)
30+
{
31+
int group_id = ((gptimer_t *)timer)->group->group_id;
32+
int timer_id = ((gptimer_t *)timer)->timer_id;
33+
esp_err_t err = sleep_retention_entries_create(tg_timer_reg_retention_info[group_id][timer_id].regdma_entry_array,
34+
tg_timer_reg_retention_info[group_id][timer_id].array_size,
35+
REGDMA_LINK_PRI_GPTIMER, tg_timer_reg_retention_info[group_id][timer_id].module);
36+
return err;
37+
}
38+
39+
static void gptimer_create_retention_module(gptimer_t *timer)
40+
{
41+
int group_id = timer->group->group_id;
42+
int timer_id = timer->timer_id;
43+
sleep_retention_module_t module = tg_timer_reg_retention_info[group_id][timer_id].module;
44+
if (sleep_retention_is_module_inited(module) && !sleep_retention_is_module_created(module)) {
45+
if (sleep_retention_module_allocate(module) != ESP_OK) {
46+
// even though the sleep retention module create failed, GPTimer driver should still work, so just warning here
47+
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);
48+
}
49+
}
50+
}
51+
#endif // GPTIMER_USE_RETENTION_LINK
52+
2853
static esp_err_t gptimer_register_to_group(gptimer_t *timer)
2954
{
3055
gptimer_group_t *group = NULL;
@@ -51,6 +76,24 @@ static esp_err_t gptimer_register_to_group(gptimer_t *timer)
5176
}
5277
}
5378
ESP_RETURN_ON_FALSE(timer_id != -1, ESP_ERR_NOT_FOUND, TAG, "no free timer");
79+
80+
#if GPTIMER_USE_RETENTION_LINK
81+
sleep_retention_module_t module = tg_timer_reg_retention_info[group->group_id][timer_id].module;
82+
sleep_retention_module_init_param_t init_param = {
83+
.cbs = {
84+
.create = {
85+
.handle = gptimer_create_sleep_retention_link_cb,
86+
.arg = (void *)timer
87+
},
88+
},
89+
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
90+
};
91+
if (sleep_retention_module_init(module, &init_param) != ESP_OK) {
92+
// even though the sleep retention module init failed, RMT driver should still work, so just warning here
93+
ESP_LOGW(TAG, "init sleep retention failed on TimerGroup%d Timer%d, power domain may be turned off during sleep", group->group_id, timer_id);
94+
}
95+
#endif // GPTIMER_USE_RETENTION_LINK
96+
5497
return ESP_OK;
5598
}
5699

@@ -61,6 +104,17 @@ static void gptimer_unregister_from_group(gptimer_t *timer)
61104
portENTER_CRITICAL(&group->spinlock);
62105
group->timers[timer_id] = NULL;
63106
portEXIT_CRITICAL(&group->spinlock);
107+
108+
#if GPTIMER_USE_RETENTION_LINK
109+
sleep_retention_module_t module = tg_timer_reg_retention_info[group->group_id][timer_id].module;
110+
if (sleep_retention_is_module_created(module)) {
111+
sleep_retention_module_free(module);
112+
}
113+
if (sleep_retention_is_module_inited(module)) {
114+
sleep_retention_module_deinit(module);
115+
}
116+
#endif
117+
64118
// timer has a reference on group, release it now
65119
gptimer_release_group_handle(group);
66120
}
@@ -109,7 +163,7 @@ esp_err_t gptimer_new_timer(const gptimer_config_t *config, gptimer_handle_t *re
109163

110164
if (allow_pd) {
111165
#if GPTIMER_USE_RETENTION_LINK
112-
gptimer_create_retention_module(group);
166+
gptimer_create_retention_module(timer);
113167
#endif // GPTIMER_USE_RETENTION_LINK
114168
}
115169

components/esp_driver_gptimer/src/gptimer_common.c

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,6 @@ typedef struct gptimer_platform_t {
2222
// gptimer driver platform, it's always a singleton
2323
static gptimer_platform_t s_platform;
2424

25-
#if GPTIMER_USE_RETENTION_LINK
26-
static esp_err_t gptimer_create_sleep_retention_link_cb(void *arg)
27-
{
28-
gptimer_group_t *group = (gptimer_group_t *)arg;
29-
int group_id = group->group_id;
30-
esp_err_t err = sleep_retention_entries_create(tg_timer_reg_retention_info[group_id].regdma_entry_array,
31-
tg_timer_reg_retention_info[group_id].array_size,
32-
REGDMA_LINK_PRI_GPTIMER, tg_timer_reg_retention_info[group_id].module);
33-
return err;
34-
}
35-
36-
void gptimer_create_retention_module(gptimer_group_t *group)
37-
{
38-
int group_id = group->group_id;
39-
sleep_retention_module_t module = tg_timer_reg_retention_info[group_id].module;
40-
_lock_acquire(&s_platform.mutex);
41-
if (sleep_retention_is_module_inited(module) && !sleep_retention_is_module_created(module)) {
42-
if (sleep_retention_module_allocate(module) != ESP_OK) {
43-
// even though the sleep retention module create failed, GPTimer driver should still work, so just warning here
44-
ESP_LOGW(TAG, "create retention link failed %d, power domain won't be turned off during sleep", group_id);
45-
}
46-
}
47-
_lock_release(&s_platform.mutex);
48-
}
49-
#endif // GPTIMER_USE_RETENTION_LINK
50-
5125
gptimer_group_t *gptimer_acquire_group_handle(int group_id)
5226
{
5327
bool new_group = false;
@@ -83,22 +57,6 @@ gptimer_group_t *gptimer_acquire_group_handle(int group_id)
8357
timer_ll_reset_register(group_id);
8458
}
8559
}
86-
#if GPTIMER_USE_RETENTION_LINK
87-
sleep_retention_module_t module = tg_timer_reg_retention_info[group_id].module;
88-
sleep_retention_module_init_param_t init_param = {
89-
.cbs = {
90-
.create = {
91-
.handle = gptimer_create_sleep_retention_link_cb,
92-
.arg = group
93-
},
94-
},
95-
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
96-
};
97-
if (sleep_retention_module_init(module, &init_param) != ESP_OK) {
98-
// even though the sleep retention module init failed, RMT driver should still work, so just warning here
99-
ESP_LOGW(TAG, "init sleep retention failed %d, power domain may be turned off during sleep", group_id);
100-
}
101-
#endif // GPTIMER_USE_RETENTION_LINK
10260
ESP_LOGD(TAG, "new group (%d) @%p", group_id, group);
10361
}
10462

@@ -126,15 +84,6 @@ void gptimer_release_group_handle(gptimer_group_t *group)
12684
timer_ll_enable_bus_clock(group_id, false);
12785
}
12886
}
129-
#if GPTIMER_USE_RETENTION_LINK
130-
sleep_retention_module_t module = tg_timer_reg_retention_info[group_id].module;
131-
if (sleep_retention_is_module_created(module)) {
132-
sleep_retention_module_free(module);
133-
}
134-
if (sleep_retention_is_module_inited(module)) {
135-
sleep_retention_module_deinit(module);
136-
}
137-
#endif
13887
free(group);
13988
ESP_LOGD(TAG, "del group (%d)", group_id);
14089
}

components/esp_driver_gptimer/src/gptimer_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ struct gptimer_t {
9898
gptimer_group_t *gptimer_acquire_group_handle(int group_id);
9999
void gptimer_release_group_handle(gptimer_group_t *group);
100100
esp_err_t gptimer_select_periph_clock(gptimer_t *timer, gptimer_clock_source_t src_clk, uint32_t resolution_hz);
101-
void gptimer_create_retention_module(gptimer_group_t *group);
102101

103102
#ifdef __cplusplus
104103
}

components/esp_hw_support/port/regdma_link.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ static void print_info_continuous_wrapper(FILE *out, void *link)
738738
{
739739
regdma_link_head_t head = REGDMA_LINK_HEAD(link);
740740
regdma_link_continuous_t *cons = __containerof(link, regdma_link_continuous_t, head);
741-
assert((cons->stat.module & (cons->stat.module - 1)) == 0);
742741
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:%p, backup start:%p, restore start:%p, buff_ptr:%p\n" LOG_RESET_COLOR,
743742
__builtin_ffs(cons->stat.module) - 1, cons->stat.id, link,
744743
s_link_mode_str[cons->head.mode], cons->head.length, s_boolean_str[cons->head.branch], s_boolean_str[cons->head.skip_r], s_boolean_str[cons->head.skip_b], s_boolean_str[cons->head.eof],
@@ -752,7 +751,6 @@ static void print_info_addr_map_wrapper(FILE *out, void *link)
752751
{
753752
regdma_link_head_t head = REGDMA_LINK_HEAD(link);
754753
regdma_link_addr_map_t *map = __containerof(link, regdma_link_addr_map_t, head);
755-
assert((map->stat.module & (map->stat.module - 1)) == 0);
756754
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:%p, backup start:%p, restore start:%p, buff_ptr:%p, map:{%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32"}\n" LOG_RESET_COLOR,
757755
__builtin_ffs(map->stat.module) - 1, map->stat.id, link,
758756
s_link_mode_str[map->head.mode], map->head.length, s_boolean_str[map->head.branch], s_boolean_str[map->head.skip_r], s_boolean_str[map->head.skip_b], s_boolean_str[map->head.eof],
@@ -776,11 +774,10 @@ static void print_info_branch_continuous_wrapper(FILE *out, void *link)
776774
{
777775
regdma_link_head_t head = REGDMA_LINK_HEAD(link);
778776
regdma_link_branch_continuous_t *cons = __containerof(link, regdma_link_branch_continuous_t, head);
779-
assert((cons->stat.module & (cons->stat.module - 1)) == 0);
780-
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:%p, backup start:%p, restore start:%p, buff_ptr:%p\n" LOG_RESET_COLOR,
777+
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:{%p, %p, %p, %p}, backup start:%p, restore start:%p, buff_ptr:%p\n" LOG_RESET_COLOR,
781778
__builtin_ffs(cons->stat.module) - 1, cons->stat.id, link,
782779
s_link_mode_str[cons->head.mode], cons->head.length, s_boolean_str[cons->head.branch], s_boolean_str[cons->head.skip_r], s_boolean_str[cons->head.skip_b], s_boolean_str[cons->head.eof],
783-
cons->body.next,
780+
cons->body.next[0], cons->body.next[1], cons->body.next[2], cons->body.next[3],
784781
cons->body.backup, cons->body.restore,
785782
cons->body.mem);
786783
print_info_link_data(out, (const uint32_t *)cons->body.mem, head.length);
@@ -790,11 +787,10 @@ static void print_info_branch_addr_map_wrapper(FILE *out, void *link)
790787
{
791788
regdma_link_head_t head = REGDMA_LINK_HEAD(link);
792789
regdma_link_branch_addr_map_t *map = __containerof(link, regdma_link_branch_addr_map_t, head);
793-
assert((map->stat.module & (map->stat.module - 1)) == 0);
794-
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:%p, backup start:%p, restore start:%p, buff_ptr:%p, map:{%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32"}\n" LOG_RESET_COLOR,
790+
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:{%p, %p, %p, %p}, backup start:%p, restore start:%p, buff_ptr:%p, map:{%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32"}\n" LOG_RESET_COLOR,
795791
__builtin_ffs(map->stat.module) - 1, map->stat.id, link,
796792
s_link_mode_str[map->head.mode], map->head.length, s_boolean_str[map->head.branch], s_boolean_str[map->head.skip_r], s_boolean_str[map->head.skip_b], s_boolean_str[map->head.eof],
797-
map->body.next,
793+
map->body.next[0], map->body.next[1], map->body.next[2], map->body.next[3],
798794
map->body.backup, map->body.restore,
799795
map->body.mem, map->body.map[0], map->body.map[1], map->body.map[2], map->body.map[3]);
800796
print_info_link_data(out, (const uint32_t *)map->body.mem, head.length);
@@ -803,10 +799,10 @@ static void print_info_branch_addr_map_wrapper(FILE *out, void *link)
803799
static void print_info_branch_write_wait_wrapper(FILE *out, void *link)
804800
{
805801
regdma_link_branch_write_wait_t *ww = __containerof(link, regdma_link_branch_write_wait_t, head);
806-
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:%p, backup start:%p, value:%"PRIx32", mask:%"PRIx32"\n" LOG_RESET_COLOR,
802+
fprintf(out, LOG_COLOR_I " [%02d/%04x] link_ptr:%p, head: {mode:%s len:%d branch:%s skip_r:%s skip_b:%s eof:%s}, next:{%p, %p, %p, %p}, backup start:%p, value:%"PRIx32", mask:%"PRIx32"\n" LOG_RESET_COLOR,
807803
__builtin_ffs(ww->stat.module) - 1, ww->stat.id, link,
808804
s_link_mode_str[ww->head.mode], ww->head.length, s_boolean_str[ww->head.branch], s_boolean_str[ww->head.skip_r], s_boolean_str[ww->head.skip_b], s_boolean_str[ww->head.eof],
809-
ww->body.next,
805+
ww->body.next[0], ww->body.next[1], ww->body.next[2], ww->body.next[3],
810806
ww->body.backup, ww->body.value, ww->body.mask);
811807
}
812808

components/esp_hw_support/sleep_system_peripheral.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ bool peripheral_domain_pd_allowed(void)
171171
mask.bitmap[SLEEP_RETENTION_MODULE_TG1_WDT >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG1_WDT % 32);
172172
#endif
173173
#if SOC_TIMER_SUPPORT_SLEEP_RETENTION
174-
mask.bitmap[SLEEP_RETENTION_MODULE_TG0_TIMER >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG0_TIMER % 32);
175-
mask.bitmap[SLEEP_RETENTION_MODULE_TG1_TIMER >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG1_TIMER % 32);
174+
mask.bitmap[SLEEP_RETENTION_MODULE_TG0_TIMER0 >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG0_TIMER0 % 32);
175+
mask.bitmap[SLEEP_RETENTION_MODULE_TG1_TIMER0 >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG1_TIMER0 % 32);
176+
#if (SOC_TIMER_GROUP_TIMERS_PER_GROUP > 1)
177+
mask.bitmap[SLEEP_RETENTION_MODULE_TG0_TIMER1 >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG0_TIMER1 % 32);
178+
mask.bitmap[SLEEP_RETENTION_MODULE_TG1_TIMER1 >> 5] |= BIT(SLEEP_RETENTION_MODULE_TG1_TIMER1 % 32);
179+
#endif
176180
#endif
177181

178182
#if SOC_ADC_SUPPORTED && !CONFIG_IDF_TARGET_ESP32P4 && !CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-11369

components/soc/esp32c5/include/soc/retention_periph_defs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ typedef enum periph_retention_module {
2525
/* Timer Group by target*/
2626
SLEEP_RETENTION_MODULE_TG0_WDT = 4,
2727
SLEEP_RETENTION_MODULE_TG1_WDT = 5,
28-
SLEEP_RETENTION_MODULE_TG0_TIMER = 6,
29-
SLEEP_RETENTION_MODULE_TG1_TIMER = 7,
28+
SLEEP_RETENTION_MODULE_TG0_TIMER0 = 6,
29+
SLEEP_RETENTION_MODULE_TG1_TIMER0 = 7,
3030
/* GDMA by channel */
3131
SLEEP_RETENTION_MODULE_GDMA_CH0 = 8,
3232
SLEEP_RETENTION_MODULE_GDMA_CH1 = 9,
@@ -64,8 +64,8 @@ typedef enum periph_retention_module {
6464
: ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \
6565
: ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \
6666
: ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \
67-
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \
68-
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \
67+
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER0) ? true \
68+
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER0) ? true \
6969
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \
7070
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \
7171
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH2) ? true \

components/soc/esp32c5/timer_periph.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,19 @@ const regdma_entries_config_t tg1_timer_regdma_entries[] = {
111111
},
112112
};
113113

114-
const tg_timer_reg_retention_info_t tg_timer_reg_retention_info[SOC_TIMER_GROUPS] = {
114+
const tg_timer_reg_retention_info_t tg_timer_reg_retention_info[SOC_TIMER_GROUPS][SOC_TIMER_GROUP_TIMERS_PER_GROUP] = {
115115
[0] = {
116-
.module = SLEEP_RETENTION_MODULE_TG0_TIMER,
117-
.regdma_entry_array = tg0_timer_regdma_entries,
118-
.array_size = ARRAY_SIZE(tg0_timer_regdma_entries)
116+
[0] = {
117+
.module = SLEEP_RETENTION_MODULE_TG0_TIMER0,
118+
.regdma_entry_array = tg0_timer_regdma_entries,
119+
.array_size = ARRAY_SIZE(tg0_timer_regdma_entries)
120+
}
119121
},
120122
[1] = {
121-
.module = SLEEP_RETENTION_MODULE_TG1_TIMER,
122-
.regdma_entry_array = tg1_timer_regdma_entries,
123-
.array_size = ARRAY_SIZE(tg1_timer_regdma_entries)
123+
[0] = {
124+
.module = SLEEP_RETENTION_MODULE_TG1_TIMER0,
125+
.regdma_entry_array = tg1_timer_regdma_entries,
126+
.array_size = ARRAY_SIZE(tg1_timer_regdma_entries)
127+
}
124128
},
125129
};

components/soc/esp32c6/include/soc/retention_periph_defs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ typedef enum periph_retention_module {
2525
/* Timer Group by target*/
2626
SLEEP_RETENTION_MODULE_TG0_WDT = 4,
2727
SLEEP_RETENTION_MODULE_TG1_WDT = 5,
28-
SLEEP_RETENTION_MODULE_TG0_TIMER = 6,
29-
SLEEP_RETENTION_MODULE_TG1_TIMER = 7,
28+
SLEEP_RETENTION_MODULE_TG0_TIMER0 = 6,
29+
SLEEP_RETENTION_MODULE_TG1_TIMER0 = 7,
3030
/* GDMA by channel */
3131
SLEEP_RETENTION_MODULE_GDMA_CH0 = 8,
3232
SLEEP_RETENTION_MODULE_GDMA_CH1 = 9,
@@ -64,8 +64,8 @@ typedef enum periph_retention_module {
6464
: ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \
6565
: ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \
6666
: ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \
67-
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \
68-
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \
67+
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER0) ? true \
68+
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER0) ? true \
6969
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \
7070
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \
7171
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH2) ? true \

components/soc/esp32c6/timer_periph.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,19 @@ const regdma_entries_config_t tg1_timer_regdma_entries[] = {
111111
},
112112
};
113113

114-
const tg_timer_reg_retention_info_t tg_timer_reg_retention_info[SOC_TIMER_GROUPS] = {
114+
const tg_timer_reg_retention_info_t tg_timer_reg_retention_info[SOC_TIMER_GROUPS][SOC_TIMER_GROUP_TIMERS_PER_GROUP] = {
115115
[0] = {
116-
.module = SLEEP_RETENTION_MODULE_TG0_TIMER,
117-
.regdma_entry_array = tg0_timer_regdma_entries,
118-
.array_size = ARRAY_SIZE(tg0_timer_regdma_entries)
116+
[0] = {
117+
.module = SLEEP_RETENTION_MODULE_TG0_TIMER0,
118+
.regdma_entry_array = tg0_timer_regdma_entries,
119+
.array_size = ARRAY_SIZE(tg0_timer_regdma_entries)
120+
}
119121
},
120122
[1] = {
121-
.module = SLEEP_RETENTION_MODULE_TG1_TIMER,
122-
.regdma_entry_array = tg1_timer_regdma_entries,
123-
.array_size = ARRAY_SIZE(tg1_timer_regdma_entries)
123+
[0] = {
124+
.module = SLEEP_RETENTION_MODULE_TG1_TIMER0,
125+
.regdma_entry_array = tg1_timer_regdma_entries,
126+
.array_size = ARRAY_SIZE(tg1_timer_regdma_entries)
127+
}
124128
},
125129
};

components/soc/esp32c61/include/soc/retention_periph_defs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ typedef enum periph_retention_module {
2525
/* Timer Group by target */
2626
SLEEP_RETENTION_MODULE_TG0_WDT = 4,
2727
SLEEP_RETENTION_MODULE_TG1_WDT = 5,
28-
SLEEP_RETENTION_MODULE_TG0_TIMER = 6,
29-
SLEEP_RETENTION_MODULE_TG1_TIMER = 7,
28+
SLEEP_RETENTION_MODULE_TG0_TIMER0 = 6,
29+
SLEEP_RETENTION_MODULE_TG1_TIMER0 = 7,
3030
/* GDMA by channel */
3131
SLEEP_RETENTION_MODULE_GDMA_CH0 = 8,
3232
SLEEP_RETENTION_MODULE_GDMA_CH1 = 9,
@@ -57,8 +57,8 @@ typedef enum periph_retention_module {
5757
: ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \
5858
: ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \
5959
: ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \
60-
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER) ? true \
61-
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER) ? true \
60+
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER0) ? true \
61+
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER0) ? true \
6262
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \
6363
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \
6464
: ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \

0 commit comments

Comments
 (0)