mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
hw_support: move periph_ctrl from driver to hw_support
This commit is contained in:
@@ -6,7 +6,6 @@ set(srcs
|
|||||||
"i2c.c"
|
"i2c.c"
|
||||||
"ledc.c"
|
"ledc.c"
|
||||||
"legacy_new_driver_coexist.c"
|
"legacy_new_driver_coexist.c"
|
||||||
"periph_ctrl.c"
|
|
||||||
"rtc_io.c"
|
"rtc_io.c"
|
||||||
"rtc_module.c"
|
"rtc_module.c"
|
||||||
"sdspi_crc.c"
|
"sdspi_crc.c"
|
||||||
|
@@ -90,6 +90,7 @@ menu "Driver configurations"
|
|||||||
config TWAI_ISR_IN_IRAM
|
config TWAI_ISR_IN_IRAM
|
||||||
bool "Place TWAI ISR function into IRAM"
|
bool "Place TWAI ISR function into IRAM"
|
||||||
default n
|
default n
|
||||||
|
select PERIPH_CTRL_FUNC_IN_IRAM if TWAI_ERRATA_FIX_RX_FRAME_INVALID || TWAI_ERRATA_FIX_RX_FIFO_CORRUPT
|
||||||
help
|
help
|
||||||
Place the TWAI ISR in to IRAM. This will allow the ISR to avoid
|
Place the TWAI ISR in to IRAM. This will allow the ISR to avoid
|
||||||
cache misses, and also be able to run whilst the cache is disabled
|
cache misses, and also be able to run whilst the cache is disabled
|
||||||
|
@@ -1,12 +1,6 @@
|
|||||||
|
|
||||||
[mapping:driver]
|
[mapping:driver]
|
||||||
archive: libdriver.a
|
archive: libdriver.a
|
||||||
entries:
|
entries:
|
||||||
# TWAI workarounds that require periph_module_reset() won't work if cache is disabled due to the use of switch jump
|
|
||||||
# tables in periph_module_reset(). We prevent any part of periph_module_reset() (either text or RO data) from being
|
|
||||||
# placed in flash.
|
|
||||||
if TWAI_ISR_IN_IRAM = y && (TWAI_ERRATA_FIX_RX_FRAME_INVALID = y || TWAI_ERRATA_FIX_RX_FIFO_CORRUPT = y):
|
|
||||||
periph_ctrl: periph_module_reset (noflash)
|
|
||||||
if GPTIMER_CTRL_FUNC_IN_IRAM = y:
|
if GPTIMER_CTRL_FUNC_IN_IRAM = y:
|
||||||
gptimer: gptimer_set_raw_count (noflash)
|
gptimer: gptimer_set_raw_count (noflash)
|
||||||
gptimer: gptimer_get_raw_count (noflash)
|
gptimer: gptimer_get_raw_count (noflash)
|
||||||
|
@@ -11,6 +11,7 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"hw_random.c"
|
"hw_random.c"
|
||||||
"intr_alloc.c"
|
"intr_alloc.c"
|
||||||
"mac_addr.c"
|
"mac_addr.c"
|
||||||
|
"periph_ctrl.c"
|
||||||
"sleep_modes.c"
|
"sleep_modes.c"
|
||||||
"sleep_gpio.c"
|
"sleep_gpio.c"
|
||||||
"sleep_mac_bb.c"
|
"sleep_mac_bb.c"
|
||||||
|
@@ -85,4 +85,13 @@ menu "Hardware Settings"
|
|||||||
If you want to use USB_SERIAL_JTAG under sw_reset case or sleep-wakeup case, you shoule select
|
If you want to use USB_SERIAL_JTAG under sw_reset case or sleep-wakeup case, you shoule select
|
||||||
this option. But be aware that this might increase the power consumption.
|
this option. But be aware that this might increase the power consumption.
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
menu "Peripheral Control"
|
||||||
|
config PERIPH_CTRL_FUNC_IN_IRAM
|
||||||
|
bool "Place peripheral control functions into IRAM"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Place peripheral control functions (e.g. periph_module_reset) into IRAM,
|
||||||
|
so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context.
|
||||||
|
endmenu
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -16,3 +16,7 @@ entries:
|
|||||||
opiram_psram (noflash)
|
opiram_psram (noflash)
|
||||||
if IDF_TARGET_ESP32S2 = y:
|
if IDF_TARGET_ESP32S2 = y:
|
||||||
mmu_psram (noflash)
|
mmu_psram (noflash)
|
||||||
|
if PERIPH_CTRL_FUNC_IN_IRAM = y:
|
||||||
|
periph_ctrl: periph_module_reset (noflash)
|
||||||
|
periph_ctrl: wifi_module_enable (noflash)
|
||||||
|
periph_ctrl: wifi_module_disable (noflash)
|
||||||
|
@@ -28,18 +28,17 @@ if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# [refactor-todo]: requires "driver" component for periph_ctrl header file
|
|
||||||
if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED)
|
if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED)
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS "include" "${idf_target}/include"
|
INCLUDE_DIRS "include" "${idf_target}/include"
|
||||||
PRIV_REQUIRES nvs_flash driver
|
PRIV_REQUIRES nvs_flash
|
||||||
LDFRAGMENTS "${ldfragments}"
|
LDFRAGMENTS "${ldfragments}"
|
||||||
EMBED_FILES "${build_dir}/phy_multiple_init_data.bin"
|
EMBED_FILES "${build_dir}/phy_multiple_init_data.bin"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS "include" "${idf_target}/include"
|
INCLUDE_DIRS "include" "${idf_target}/include"
|
||||||
PRIV_REQUIRES nvs_flash driver
|
PRIV_REQUIRES nvs_flash
|
||||||
LDFRAGMENTS "${ldfragments}"
|
LDFRAGMENTS "${ldfragments}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -41,7 +41,6 @@ else()
|
|||||||
# should be removable once using component init functions
|
# should be removable once using component init functions
|
||||||
# link-time registration is used.
|
# link-time registration is used.
|
||||||
# [refactor-todo] requires "driver" for headers:
|
# [refactor-todo] requires "driver" for headers:
|
||||||
# - periph_ctrl.h
|
|
||||||
# - rtc_cntl.h
|
# - rtc_cntl.h
|
||||||
# - spi_common_internal.h
|
# - spi_common_internal.h
|
||||||
pthread bootloader_support efuse driver
|
pthread bootloader_support efuse driver
|
||||||
|
@@ -254,6 +254,7 @@ menu "Wi-Fi"
|
|||||||
config ESP_WIFI_SLP_IRAM_OPT
|
config ESP_WIFI_SLP_IRAM_OPT
|
||||||
bool "WiFi SLP IRAM speed optimization"
|
bool "WiFi SLP IRAM speed optimization"
|
||||||
select PM_SLP_DEFAULT_PARAMS_OPT
|
select PM_SLP_DEFAULT_PARAMS_OPT
|
||||||
|
select PERIPH_CTRL_FUNC_IN_IRAM
|
||||||
help
|
help
|
||||||
Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.
|
Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.
|
||||||
Some functions can be put in IRAM either by ESP32_WIFI_IRAM_OPT and ESP32_WIFI_RX_IRAM_OPT, or this one.
|
Some functions can be put in IRAM either by ESP32_WIFI_IRAM_OPT and ESP32_WIFI_RX_IRAM_OPT, or this one.
|
||||||
|
@@ -150,13 +150,6 @@ entries:
|
|||||||
wifi_init:wifi_apb80m_request (noflash)
|
wifi_init:wifi_apb80m_request (noflash)
|
||||||
wifi_init:wifi_apb80m_release (noflash)
|
wifi_init:wifi_apb80m_release (noflash)
|
||||||
|
|
||||||
[mapping:driver_wifi_pm]
|
|
||||||
archive: libdriver.a
|
|
||||||
entries:
|
|
||||||
if ESP_WIFI_SLP_IRAM_OPT =y:
|
|
||||||
periph_ctrl:wifi_module_enable (noflash)
|
|
||||||
periph_ctrl:wifi_module_disable (noflash)
|
|
||||||
|
|
||||||
[mapping:esp_timer_wifi_pm]
|
[mapping:esp_timer_wifi_pm]
|
||||||
archive: libesp_timer.a
|
archive: libesp_timer.a
|
||||||
entries:
|
entries:
|
||||||
|
@@ -4,8 +4,7 @@ set(priv_include)
|
|||||||
# As CONFIG_USB_OTG_SUPPORTED comes from Kconfig, it is not evaluated yet
|
# As CONFIG_USB_OTG_SUPPORTED comes from Kconfig, it is not evaluated yet
|
||||||
# when components are being registered.
|
# when components are being registered.
|
||||||
# Thus, always add the (private) requirements, regardless of Kconfig
|
# Thus, always add the (private) requirements, regardless of Kconfig
|
||||||
# [refactor-todo]: requires "driver" because "periph_ctrl.h" is used in "hcd.c"
|
set(priv_require driver) # usb_phy driver relies on gpio driver API
|
||||||
set(priv_require hal driver)
|
|
||||||
|
|
||||||
if(CONFIG_USB_OTG_SUPPORTED)
|
if(CONFIG_USB_OTG_SUPPORTED)
|
||||||
list(APPEND srcs "hcd.c"
|
list(APPEND srcs "hcd.c"
|
||||||
|
Reference in New Issue
Block a user