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 HiFi4 DSP core.

Signed-off-by: Vit Stanicek <[email protected]>
  • Loading branch information
VitekST committed Dec 19, 2023
1 parent ed3efff commit debbf8f
Show file tree
Hide file tree
Showing 2 changed files with 17 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 @@ -17,6 +17,10 @@ else()
string(TOUPPER ${CONFIG_SOC} MCUX_DEVICE_PATH)
endif()

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

if("${MCUX_DEVICE}" STREQUAL "LPC51U68")
set(MCUX_CPU CPU_${CONFIG_SOC_PART_NUMBER})
elseif("${MCUX_DEVICE}" STREQUAL "LPC54114")
Expand Down Expand Up @@ -72,12 +76,23 @@ 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")
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)
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
1 change: 1 addition & 0 deletions mcux/hal_nxp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,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

0 comments on commit debbf8f

Please sign in to comment.