From 6d3b78a8e1977c42ef60b496eff2b2948f702c1d 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 | 2 ++ components/soc/esp32p4/include/soc/soc_caps.h | 3 +++ components/soc/include/soc/regdma.h | 2 ++ 5 files changed, 14 insertions(+) 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 d2971cd46c8..8e469726067 100644 --- a/components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c +++ b/components/esp_hw_support/port/esp32p4/peripheral_domain_pd.c @@ -101,6 +101,9 @@ bool peripheral_domain_pd_allowed(void) // ESP32P4 supports JPEG sleep retention RETENTION_MODULE_BITMAP_SET(&mask, SLEEP_RETENTION_MODULE_JPEG); + // 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 bdac2e746c8..77ccb24266c 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1943,6 +1943,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 48602819ae5..6d59232ee79 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, SLEEP_RETENTION_MODULE_MAX = SOC_PM_RETENTION_MODULE_NUM - 1 } periph_retention_module_t; @@ -107,6 +108,7 @@ typedef enum periph_retention_module { : ((m) == SLEEP_RETENTION_MODULE_SDM0) ? true \ : ((m) == SLEEP_RETENTION_MODULE_LCDCAM) ? true \ : ((m) == SLEEP_RETENTION_MODULE_JPEG) ? true \ + : ((m) == SLEEP_RETENTION_MODULE_H264) ? true \ : false) #ifdef __cplusplus diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index e4543793f28..ff42fc991f1 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -746,6 +746,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 e5ab680c1d7..2e6c932c1ac 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_MODEM_FE_LINK(_pri) ((0xFF << 8) | _pri) @@ -98,6 +99,7 @@ extern "C" { #define REGDMA_LINK_PRI_EMAC REGDMA_LINK_PRI_GENERAL_PERIPH #define REGDMA_LINK_PRI_LCDCAM REGDMA_LINK_PRI_GENERAL_PERIPH #define REGDMA_LINK_PRI_JPEG REGDMA_LINK_PRI_GENERAL_PERIPH +#define REGDMA_LINK_PRI_H264 REGDMA_LINK_PRI_GENERAL_PERIPH typedef enum { REGDMA_LINK_PRI_0 = 0,