From b764454e52ec97332f3ba5c57a96dd6f9a8a68fb Mon Sep 17 00:00:00 2001 From: xiehang Date: Sat, 9 Nov 2019 10:42:15 +0800 Subject: [PATCH] esp_wifi:Put some rx code to iram --- components/esp32/Kconfig | 10 ++++++++++ components/esp32/ld/esp32_fragments.lf | 9 +++++++++ components/esp32/lib | 2 +- components/esp32/linker.lf | 11 +++++++++++ tools/unit-test-app/configs/psram | 3 ++- tools/unit-test-app/configs/psram_2 | 1 + 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index cbb736522..ebd378e45 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -1363,12 +1363,22 @@ menu Wi-Fi config ESP32_WIFI_IRAM_OPT bool "WiFi IRAM speed optimization" + default n if (BT_ENABLED && SPIRAM_SUPPORT) default y help Select this option to place frequently called Wi-Fi library functions in IRAM. When this option is disabled, more than 10Kbytes of IRAM memory will be saved but Wi-Fi throughput will be reduced. + config ESP32_WIFI_RX_IRAM_OPT + bool "WiFi RX IRAM speed optimization" + default n if (BT_ENABLED && SPIRAM_SUPPORT) + default y + help + Select this option to place frequently called Wi-Fi library RX functions in IRAM. + When this option is disabled, more than 17Kbytes of IRAM memory will be saved + but Wi-Fi performance will be reduced. + endmenu # Wi-Fi menu PHY diff --git a/components/esp32/ld/esp32_fragments.lf b/components/esp32/ld/esp32_fragments.lf index 932197caf..c60b2e19d 100644 --- a/components/esp32/ld/esp32_fragments.lf +++ b/components/esp32/ld/esp32_fragments.lf @@ -45,6 +45,10 @@ entries: .dram1+ [sections:wifi_iram] +entries: + .wifirxiram+ + +[sections:wifi_rx_iram] entries: .wifi0iram+ @@ -62,6 +66,7 @@ entries: rtc_rodata -> rtc_data rtc_bss -> rtc_bss wifi_iram -> flash_text + wifi_rx_iram -> flash_text [scheme:rtc] entries: @@ -87,3 +92,7 @@ entries: [scheme:wifi_iram] entries: wifi_iram -> iram0_text + +[scheme:wifi_rx_iram] +entries: + wifi_rx_iram -> iram0_text diff --git a/components/esp32/lib b/components/esp32/lib index f50b25d69..e99f911d1 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit f50b25d69a3b04d70acf249705382a6b57f81954 +Subproject commit e99f911d105b7fd9e0b3efa5a762f0f48fe45f29 diff --git a/components/esp32/linker.lf b/components/esp32/linker.lf index 040e29336..16c3e6193 100644 --- a/components/esp32/linker.lf +++ b/components/esp32/linker.lf @@ -40,3 +40,14 @@ entries: : ESP32_WIFI_IRAM_OPT = y * (wifi_iram) +[mapping] +archive: libpp.a +entries: + : ESP32_WIFI_RX_IRAM_OPT = y + * (wifi_rx_iram) + +[mapping] +archive: libnet80211.a +entries: + : ESP32_WIFI_RX_IRAM_OPT = y + * (wifi_rx_iram) diff --git a/tools/unit-test-app/configs/psram b/tools/unit-test-app/configs/psram index eb0568c7e..7cc650c3c 100644 --- a/tools/unit-test-app/configs/psram +++ b/tools/unit-test-app/configs/psram @@ -1,3 +1,4 @@ TEST_EXCLUDE_COMPONENTS=libsodium bt app_update driver esp32 spi_flash CONFIG_SPIRAM_SUPPORT=y -CONFIG_SPIRAM_OCCUPY_NO_HOST=y \ No newline at end of file +CONFIG_SPIRAM_OCCUPY_NO_HOST=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=n diff --git a/tools/unit-test-app/configs/psram_2 b/tools/unit-test-app/configs/psram_2 index d9b129481..1c51b766e 100644 --- a/tools/unit-test-app/configs/psram_2 +++ b/tools/unit-test-app/configs/psram_2 @@ -1,3 +1,4 @@ TEST_COMPONENTS=driver esp32 spi_flash CONFIG_SPIRAM_SUPPORT=y CONFIG_SPIRAM_OCCUPY_NO_HOST=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=n