Skip to content

Commit

Permalink
boards: nxp_adsp_rt685: Enable DSP support for i.MX RT685
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
VitekST committed Aug 30, 2024
1 parent f90b09d commit 08b90cc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
17 changes: 16 additions & 1 deletion mcux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ set(MCUX_SDK_PROJECT_NAME ${ZEPHYR_CURRENT_LIBRARY})
# MCU_DEVICE_PATH: SOC name without core suffix. Must match the name of the
# folder in MCUX HAL. IE MIMXRT595S, or LPC55S36

if((DEFINED CMAKE_C_COMPILER) AND (${CMAKE_C_COMPILER} MATCHES "xtensa"))
set(MCUX_IS_DSP true)
endif()

if(NOT HWMv2)
# Include HWMv1 logic for MCUX variables
include(${CMAKE_CURRENT_LIST_DIR}/hwmv1.cmake)
Expand Down Expand Up @@ -46,13 +50,24 @@ zephyr_compile_definitions(${MCUX_CPU})
# Build mcux device-specific objects. Although it is not normal
# practice, drilling down like this avoids the need for repetitive
# build scripts for every mcux device.

zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_clock.c)
if (${MCUX_DEVICE} MATCHES "LPC|MIMXRT6|MIMXRT5|RW6|MCXN.4.")
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
# fsl_power.c does not build on DSPs because of missing symbols in fsl_device_registers.h
if(NOT MCUX_IS_DSP)
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
endif()
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_reset.c)
zephyr_library_sources_ifdef(CONFIG_HWINFO_RW61X mcux-sdk/devices/${MCUX_DEVICE}/drivers/fsl_ocotp.c)
endif()

# i.MXRT500 and i.MXRT600 have DSPs - DSP support expected.
# Don't include DSP support while building for DSP cores, as it
# doesn't serve any purpose and depends on fsl_power.c.
if (${MCUX_DEVICE} MATCHES "MIMXRT6|MIMXRT5" AND NOT MCUX_IS_DSP)
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_dsp.c)
endif()

# RT11xx SOC initialization file requires additional drivers, import them
if (${MCUX_DEVICE} MATCHES "MIMXRT11")
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_romapi.c)
Expand Down
3 changes: 3 additions & 0 deletions mcux/hal_nxp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ elseif (CONFIG_SOC_MCXN947_CPU1)
include(device_system_MCXN947_cm33_core1)
elseif (CONFIG_SOC_MCXN236)
include(device_system_MCXN236)
elseif (CONFIG_SOC_MIMXRT685S_HIFI4)
include(device_system_MIMXRT685S_dsp)
else()
include(device_system)
endif()
Expand Down Expand Up @@ -356,6 +358,7 @@ endif()
endif()

if(${MCUX_DEVICE} MATCHES "MIMXRT(5|6)")
set(CONFIG_USE_driver_pca9420 true)
include(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/lpc_iopctl/driver_lpc_iopctl.cmake)
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/lpc_iopctl)
endif()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Description: device_system; user_visible: False
include_guard(GLOBAL)
message("device_system component is included.")

target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/system_MIMXRT685S_dsp.c
)

target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/.
)


include(device_CMSIS)

0 comments on commit 08b90cc

Please sign in to comment.