From 3b43b63d47bb9c176c340d8d766fc88cda52f52c Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Wed, 28 Dec 2022 15:40:50 +0800 Subject: [PATCH] soc: add ieee8020154_only cap for esp32hx --- components/esp_hw_support/periph_ctrl.c | 4 +++- components/esp_phy/CMakeLists.txt | 2 +- components/soc/esp32h2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h2/include/soc/soc_caps.h | 1 + components/soc/esp32h4/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h4/include/soc/soc_caps.h | 1 + 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/esp_hw_support/periph_ctrl.c b/components/esp_hw_support/periph_ctrl.c index 2d15173e8f..fd01499631 100644 --- a/components/esp_hw_support/periph_ctrl.c +++ b/components/esp_hw_support/periph_ctrl.c @@ -46,7 +46,7 @@ void periph_module_reset(periph_module_t periph) portEXIT_CRITICAL_SAFE(&periph_spinlock); } -#if CONFIG_ESP32_WIFI_ENABLED +#if !SOC_IEEE802154_BLE_ONLY IRAM_ATTR void wifi_bt_common_module_enable(void) { #if SOC_MODEM_CLOCK_IS_INDEPENDENT @@ -74,7 +74,9 @@ IRAM_ATTR void wifi_bt_common_module_disable(void) portEXIT_CRITICAL_SAFE(&periph_spinlock); #endif } +#endif +#if CONFIG_ESP32_WIFI_ENABLED void wifi_module_enable(void) { #if SOC_MODEM_CLOCK_IS_INDEPENDENT diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 28b060f024..0a74f6f247 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -15,7 +15,7 @@ else() set(ldfragments "linker.lf") endif() -if(IDF_TARGET STREQUAL "esp32h4") +if(CONFIG_SOC_IEEE802154_BLE_ONLY) list(APPEND srcs "src/phy_init_esp32hxx.c") else() list(APPEND srcs "src/phy_init.c") diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index e4df424186..58be5ab21a 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -7,6 +7,10 @@ config SOC_IEEE802154_SUPPORTED bool default y +config SOC_IEEE802154_BLE_ONLY + bool + default y + config SOC_EFUSE_KEY_PURPOSE_FIELD bool default y diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index 40c064e800..562fdbbc81 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -33,6 +33,7 @@ // #define SOC_TWAI_SUPPORTED 1 // TODO: IDF-6217 // #define SOC_BT_SUPPORTED 1 // TODO: IDF-6416 #define SOC_IEEE802154_SUPPORTED 1 +#define SOC_IEEE802154_BLE_ONLY 1 // #define SOC_ASYNC_MEMCPY_SUPPORTED 1 // TODO: IDF-6238 // #define SOC_USB_SERIAL_JTAG_SUPPORTED 1 // TODO: IDF-6239 // #define SOC_TEMP_SENSOR_SUPPORTED 1 // TODO: IDF-6229 diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index efec18599b..6fba2353c0 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -27,6 +27,10 @@ config SOC_IEEE802154_SUPPORTED bool default y +config SOC_IEEE802154_BLE_ONLY + bool + default y + config SOC_ASYNC_MEMCPY_SUPPORTED bool default y diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index 1a745d54b0..da112d4597 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -39,6 +39,7 @@ #define SOC_TWAI_SUPPORTED 1 #define SOC_BT_SUPPORTED 1 #define SOC_IEEE802154_SUPPORTED 1 +#define SOC_IEEE802154_BLE_ONLY 1 #define SOC_ASYNC_MEMCPY_SUPPORTED 1 #define SOC_USB_SERIAL_JTAG_SUPPORTED 1 #define SOC_SUPPORTS_SECURE_DL_MODE 1