Skip to content

Commit ee9c1ae

Browse files
committed
feat(soc): add esp32h4 PAU initial support
1 parent 5d8e56b commit ee9c1ae

File tree

5 files changed

+111
-3
lines changed

5 files changed

+111
-3
lines changed

components/soc/esp32h4/include/soc/Kconfig.soc_caps.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ config SOC_MODEM_CLOCK_SUPPORTED
4343
bool
4444
default y
4545

46+
config SOC_PAU_SUPPORTED
47+
bool
48+
default y
49+
4650
config SOC_WDT_SUPPORTED
4751
bool
4852
default y
@@ -531,6 +535,14 @@ config SOC_PM_PAU_LINK_NUM
531535
int
532536
default 4
533537

538+
config SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE
539+
bool
540+
default y
541+
542+
config SOC_PM_RETENTION_MODULE_NUM
543+
int
544+
default 32
545+
534546
config SOC_MODEM_CLOCK_IS_INDEPENDENT
535547
bool
536548
default y
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
#include <stdint.h>
10+
#include "soc_caps.h"
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
typedef enum periph_retention_module {
17+
SLEEP_RETENTION_MODULE_MIN = 0,
18+
SLEEP_RETENTION_MODULE_NULL = SLEEP_RETENTION_MODULE_MIN, /* This module is for all peripherals that can't survive from PD_TOP to call init only. Shouldn't have any dependency. */
19+
/* clock module, which includes system and modem */
20+
SLEEP_RETENTION_MODULE_CLOCK_SYSTEM = 1,
21+
SLEEP_RETENTION_MODULE_CLOCK_MODEM = 2,
22+
/* digital peripheral module, which includes Interrupt Matrix, HP_SYSTEM,
23+
* TEE, APM, UART, IOMUX, SPIMEM, SysTimer, etc.. */
24+
SLEEP_RETENTION_MODULE_SYS_PERIPH = 3,
25+
/* Timer Group by target*/
26+
SLEEP_RETENTION_MODULE_TG0_WDT = 4,
27+
SLEEP_RETENTION_MODULE_TG1_WDT = 5,
28+
SLEEP_RETENTION_MODULE_TG0_TIMER0 = 6,
29+
SLEEP_RETENTION_MODULE_TG1_TIMER0 = 7,
30+
/* GDMA by channel */
31+
SLEEP_RETENTION_MODULE_GDMA_CH0 = 8,
32+
SLEEP_RETENTION_MODULE_GDMA_CH1 = 9,
33+
SLEEP_RETENTION_MODULE_GDMA_CH2 = 10,
34+
SLEEP_RETENTION_MODULE_GDMA_CH3 = 11,
35+
SLEEP_RETENTION_MODULE_GDMA_CH4 = 12,
36+
/* MISC Peripherals */
37+
SLEEP_RETENTION_MODULE_ADC = 13,
38+
SLEEP_RETENTION_MODULE_I2C0 = 14,
39+
SLEEP_RETENTION_MODULE_I2C1 = 15,
40+
SLEEP_RETENTION_MODULE_RMT0 = 16,
41+
SLEEP_RETENTION_MODULE_UART0 = 17,
42+
SLEEP_RETENTION_MODULE_UART1 = 18,
43+
SLEEP_RETENTION_MODULE_I2S0 = 19,
44+
SLEEP_RETENTION_MODULE_ETM0 = 20,
45+
SLEEP_RETENTION_MODULE_TEMP_SENSOR = 21,
46+
SLEEP_RETENTION_MODULE_TWAI0 = 22,
47+
SLEEP_RETENTION_MODULE_PARLIO0 = 23,
48+
SLEEP_RETENTION_MODULE_GPSPI2 = 24,
49+
SLEEP_RETENTION_MODULE_LEDC = 25,
50+
SLEEP_RETENTION_MODULE_PCNT0 = 26,
51+
SLEEP_RETENTION_MODULE_MCPWM0 = 27,
52+
53+
/* Modem module, which includes BLE and 802.15.4 */
54+
SLEEP_RETENTION_MODULE_BLE_MAC = 28,
55+
SLEEP_RETENTION_MODULE_BT_BB = 29,
56+
SLEEP_RETENTION_MODULE_802154_MAC = 30,
57+
58+
SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1
59+
} periph_retention_module_t;
60+
61+
#define is_top_domain_module(m) \
62+
( ((m) == SLEEP_RETENTION_MODULE_NULL) ? true \
63+
: ((m) == SLEEP_RETENTION_MODULE_CLOCK_SYSTEM) ? true \
64+
: ((m) == SLEEP_RETENTION_MODULE_SYS_PERIPH) ? true \
65+
: ((m) == SLEEP_RETENTION_MODULE_TG0_WDT) ? true \
66+
: ((m) == SLEEP_RETENTION_MODULE_TG1_WDT) ? true \
67+
: ((m) == SLEEP_RETENTION_MODULE_TG0_TIMER0) ? true \
68+
: ((m) == SLEEP_RETENTION_MODULE_TG1_TIMER0) ? true \
69+
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH0) ? true \
70+
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH1) ? true \
71+
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH2) ? true \
72+
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH3) ? true \
73+
: ((m) == SLEEP_RETENTION_MODULE_GDMA_CH4) ? true \
74+
: ((m) == SLEEP_RETENTION_MODULE_ADC) ? true \
75+
: ((m) == SLEEP_RETENTION_MODULE_I2C0) ? true \
76+
: ((m) == SLEEP_RETENTION_MODULE_I2C1) ? true \
77+
: ((m) == SLEEP_RETENTION_MODULE_RMT0) ? true \
78+
: ((m) == SLEEP_RETENTION_MODULE_UART0) ? true \
79+
: ((m) == SLEEP_RETENTION_MODULE_UART1) ? true \
80+
: ((m) == SLEEP_RETENTION_MODULE_I2S0) ? true \
81+
: ((m) == SLEEP_RETENTION_MODULE_ETM0) ? true \
82+
: ((m) == SLEEP_RETENTION_MODULE_TEMP_SENSOR) ? true \
83+
: ((m) == SLEEP_RETENTION_MODULE_TWAI0) ? true \
84+
: ((m) == SLEEP_RETENTION_MODULE_PARLIO0) ? true \
85+
: ((m) == SLEEP_RETENTION_MODULE_GPSPI2) ? true \
86+
: ((m) == SLEEP_RETENTION_MODULE_LEDC) ? true \
87+
: ((m) == SLEEP_RETENTION_MODULE_PCNT0) ? true \
88+
: ((m) == SLEEP_RETENTION_MODULE_MCPWM0) ? true \
89+
: false)
90+
91+
#ifdef __cplusplus
92+
}
93+
#endif

components/soc/esp32h4/include/soc/soc_caps.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
// #define SOC_BOD_SUPPORTED 1 // TODO: [ESP32H4] IDF-12295
7070
// #define SOC_APM_SUPPORTED 1 // TODO: [ESP32H4] IDF-12256
7171
// #define SOC_PMU_SUPPORTED 1 // TODO: [ESP32H4] IDF-12286
72-
// #define SOC_PAU_SUPPORTED 1
72+
#define SOC_PAU_SUPPORTED 1
7373
// #define SOC_LP_TIMER_SUPPORTED 1 // TODO: [ESP32H4] IDF-12274
7474
// #define SOC_LP_AON_SUPPORTED 1
7575
// #define SOC_LP_PERIPHERALS_SUPPORTED 1
@@ -531,7 +531,9 @@
531531
// #define SOC_PM_MODEM_RETENTION_BY_REGDMA (1)
532532
// #define SOC_PM_RETENTION_HAS_CLOCK_BUG (1)
533533

534-
#define SOC_PM_PAU_LINK_NUM (4)
534+
#define SOC_PM_PAU_LINK_NUM (4)
535+
#define SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE (1)
536+
#define SOC_PM_RETENTION_MODULE_NUM (32)
535537

536538
/*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/
537539
// #define SOC_CLK_RC_FAST_SUPPORT_CALIBRATION (1) // TODO: [ESP32H4] IDF-12285

components/soc/esp32h4/wdt_periph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "soc/wdt_periph.h"
88
#include "soc/soc_caps.h"
99

10-
#if SOC_PAU_SUPPORTED
10+
#if SOC_PAU_SUPPORTED && SOC_MWDT_SUPPORT_SLEEP_RETENTION
1111

1212
#define N_REGS_TGWDT 6 // TIMG_WDTCONFIG0_REG ... TIMG_WDTCONFIG5_REG & TIMG_INT_ENA_TIMERS_REG
1313

components/soc/include/soc/regdma.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ extern "C" {
4848
#define REGDMA_MODEM_BT_BB_LINK(_pri) ((0x15 << 8) | _pri)
4949
#define REGDMA_MODEM_IEEE802154_LINK(_pri) ((0x16 << 8) | _pri)
5050
#define REGDMA_GDMA_LINK(_pri) ((0x17 << 8) | _pri)
51+
#define REGDMA_AHB_DMA_LINK(_pri) ((0x17 << 8) | _pri)
5152
#define REGDMA_I2C_LINK(_pri) ((0x18 << 8) | _pri)
5253
#define REGDMA_RMT_LINK(_pri) ((0x19 << 8) | _pri)
5354
#define REGDMA_TG0_WDT_LINK(_pri) ((0x1A << 8) | _pri)

0 commit comments

Comments
 (0)