Skip to content

Commit 08b90cc

Browse files
committed
boards: nxp_adsp_rt685: Enable DSP support for i.MX RT685
Add definitions facilitating the use of drivers specific to the RT685 when developing for the mimxrt685_evk/mimxrt685s/hifi4 target. Signed-off-by: Vit Stanicek <[email protected]>
1 parent f90b09d commit 08b90cc

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

mcux/CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ set(MCUX_SDK_PROJECT_NAME ${ZEPHYR_CURRENT_LIBRARY})
99
# MCU_DEVICE_PATH: SOC name without core suffix. Must match the name of the
1010
# folder in MCUX HAL. IE MIMXRT595S, or LPC55S36
1111

12+
if((DEFINED CMAKE_C_COMPILER) AND (${CMAKE_C_COMPILER} MATCHES "xtensa"))
13+
set(MCUX_IS_DSP true)
14+
endif()
15+
1216
if(NOT HWMv2)
1317
# Include HWMv1 logic for MCUX variables
1418
include(${CMAKE_CURRENT_LIST_DIR}/hwmv1.cmake)
@@ -46,13 +50,24 @@ zephyr_compile_definitions(${MCUX_CPU})
4650
# Build mcux device-specific objects. Although it is not normal
4751
# practice, drilling down like this avoids the need for repetitive
4852
# build scripts for every mcux device.
53+
4954
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_clock.c)
5055
if (${MCUX_DEVICE} MATCHES "LPC|MIMXRT6|MIMXRT5|RW6|MCXN.4.")
51-
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
56+
# fsl_power.c does not build on DSPs because of missing symbols in fsl_device_registers.h
57+
if(NOT MCUX_IS_DSP)
58+
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
59+
endif()
5260
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_reset.c)
5361
zephyr_library_sources_ifdef(CONFIG_HWINFO_RW61X mcux-sdk/devices/${MCUX_DEVICE}/drivers/fsl_ocotp.c)
5462
endif()
5563

64+
# i.MXRT500 and i.MXRT600 have DSPs - DSP support expected.
65+
# Don't include DSP support while building for DSP cores, as it
66+
# doesn't serve any purpose and depends on fsl_power.c.
67+
if (${MCUX_DEVICE} MATCHES "MIMXRT6|MIMXRT5" AND NOT MCUX_IS_DSP)
68+
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_dsp.c)
69+
endif()
70+
5671
# RT11xx SOC initialization file requires additional drivers, import them
5772
if (${MCUX_DEVICE} MATCHES "MIMXRT11")
5873
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_romapi.c)

mcux/hal_nxp.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ elseif (CONFIG_SOC_MCXN947_CPU1)
121121
include(device_system_MCXN947_cm33_core1)
122122
elseif (CONFIG_SOC_MCXN236)
123123
include(device_system_MCXN236)
124+
elseif (CONFIG_SOC_MIMXRT685S_HIFI4)
125+
include(device_system_MIMXRT685S_dsp)
124126
else()
125127
include(device_system)
126128
endif()
@@ -356,6 +358,7 @@ endif()
356358
endif()
357359

358360
if(${MCUX_DEVICE} MATCHES "MIMXRT(5|6)")
361+
set(CONFIG_USE_driver_pca9420 true)
359362
include(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/lpc_iopctl/driver_lpc_iopctl.cmake)
360363
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/lpc_iopctl)
361364
endif()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Description: device_system; user_visible: False
2+
include_guard(GLOBAL)
3+
message("device_system component is included.")
4+
5+
target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
6+
${CMAKE_CURRENT_LIST_DIR}/system_MIMXRT685S_dsp.c
7+
)
8+
9+
target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
10+
${CMAKE_CURRENT_LIST_DIR}/.
11+
)
12+
13+
14+
include(device_CMSIS)

0 commit comments

Comments
 (0)