From 033b1ff7cebf3032069c5d472c9956bfa677d737 Mon Sep 17 00:00:00 2001 From: houhaiyan Date: Wed, 1 Apr 2026 15:56:13 +0800 Subject: [PATCH] feat(esp32p4): add H264 REGDMA link and sleep retention module --- components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c | 3 +++ components/soc/esp32p4/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32p4/include/soc/retention_periph_defs.h | 3 ++- components/soc/esp32p4/include/soc/soc_caps.h | 3 +++ components/soc/include/soc/regdma.h | 2 ++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c b/components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c index d4766efde53..a18a1749ae2 100644 --- a/components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c +++ b/components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c @@ -102,6 +102,9 @@ bool peripheral_domain_pd_allowed(void) // ESP32P4 supports LCDCAM sleep retention RETENTION_MODULE_BITMAP_SET(&mask, SLEEP_RETENTION_MODULE_LCDCAM); + // ESP32P4 supports H264 sleep retention + RETENTION_MODULE_BITMAP_SET(&mask, SLEEP_RETENTION_MODULE_H264); + const sleep_retention_module_bitmap_t peripheral_domain_inited_modules = sleep_retention_module_bitmap_and(inited_modules, mask); const sleep_retention_module_bitmap_t peripheral_domain_created_modules = sleep_retention_module_bitmap_and(created_modules, mask); return sleep_retention_module_bitmap_eq(peripheral_domain_inited_modules, peripheral_domain_created_modules); diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index 5d09e5d5acc..34a06d653c9 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1891,6 +1891,10 @@ config SOC_JPEG_ENCODE_SUPPORTED bool default y +config SOC_H264_ENCODER_SUPPORTED + bool + default y + config SOC_LCDCAM_CAM_SUPPORT_RGB_YUV_CONV bool default y diff --git a/components/soc/esp32p4/include/soc/retention_periph_defs.h b/components/soc/esp32p4/include/soc/retention_periph_defs.h index be3fb879cf4..0f77f989e18 100644 --- a/components/soc/esp32p4/include/soc/retention_periph_defs.h +++ b/components/soc/esp32p4/include/soc/retention_periph_defs.h @@ -63,6 +63,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_EMAC = 37, SLEEP_RETENTION_MODULE_JPEG = 38, SLEEP_RETENTION_MODULE_LCDCAM = 39, + SLEEP_RETENTION_MODULE_H264 = 40, /* PMU REGDMA clock icg */ SLEEP_RETENTION_MODULE_CLOCK_ICG = SOC_PM_RETENTION_MODULE_NUM - 2, @@ -70,7 +71,7 @@ typedef enum periph_retention_module { SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; -#define is_top_domain_module(m) (((m) <= SLEEP_RETENTION_MODULE_LCDCAM) || ((m) == SLEEP_RETENTION_MODULE_CLOCK_ICG)) +#define is_top_domain_module(m) (((m) <= SLEEP_RETENTION_MODULE_H264) || ((m) == SLEEP_RETENTION_MODULE_CLOCK_ICG)) #ifdef __cplusplus } diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index f2c44032650..d4fc1f531a1 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -723,6 +723,9 @@ #define SOC_JPEG_DECODE_SUPPORTED (1) #define SOC_JPEG_ENCODE_SUPPORTED (1) +/*--------------------------- H264 --------------------------------*/ +#define SOC_H264_ENCODER_SUPPORTED (1) + /*--------------------------- CAM ---------------------------------*/ #define SOC_LCDCAM_CAM_SUPPORT_RGB_YUV_CONV (1) diff --git a/components/soc/include/soc/regdma.h b/components/soc/include/soc/regdma.h index 3690c8e4f9c..f7e8e680c4b 100644 --- a/components/soc/include/soc/regdma.h +++ b/components/soc/include/soc/regdma.h @@ -68,6 +68,7 @@ extern "C" { #define REGDMA_EMAC_LINK(_pri) ((0x27 << 8) | _pri) #define REGDMA_JPEG_LINK(_pri) ((0x28 << 8) | _pri) #define REGDMA_LCDCAM_LINK(_pri) ((0x29 << 8) | _pri) +#define REGDMA_H264_LINK(_pri) ((0x2a << 8) | _pri) #define REGDMA_CLOCK_ICG_LINK(_pri) ((0xFE << 8) | _pri) #define REGDMA_MODEM_FE_LINK(_pri) ((0xFF << 8) | _pri) @@ -100,6 +101,7 @@ extern "C" { #define REGDMA_LINK_PRI_EMAC REGDMA_LINK_PRI_GENERAL_PERIPH #define REGDMA_LINK_PRI_JPEG REGDMA_LINK_PRI_GENERAL_PERIPH #define REGDMA_LINK_PRI_LCDCAM REGDMA_LINK_PRI_GENERAL_PERIPH +#define REGDMA_LINK_PRI_H264 REGDMA_LINK_PRI_GENERAL_PERIPH typedef enum { REGDMA_LINK_PRI_0 = 0,