Skip to content

Commit 5588934

Browse files
ZhaoxiangJinmmahadevan108
authored andcommitted
sdk_ng: Update wifi_nxp and rmpsg to compatible with the sdk_ng
The rpmsg files (fsl_adapter_rfimu.c) required in zephyr but does not exist in SDK NEXT, so SDK NEXT will also use this file in mcux-sdk/components/rpmsg. Update the wifi_nxp CMakeLists.txt to compatible with the sdk_ng. Signed-off-by: Jason Yu <[email protected]>
1 parent 277b28b commit 5588934

File tree

2 files changed

+39
-14
lines changed

2 files changed

+39
-14
lines changed

mcux/mcux-sdk/components/rpmsg/component_wireless_imu_adapter.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ if(CONFIG_USE_component_osa_bm)
1818
include(component_osa_bm)
1919
endif()
2020

21-
include(driver_gdma)
22-
include(driver_imu)
21+
# mcux-sdk and mcux-sdk-ng shar the rpmsg, the gdma and imu is
22+
# included in another way. Need add condition here.
23+
if(DEFINED CONFIG_SOC_SDKNG_UNSUPPORTED)
24+
include(driver_gdma)
25+
include(driver_imu)
26+
endif()

mcux/middleware/wifi_nxp/CMakeLists.txt

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# Copyright 2022-2024 NXP
33

4+
# Legacy MCUX SDK code is in mcux/mcux-sdk.
5+
# MCUX SDK NG code is in mcux/mcux-sdk-ng.
6+
# Use the right code by checking whether the platform is not supported by MCUX SDK NG.
7+
if(DEFINED CONFIG_SOC_SDKNG_UNSUPPORTED)
8+
set(MCUX_SDK_DIR ${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk)
9+
else()
10+
set(MCUX_SDK_DIR ${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk-ng)
11+
endif()
12+
413
# define part number for this driver
514

615
zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8987
@@ -156,11 +165,13 @@ zephyr_library_compile_definitions(
156165
CONFIG_OSA_DEBUG_ASSERT_ENABLED=1
157166
)
158167

159-
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/utilities/misc_utilities/fsl_memcpy.S)
160-
161-
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/lists/fsl_component_generic_list.c)
162-
163-
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/fsl_os_abstraction_zephyr.c)
168+
# mcux-sdk and mcux-sdk-ng shar the wifi_nxp, the lists and osa is
169+
# included in another way. Need add condition here.
170+
if(DEFINED CONFIG_SOC_SDKNG_UNSUPPORTED)
171+
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/utilities/misc_utilities/fsl_memcpy.S)
172+
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/lists/fsl_component_generic_list.c)
173+
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/fsl_os_abstraction_zephyr.c)
174+
endif()
164175

165176
zephyr_include_directories(
166177
incl
@@ -181,11 +192,11 @@ zephyr_include_directories(
181192
wifi_bt_firmware/nw61x
182193
wifi_bt_firmware/8801
183194
cli
184-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/
185-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/lists/
186-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/wifi_bt_module/AzureWave/tx_pwr_limits/
187-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/wifi_bt_module/Murata/tx_pwr_limits/
188-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/rpmsg/
195+
${MCUX_SDK_DIR}/components/osa/
196+
${MCUX_SDK_DIR}/components/lists/
197+
${MCUX_SDK_DIR}/components/wifi_bt_module/AzureWave/tx_pwr_limits/
198+
${MCUX_SDK_DIR}/components/wifi_bt_module/Murata/tx_pwr_limits/
199+
${MCUX_SDK_DIR}/components/rpmsg/
189200
)
190201

191202
# OS abstraction layer source
@@ -275,15 +286,25 @@ endif()
275286
if(CONFIG_NXP_RW610)
276287
zephyr_code_relocate(FILES
277288
wifidriver/wifi-imu.c
278-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/drivers/imu/fsl_imu.c
289+
${MCUX_SDK_DIR}/drivers/imu/fsl_imu.c
290+
# Only legacy SDK has this file.
279291
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/rpmsg/fsl_adapter_rfimu.c
280292
LOCATION RAM_TEXT)
281293
endif()
282294

283295
zephyr_code_relocate(FILES
284-
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/fsl_os_abstraction_zephyr.c
296+
${MCUX_SDK_DIR}/components/osa/fsl_os_abstraction_zephyr.c
297+
LOCATION RAM_TEXT)
298+
299+
if(DEFINED CONFIG_SOC_SDKNG_UNSUPPORTED)
300+
zephyr_code_relocate(FILES
285301
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/utilities/misc_utilities/fsl_memcpy.S
286302
LOCATION RAM_TEXT)
303+
else()
304+
zephyr_code_relocate(FILES
305+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk-ng/components/misc_utilities/fsl_memcpy.S
306+
LOCATION RAM_TEXT)
307+
endif()
287308

288309
file(GLOB ZPERF_SRC ${ZEPHYR_BASE}/subsys/net/lib/zperf/*.c)
289310
zephyr_code_relocate(FILES ${ZPERF_SRC} LOCATION RAM_TEXT)

0 commit comments

Comments
 (0)