Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i.MX RT685's HiFi 4 DSP support #432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)