diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index ca9622c21c..0ec6861d82 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -54,6 +54,9 @@ if(NOT non_os_build) if(CONFIG_SOC_PAU_SUPPORTED) list(APPEND srcs "sleep_retention.c") endif() + if(CONFIG_SOC_MODEM_SUPPORT_ETM) + list(APPEND srcs "modem/modem_etm.c") + endif() if(CONFIG_SOC_LIGHT_SLEEP_SUPPORTED) list(APPEND srcs "sleep_modem.c" "sleep_modes.c" @@ -177,7 +180,7 @@ endif() set(public_include_dirs "include" "include/soc" "dma/include" "ldo/include" "debug_probe/include" "etm/include" "mspi_timing_tuning/include" "mspi_timing_tuning/tuning_scheme_impl/include" - "power_supply/include") + "power_supply/include" "modem/include") if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/include/soc/${target}") list(APPEND public_include_dirs diff --git a/components/esp_hw_support/modem/include/modem/modem_etm.h b/components/esp_hw_support/modem/include/modem/modem_etm.h index 517c706a9f..d6ebc7b37e 100644 --- a/components/esp_hw_support/modem/include/modem/modem_etm.h +++ b/components/esp_hw_support/modem/include/modem/modem_etm.h @@ -7,11 +7,15 @@ #pragma once #include +#include "esp_etm.h" +#include "soc/soc_caps.h" #ifdef __cplusplus extern "C" { #endif +#if SOC_MODEM_SUPPORT_ETM + /** * @brief Modem ETM event type * @@ -81,6 +85,8 @@ esp_err_t modem_new_etm_event(const modem_etm_event_config_t *config, esp_etm_ev */ esp_err_t modem_new_etm_task(const modem_etm_task_config_t *config, esp_etm_task_handle_t *out_task); +#endif /* SOC_MODEM_SUPPORT_ETM */ + #ifdef __cplusplus } #endif diff --git a/components/esp_hw_support/modem/modem_etm.c b/components/esp_hw_support/modem/modem_etm.c index 23c8952b38..083717d948 100644 --- a/components/esp_hw_support/modem/modem_etm.c +++ b/components/esp_hw_support/modem/modem_etm.c @@ -11,7 +11,7 @@ #include "esp_check.h" #include "esp_heap_caps.h" #include "modem/modem_etm.h" -#include "hal/modem_ll.h" +#include "hal/modem_etm_ll.h" #include "esp_private/etm_interface.h" #define ETM_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index 400d76c99e..035e132b26 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -267,6 +267,18 @@ config SOC_AHB_GDMA_SUPPORT_PSRAM bool default y +config SOC_ETM_GROUPS + int + default 1 + +config SOC_ETM_CHANNELS_PER_GROUP + int + default 50 + +config SOC_MODEM_SUPPORT_ETM + bool + default y + config SOC_GPIO_PORT int default 1 diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index 6d02341e93..7cf25e5666 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -185,6 +185,13 @@ #define SOC_GDMA_SUPPORT_SLEEP_RETENTION 1 #define SOC_AHB_GDMA_SUPPORT_PSRAM 1 +/*-------------------------- ETM CAPS --------------------------------------*/ +#define SOC_ETM_GROUPS 1U // Number of ETM groups +#define SOC_ETM_CHANNELS_PER_GROUP 50 // Number of ETM channels in the group + +/*-------------------------- MODEM CAPS --------------------------------------*/ +#define SOC_MODEM_SUPPORT_ETM 1 + /*-------------------------- GPIO CAPS ---------------------------------------*/ // ESP32-H4 has 1 GPIO peripheral #define SOC_GPIO_PORT 1U