Skip to content

Commit 111f568

Browse files
gangli02mmahadevan108
authored andcommitted
mcux: upgrade wifi_nxp
- When using code relocation, add the NOKEEP flag to discard unused code to reduce ITCM memory usage. - move wifidriver/sdio.c and /subsys/sd/sdio.c into ITCM. move nxp_wifi_send() and nxp_wifi_recv() into ITCM. Use DTCM_TEXT instead of DTCM, then only text code will be relocated into DTCM. - remove unused code in wifi_core_task for RW610. Signed-off-by: Gang Li <[email protected]>
1 parent 0be6a7c commit 111f568

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

mcux/middleware/wifi_nxp/CMakeLists.txt

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ if(CONFIG_NXP_RW610)
324324
set(QUICK_ACCESS_CODE_AREA_2 RAM_TEXT)
325325
else()
326326
set(QUICK_ACCESS_CODE_AREA ITCM_TEXT)
327-
set(QUICK_ACCESS_CODE_AREA_2 DTCM)
327+
set(QUICK_ACCESS_CODE_AREA_2 DTCM_TEXT)
328328
endif()
329329

330330
# critical path code relocated to SRAM
@@ -337,52 +337,55 @@ zephyr_code_relocate(FILES
337337
wifidriver/mlan_11n_rxreorder.c
338338
wifidriver/mlan_wmm.c
339339
wifidriver/wifi.c
340-
LOCATION ${QUICK_ACCESS_CODE_AREA})
340+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
341341

342342
if(CONFIG_SDIO_STACK)
343343
zephyr_code_relocate(FILES
344344
sdio_nxp_abs/mlan_sdio.c
345345
wifidriver/wifi-sdio.c
346-
LOCATION ${QUICK_ACCESS_CODE_AREA})
346+
wifidriver/sdio.c
347+
${ZEPHYR_BASE}/subsys/sd/sdio.c
348+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
349+
350+
zephyr_code_relocate(FILES ${ZEPHYR_BASE}/drivers/wifi/nxp/nxp_wifi_drv.c
351+
FILTER ".*\\.nxp_wifi_send|.*\\.nxp_wifi_recv"
352+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
347353
endif()
348354

349355
if(CONFIG_NXP_RW610)
350356
zephyr_code_relocate(FILES
351357
wifidriver/wifi-imu.c
352358
${MCUX_SDK_DIR}/drivers/imu/fsl_imu.c
353359
${MCUX_SDK_DIR}/components/imu_adapter/fsl_adapter_imu.c
354-
LOCATION ${QUICK_ACCESS_CODE_AREA})
360+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
355361
endif()
356362

357363
zephyr_code_relocate(FILES
358364
${MCUX_SDK_DIR}/components/osa/fsl_os_abstraction_zephyr.c
359-
LOCATION ${QUICK_ACCESS_CODE_AREA})
365+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
360366

361367
if(DEFINED CONFIG_SOC_SDKNG_UNSUPPORTED)
362368
zephyr_code_relocate(FILES
363369
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/utilities/misc_utilities/fsl_memcpy.S
364-
LOCATION ${QUICK_ACCESS_CODE_AREA})
370+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
365371
else()
366372
zephyr_code_relocate(FILES
367373
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk-ng/components/misc_utilities/fsl_memcpy.S
368-
LOCATION ${QUICK_ACCESS_CODE_AREA})
374+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
369375
endif()
370376

371377
file(GLOB ZPERF_SRC ${ZEPHYR_BASE}/subsys/net/lib/zperf/*.c)
372-
zephyr_code_relocate(FILES ${ZPERF_SRC} LOCATION ${QUICK_ACCESS_CODE_AREA_2})
373-
374-
zephyr_code_relocate(FILES
375-
${ZEPHYR_BASE}/subsys/net/ip/connection.c
376-
${ZEPHYR_BASE}/subsys/net/ip/packet_socket.c
377-
${ZEPHYR_BASE}/subsys/net/ip/utils.c
378-
LOCATION ${QUICK_ACCESS_CODE_AREA_2})
378+
zephyr_code_relocate(FILES ${ZPERF_SRC} LOCATION ${QUICK_ACCESS_CODE_AREA_2} NOKEEP)
379379

380380
zephyr_code_relocate(FILES
381381
${ZEPHYR_BASE}/subsys/net/ip/ipv6_fragment.c
382382
${ZEPHYR_BASE}/subsys/net/ip/ipv4_fragment.c
383-
LOCATION RAM_TEXT)
383+
LOCATION RAM_TEXT NOKEEP)
384384

385385
zephyr_code_relocate(FILES
386+
${ZEPHYR_BASE}/subsys/net/ip/connection.c
387+
${ZEPHYR_BASE}/subsys/net/ip/packet_socket.c
388+
${ZEPHYR_BASE}/subsys/net/ip/utils.c
386389
${ZEPHYR_BASE}/subsys/net/lib/sockets/sockets_packet.c
387390
${ZEPHYR_BASE}/subsys/net/lib/sockets/sockets.c
388391
${ZEPHYR_BASE}/subsys/net/ip/ipv4.c
@@ -396,7 +399,7 @@ zephyr_code_relocate(FILES
396399
${ZEPHYR_BASE}/subsys/net/ip/udp.c
397400
${ZEPHYR_BASE}/subsys/net/l2/ethernet/ethernet.c
398401
${ZEPHYR_BASE}/lib/net_buf/buf.c
399-
LOCATION ${QUICK_ACCESS_CODE_AREA})
402+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
400403

401404
zephyr_code_relocate(FILES
402405
${ZEPHYR_BASE}/kernel/mem_slab.c
@@ -408,7 +411,7 @@ zephyr_code_relocate(FILES
408411
${ZEPHYR_BASE}/kernel/sem.c
409412
${ZEPHYR_BASE}/kernel/thread.c
410413
${ZEPHYR_BASE}/kernel/work.c
411-
LOCATION ${QUICK_ACCESS_CODE_AREA})
414+
LOCATION ${QUICK_ACCESS_CODE_AREA} NOKEEP)
412415
endif()
413416
endif()
414417

mcux/middleware/wifi_nxp/wifidriver/wifi.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,30 +1775,20 @@ static void wifi_core_task(void *argv)
17751775
g_txrx_flag = true;
17761776
// SDIOC_IntMask(SDIOC_INT_CDINT, UNMASK);
17771777
// SDIOC_IntSigMask(SDIOC_INT_CDINT, UNMASK);
1778-
#ifndef RW610
17791778
sdio_enable_interrupt();
1780-
#endif
17811779

17821780
OSA_EXIT_CRITICAL();
17831781

17841782
(void)OSA_TaskNotifyGet(osaWaitForever_c);
17851783

17861784
// wakelock_get(WL_ID_WIFI_CORE_INPUT);
17871785

1788-
#if defined(RW610)
1789-
(void)wifi_imu_lock();
1790-
#else
17911786
/* Protect the SDIO from other parallel activities */
17921787
(void)wifi_sdio_lock();
17931788

17941789
(void)wlan_process_int_status(mlan_adap);
1795-
#endif
17961790

1797-
#if defined(RW610)
1798-
wifi_imu_unlock();
1799-
#else
18001791
wifi_sdio_unlock();
1801-
#endif
18021792
// wakelock_put(WL_ID_WIFI_CORE_INPUT);
18031793
} /* for ;; */
18041794
}

0 commit comments

Comments
 (0)