From 01876d975552fbecc37cfd46518adae4e84b19cc Mon Sep 17 00:00:00 2001 From: cjin Date: Mon, 6 Jul 2026 15:58:58 +0800 Subject: [PATCH] feat(modem_clock): separate bt sec apb clock and add to bt apb module --- .../modem/port/esp32c5/modem_clock_impl.c | 6 ++++- .../modem/port/esp32c6/modem_clock_impl.c | 16 +++++++++++++ .../modem/port/esp32c61/modem_clock_impl.c | 6 ++++- .../modem/port/esp32h2/modem_clock_impl.c | 16 +++++++++++++ .../modem/port/esp32h21/modem_clock_impl.c | 16 +++++++++++++ .../modem/port/esp32h4/modem_clock_impl.c | 13 ---------- .../modem/port/esp32s31/modem_clock_impl.c | 19 ++------------- .../hal/esp32c5/include/hal/modem_syscon_ll.h | 18 ++++++++++---- .../hal/esp32c6/include/hal/modem_syscon_ll.h | 18 ++++++++++---- .../esp32c61/include/hal/modem_syscon_ll.h | 18 ++++++++++---- .../hal/esp32h2/include/hal/modem_syscon_ll.h | 24 +++++++++++++------ .../esp32h21/include/hal/modem_syscon_ll.h | 22 ++++++++++++----- 12 files changed, 135 insertions(+), 57 deletions(-) diff --git a/components/esp_hw_support/modem/port/esp32c5/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32c5/modem_clock_impl.c index b4771eb72d3..918cf3afe48 100644 --- a/components/esp_hw_support/modem/port/esp32c5/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32c5/modem_clock_impl.c @@ -93,12 +93,16 @@ static esp_err_t IRAM_ATTR modem_clock_ble_mac_check_enable(modem_clock_context_ static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); + modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); } #if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) { - return modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL; + bool all_clock_enabled = true; + all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); + all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); + return all_clock_enabled ? ESP_OK : ESP_FAIL; } #endif diff --git a/components/esp_hw_support/modem/port/esp32c6/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32c6/modem_clock_impl.c index 33296a2012e..b3ca8c8ca21 100644 --- a/components/esp_hw_support/modem/port/esp32c6/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32c6/modem_clock_impl.c @@ -95,6 +95,22 @@ static esp_err_t IRAM_ATTR modem_clock_ble_mac_check_enable(modem_clock_context_ #endif static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) +{ + modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); + modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); +} + +#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING +static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) +{ + bool all_clock_enabled = true; + all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); + all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); + return all_clock_enabled ? ESP_OK : ESP_FAIL; +} +#endif + +static void IRAM_ATTR modem_clock_ble_i154_bb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); } diff --git a/components/esp_hw_support/modem/port/esp32c61/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32c61/modem_clock_impl.c index b83a9183fdf..e57b18ace89 100644 --- a/components/esp_hw_support/modem/port/esp32c61/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32c61/modem_clock_impl.c @@ -91,12 +91,16 @@ static esp_err_t IRAM_ATTR modem_clock_ble_mac_check_enable(modem_clock_context_ static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); + modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); } #if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) { - return modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL; + bool all_clock_enabled = true; + all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); + all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); + return all_clock_enabled ? ESP_OK : ESP_FAIL; } #endif diff --git a/components/esp_hw_support/modem/port/esp32h2/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32h2/modem_clock_impl.c index 93aa785f561..8fb89c98c29 100644 --- a/components/esp_hw_support/modem/port/esp32h2/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32h2/modem_clock_impl.c @@ -63,6 +63,22 @@ static esp_err_t IRAM_ATTR modem_clock_ble_mac_check_enable(modem_clock_context_ #endif static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) +{ + modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); + modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); +} + +#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING +static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) +{ + bool all_clock_enabled = true; + all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); + all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); + return all_clock_enabled ? ESP_OK : ESP_FAIL; +} +#endif + +static void IRAM_ATTR modem_clock_ble_i154_bb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); } diff --git a/components/esp_hw_support/modem/port/esp32h21/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32h21/modem_clock_impl.c index d4a3c6e2c87..2685469e34b 100644 --- a/components/esp_hw_support/modem/port/esp32h21/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32h21/modem_clock_impl.c @@ -65,6 +65,22 @@ static esp_err_t IRAM_ATTR modem_clock_ble_mac_check_enable(modem_clock_context_ #endif static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) +{ + modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); + modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); +} + +#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING +static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) +{ + bool all_clock_enabled = true; + all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); + all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); + return all_clock_enabled ? ESP_OK : ESP_FAIL; +} +#endif + +static void IRAM_ATTR modem_clock_ble_i154_bb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); } diff --git a/components/esp_hw_support/modem/port/esp32h4/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32h4/modem_clock_impl.c index a5e124f77e4..a8d9f18a8bb 100644 --- a/components/esp_hw_support/modem/port/esp32h4/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32h4/modem_clock_impl.c @@ -77,23 +77,16 @@ static esp_err_t IRAM_ATTR modem_clock_bt_peripheral_check_enable(modem_clock_co static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); -<<<<<<< HEAD modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); -======= ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) } #if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) { -<<<<<<< HEAD bool all_clock_enabled = true; all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); return all_clock_enabled ? ESP_OK : ESP_FAIL; -======= - return modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL; ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) } #endif @@ -208,10 +201,7 @@ static void IRAM_ATTR modem_clock_configure_impl(modem_clock_context_t *ctx, int : (dev_id == MODEM_CLOCK_I2C_MASTER) ? modem_clock_i2c_master_configure : (dev_id == MODEM_CLOCK_ETM) ? modem_clock_etm_configure : (dev_id == MODEM_CLOCK_BLE_MAC) ? modem_clock_ble_mac_configure -<<<<<<< HEAD : (dev_id == MODEM_CLOCK_BT_PERIPHERAL) ? modem_clock_bt_peripheral_configure -======= ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) : (dev_id == MODEM_CLOCK_BT_APB) ? modem_clock_bt_apb_configure : (dev_id == MODEM_CLOCK_BT_I154_COMMON_BB) ? modem_clock_ble_i154_bb_configure : (dev_id == MODEM_CLOCK_802154_MAC) ? modem_clock_ieee802154_mac_configure @@ -233,10 +223,7 @@ static esp_err_t IRAM_ATTR modem_clock_check_impl(modem_clock_context_t *ctx, in : (dev_id == MODEM_CLOCK_I2C_MASTER) ? modem_clock_i2c_master_check_enable : (dev_id == MODEM_CLOCK_ETM) ? modem_clock_etm_check_enable : (dev_id == MODEM_CLOCK_BLE_MAC) ? modem_clock_ble_mac_check_enable -<<<<<<< HEAD : (dev_id == MODEM_CLOCK_BT_PERIPHERAL) ? modem_clock_bt_peripheral_check_enable -======= ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) : (dev_id == MODEM_CLOCK_BT_APB) ? modem_clock_bt_apb_check_enable : (dev_id == MODEM_CLOCK_BT_I154_COMMON_BB) ? modem_clock_ble_i154_bb_check_enable : (dev_id == MODEM_CLOCK_802154_MAC) ? modem_clock_ieee802154_mac_check_enable diff --git a/components/esp_hw_support/modem/port/esp32s31/modem_clock_impl.c b/components/esp_hw_support/modem/port/esp32s31/modem_clock_impl.c index b755935d8e1..01692407f8d 100644 --- a/components/esp_hw_support/modem/port/esp32s31/modem_clock_impl.c +++ b/components/esp_hw_support/modem/port/esp32s31/modem_clock_impl.c @@ -12,13 +12,8 @@ /* Clock dependency definitions */ #define WIFI_CLOCK_DEPS ( MODEM_CLOCKS( WIFI_MAC, WIFI_APB, WIFI_BB, WIFI_BB_44M, COEXIST, WIFI_BB_80X1, SOC_PLL_SOURCE_CG ) ) -<<<<<<< HEAD -#define BLE_CLOCK_DEPS ( MODEM_CLOCKS( BLE_MAC, BT_I154_COMMON_BB, ETM, COEXIST, WIFI_BB_80X1, SOC_PLL_SOURCE_CG, BT_APB, BT_PERIPHERAL ) ) -#define BT_APB_CLOCK_DEPS ( MODEM_CLOCKS( BT_APB, ETM, SOC_PLL_SOURCE_CG, BLE_MAC ) ) -======= -#define BLE_CLOCK_DEPS ( MODEM_CLOCKS( BLE_MAC, BT_I154_COMMON_BB, ETM, COEXIST, WIFI_BB_80X1, SOC_PLL_SOURCE_CG, BT_APB ) ) -#define BT_APB_CLOCK_DEPS ( MODEM_CLOCKS( BT_APB, ETM ) ) ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) +#define BLE_CLOCK_DEPS ( MODEM_CLOCKS( BT_MAC, BT_I154_COMMON_BB, ETM, COEXIST, WIFI_BB_80X1, SOC_PLL_SOURCE_CG, BT_APB, BT_PERIPHERAL ) ) +#define BT_APB_CLOCK_DEPS ( MODEM_CLOCKS( BT_APB, ETM, SOC_PLL_SOURCE_CG, BT_MAC ) ) #define IEEE802154_CLOCK_DEPS ( MODEM_CLOCKS( 802154_MAC, BT_I154_COMMON_BB, ETM, COEXIST, WIFI_BB_80X1, SOC_PLL_SOURCE_CG, BT_APB ) ) #define COEXIST_CLOCK_DEPS ( MODEM_CLOCKS( COEXIST, SOC_PLL_SOURCE_CG ) ) #define I2C_ANA_MST_CLOCK_DEPS ( MODEM_CLOCKS( I2C_MASTER ) ) @@ -136,23 +131,16 @@ static esp_err_t IRAM_ATTR modem_clock_bt_peripheral_check_enable(modem_clock_co static void IRAM_ATTR modem_clock_bt_apb_configure(modem_clock_context_t *ctx, bool enable) { modem_syscon_ll_enable_bt_apb_clock(ctx->hal->syscon_dev, enable); -<<<<<<< HEAD modem_syscon_ll_enable_modem_sec_apb_clock(ctx->hal->syscon_dev, enable); -======= ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) } #if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING static esp_err_t IRAM_ATTR modem_clock_bt_apb_check_enable(modem_clock_context_t *ctx) { -<<<<<<< HEAD bool all_clock_enabled = true; all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev); all_clock_enabled &= modem_syscon_ll_modem_sec_apb_clock_is_enabled(ctx->hal->syscon_dev); return all_clock_enabled ? ESP_OK : ESP_FAIL; -======= - return modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL; ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) } #endif @@ -355,10 +343,7 @@ static esp_err_t IRAM_ATTR modem_clock_check_impl(modem_clock_context_t *ctx, in : (dev_id == MODEM_CLOCK_WIFI_BB_80X1) ? modem_clock_wifi_bb_80x1_check_enable : (dev_id == MODEM_CLOCK_ETM) ? modem_clock_etm_check_enable : (dev_id == MODEM_CLOCK_BLE_MAC) ? modem_clock_ble_mac_check_enable -<<<<<<< HEAD : (dev_id == MODEM_CLOCK_BT_PERIPHERAL) ? modem_clock_bt_peripheral_check_enable -======= ->>>>>>> 68d10a4931e (feat(modem_clock): added bt_apb module and separete bt_apb from bt_mac module) : (dev_id == MODEM_CLOCK_BT_APB) ? modem_clock_bt_apb_check_enable : (dev_id == MODEM_CLOCK_BT_I154_COMMON_BB) ? modem_clock_ble_i154_bb_check_enable : (dev_id == MODEM_CLOCK_802154_MAC) ? modem_clock_ieee802154_mac_check_enable diff --git a/components/hal/esp32c5/include/hal/modem_syscon_ll.h b/components/hal/esp32c5/include/hal/modem_syscon_ll.h index cb1f4a19bb2..531a151d4d4 100644 --- a/components/hal/esp32c5/include/hal/modem_syscon_ll.h +++ b/components/hal/esp32c5/include/hal/modem_syscon_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -123,7 +123,6 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw hw->clk_conf.clk_modem_sec_ecb_en = en; hw->clk_conf.clk_modem_sec_ccm_en = en; hw->clk_conf.clk_modem_sec_bah_en = en; - hw->clk_conf.clk_modem_sec_apb_en = en; } __attribute__((always_inline)) @@ -132,8 +131,19 @@ static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t return hw->clk_conf.clk_modem_sec_en && hw->clk_conf.clk_modem_sec_ecb_en && hw->clk_conf.clk_modem_sec_ccm_en && - hw->clk_conf.clk_modem_sec_bah_en && - hw->clk_conf.clk_modem_sec_apb_en; + hw->clk_conf.clk_modem_sec_bah_en; +} + +__attribute__((always_inline)) +static inline void modem_syscon_ll_enable_modem_sec_apb_clock(modem_syscon_dev_t *hw, bool en) +{ + hw->clk_conf.clk_modem_sec_apb_en = en; +} + +__attribute__((always_inline)) +static inline bool modem_syscon_ll_modem_sec_apb_clock_is_enabled(modem_syscon_dev_t *hw) +{ + return hw->clk_conf.clk_modem_sec_apb_en; } __attribute__((always_inline)) diff --git a/components/hal/esp32c6/include/hal/modem_syscon_ll.h b/components/hal/esp32c6/include/hal/modem_syscon_ll.h index f65bf6d4ce1..5cef1320277 100644 --- a/components/hal/esp32c6/include/hal/modem_syscon_ll.h +++ b/components/hal/esp32c6/include/hal/modem_syscon_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -80,7 +80,6 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw hw->clk_conf.clk_modem_sec_ecb_en = en; hw->clk_conf.clk_modem_sec_ccm_en = en; hw->clk_conf.clk_modem_sec_bah_en = en; - hw->clk_conf.clk_modem_sec_apb_en = en; } __attribute__((always_inline)) @@ -89,8 +88,19 @@ static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t return hw->clk_conf.clk_modem_sec_en && hw->clk_conf.clk_modem_sec_ecb_en && hw->clk_conf.clk_modem_sec_ccm_en && - hw->clk_conf.clk_modem_sec_bah_en && - hw->clk_conf.clk_modem_sec_apb_en; + hw->clk_conf.clk_modem_sec_bah_en; +} + +__attribute__((always_inline)) +static inline void modem_syscon_ll_enable_modem_sec_apb_clock(modem_syscon_dev_t *hw, bool en) +{ + hw->clk_conf.clk_modem_sec_apb_en = en; +} + +__attribute__((always_inline)) +static inline bool modem_syscon_ll_modem_sec_apb_clock_is_enabled(modem_syscon_dev_t *hw) +{ + return hw->clk_conf.clk_modem_sec_apb_en; } __attribute__((always_inline)) diff --git a/components/hal/esp32c61/include/hal/modem_syscon_ll.h b/components/hal/esp32c61/include/hal/modem_syscon_ll.h index 6ea24801ea7..bb50c483d92 100644 --- a/components/hal/esp32c61/include/hal/modem_syscon_ll.h +++ b/components/hal/esp32c61/include/hal/modem_syscon_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -123,7 +123,6 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw hw->clk_conf.clk_modem_sec_ecb_en = en; hw->clk_conf.clk_modem_sec_ccm_en = en; hw->clk_conf.clk_modem_sec_bah_en = en; - hw->clk_conf.clk_modem_sec_apb_en = en; } __attribute__((always_inline)) @@ -132,8 +131,19 @@ static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t return hw->clk_conf.clk_modem_sec_en && hw->clk_conf.clk_modem_sec_ecb_en && hw->clk_conf.clk_modem_sec_ccm_en && - hw->clk_conf.clk_modem_sec_bah_en && - hw->clk_conf.clk_modem_sec_apb_en; + hw->clk_conf.clk_modem_sec_bah_en; +} + +__attribute__((always_inline)) +static inline void modem_syscon_ll_enable_modem_sec_apb_clock(modem_syscon_dev_t *hw, bool en) +{ + hw->clk_conf.clk_modem_sec_apb_en = en; +} + +__attribute__((always_inline)) +static inline bool modem_syscon_ll_modem_sec_apb_clock_is_enabled(modem_syscon_dev_t *hw) +{ + return hw->clk_conf.clk_modem_sec_apb_en; } __attribute__((always_inline)) diff --git a/components/hal/esp32h2/include/hal/modem_syscon_ll.h b/components/hal/esp32h2/include/hal/modem_syscon_ll.h index d40b7380bd7..a5a860a8ef8 100644 --- a/components/hal/esp32h2/include/hal/modem_syscon_ll.h +++ b/components/hal/esp32h2/include/hal/modem_syscon_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -87,17 +87,27 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw hw->clk_conf.clk_modem_sec_ecb_en = en; hw->clk_conf.clk_modem_sec_ccm_en = en; hw->clk_conf.clk_modem_sec_bah_en = en; - hw->clk_conf.clk_modem_sec_apb_en = en; } __attribute__((always_inline)) static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw) { - return hw->clk_conf.clk_modem_sec_en && - hw->clk_conf.clk_modem_sec_ecb_en && - hw->clk_conf.clk_modem_sec_ccm_en && - hw->clk_conf.clk_modem_sec_bah_en && - hw->clk_conf.clk_modem_sec_apb_en; + return hw->clk_conf.clk_modem_sec_en && + hw->clk_conf.clk_modem_sec_ecb_en && + hw->clk_conf.clk_modem_sec_ccm_en && + hw->clk_conf.clk_modem_sec_bah_en; +} + +__attribute__((always_inline)) +static inline void modem_syscon_ll_enable_modem_sec_apb_clock(modem_syscon_dev_t *hw, bool en) +{ + hw->clk_conf.clk_modem_sec_apb_en = en; +} + +__attribute__((always_inline)) +static inline bool modem_syscon_ll_modem_sec_apb_clock_is_enabled(modem_syscon_dev_t *hw) +{ + return hw->clk_conf.clk_modem_sec_apb_en; } __attribute__((always_inline)) diff --git a/components/hal/esp32h21/include/hal/modem_syscon_ll.h b/components/hal/esp32h21/include/hal/modem_syscon_ll.h index 3e81d227516..9ae7d98c09b 100644 --- a/components/hal/esp32h21/include/hal/modem_syscon_ll.h +++ b/components/hal/esp32h21/include/hal/modem_syscon_ll.h @@ -100,17 +100,27 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw hw->clk_conf.clk_modem_sec_ecb_en = en; hw->clk_conf.clk_modem_sec_ccm_en = en; hw->clk_conf.clk_modem_sec_bah_en = en; - hw->clk_conf.clk_modem_sec_apb_en = en; } __attribute__((always_inline)) static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw) { - return hw->clk_conf.clk_modem_sec_en && - hw->clk_conf.clk_modem_sec_ecb_en && - hw->clk_conf.clk_modem_sec_ccm_en && - hw->clk_conf.clk_modem_sec_bah_en && - hw->clk_conf.clk_modem_sec_apb_en; + return hw->clk_conf.clk_modem_sec_en && + hw->clk_conf.clk_modem_sec_ecb_en && + hw->clk_conf.clk_modem_sec_ccm_en && + hw->clk_conf.clk_modem_sec_bah_en; +} + +__attribute__((always_inline)) +static inline void modem_syscon_ll_enable_modem_sec_apb_clock(modem_syscon_dev_t *hw, bool en) +{ + hw->clk_conf.clk_modem_sec_apb_en = en; +} + +__attribute__((always_inline)) +static inline bool modem_syscon_ll_modem_sec_apb_clock_is_enabled(modem_syscon_dev_t *hw) +{ + return hw->clk_conf.clk_modem_sec_apb_en; } __attribute__((always_inline))