Skip to content

Commit 9367592

Browse files
VitekSTkartben
authored andcommitted
boards: Add mimxrt685_evk/mimxrt685s/hifi4
Add definitions and init code for mimxrt685_evk/mimxrt685s/hifi4 (i.MX RT685's HiFi 4 DSP core on MIMXRT685-EVK). Signed-off-by: Vit Stanicek <[email protected]>
1 parent eba03e8 commit 9367592

File tree

8 files changed

+141
-7
lines changed

8 files changed

+141
-7
lines changed

boards/nxp/mimxrt685_evk/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#
2-
# Copyright 2020-2022 NXP
2+
# Copyright 2020-2022, 2025 NXP
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

77
if(CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_CM33)
8-
zephyr_library()
9-
zephyr_library_sources(init.c)
8+
zephyr_library()
9+
zephyr_library_sources(cm33/init.c)
10+
elseif(CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_HIFI4)
11+
zephyr_library()
12+
zephyr_library_sources(hifi4/init.c)
1013
endif()
1114

1215
if(CONFIG_NXP_IMXRT_BOOT_HEADER)
13-
if(NOT DEFINED CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_CM33)
16+
if(NOT DEFINED CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_CM33 AND NOT DEFINED CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_HIFI4)
1417
message(WARNING "It appears you are using the board definition for "
1518
"the MIMXRT685-EVK, but targeting a custom board. You may need to "
1619
"update your flash configuration block data")

boards/nxp/mimxrt685_evk/Kconfig.mimxrt685_evk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
config BOARD_MIMXRT685_EVK
55
select SOC_PART_NUMBER_MIMXRT685SFVKB
66
select SOC_MIMXRT685S_CM33 if BOARD_MIMXRT685_EVK_MIMXRT685S_CM33
7+
select SOC_MIMXRT685S_HIFI4 if BOARD_MIMXRT685_EVK_MIMXRT685S_HIFI4

boards/nxp/mimxrt685_evk/board.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#
2-
# Copyright (c) 2020, NXP
2+
# Copyright 2020, 2025 NXP
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7-
board_runner_args(jlink "--device=MIMXRT685S_M33" "--reset-after-load")
8-
board_runner_args(linkserver "--device=MIMXRT685S:EVK-MIMXRT685")
7+
if(CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_CM33)
8+
board_runner_args(jlink "--device=MIMXRT685S_M33" "--reset-after-load")
9+
board_runner_args(linkserver "--device=MIMXRT685S:EVK-MIMXRT685")
10+
elseif(CONFIG_BOARD_MIMXRT685_EVK_MIMXRT685S_HIFI4)
11+
board_runner_args(jlink "--device=MIMXRT685S_HiFi4" "--reset-after-load")
12+
board_runner_args(linkserver "--device=MIMXRT685S:EVK-MIMXRT685")
13+
endif()
914

1015
include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake)
1116
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/nxp/mimxrt685_evk/doc/index.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,42 @@ steps:
294294

295295
#. Reset by pressing SW3
296296

297+
HiFi 4 DSP core
298+
===============
299+
300+
The Cadence HiFi 4 DSP core instantiated in the i.MX RT685 microcontroller is
301+
supported and works with both the proprietary Xtensa toolchains (``xcc`` in
302+
earlier packages and ``xt-lang`` newer ones) and the
303+
``xtensa-nxp_rt600_adsp_zephyr-elf`` GCC variant distributed in the Zephyr SDK.
304+
305+
To build a project:
306+
307+
- Set up toolchain environment
308+
- No special configuration needed for the GCC variant in the Zephyr SDK.
309+
- For the proprietary Xtensa toolchain, set ``XTENSA_CORE``,
310+
``XTENSA_TOOLCHAIN_PATH`` and ``TOOLCHAIN_VER`` according to your
311+
installed version. ``ZEPHYR_TOOLCHAIN_VARIANT`` should be either ``xcc``
312+
or ``xt-clang``.
313+
- Build the project with:
314+
315+
.. zephyr-app-commands::
316+
:zephyr-app: samples/hello_world
317+
:board: mimxrt685_evk/mimxrt685s/hifi4
318+
:goals: build
319+
320+
Debugging can be directly carried out using the J-Link GDB server with
321+
``xt-gdb`` (Xtensa proprietary) or ``gdb`` (Zephyr SDK) connected. It's
322+
also possible to debug the HiFi 4 DSP in tandem with the CM33 core using the
323+
``xt-ocd`` daemon. See `RT600 Dual-Core Communication and Debugging`_
324+
for details.
325+
326+
As the HiFi 4 DSP is positioned as a secondary core, explicit initialisation
327+
must be done in order for it to be functional. The ``nxp_rtxxx_adsp_ctrl``,
328+
instantiated in the RT685's CM33 domain, takes care of this. Power domains
329+
and clocks are set up upon it initialising. This is sufficient for
330+
attaching a debugger to the core. For the use in an AMP system, this driver
331+
handles code loading and run control.
332+
297333
.. include:: ../../common/board-footer.rst
298334
:start-after: nxp-board-footer
299335

@@ -314,3 +350,6 @@ steps:
314350

315351
.. _i.MX RT685 Reference Manual:
316352
https://www.nxp.com/webapp/Download?colCode=UM11147
353+
354+
.. _RT600 Dual-Core Communication and Debugging:
355+
https://www.nxp.com/docs/en/application-note/AN12789.pdf

boards/nxp/mimxrt685_evk/hifi4/init.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2020-2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/platform/hooks.h>
8+
#include <zephyr/devicetree.h>
9+
#include <fsl_device_registers.h>
10+
11+
void board_early_init_hook(void)
12+
{
13+
/* flexcomm1 and flexcomm3 are configured to loopback the TX signal to RX */
14+
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm1), nxp_lpc_i2s, okay)) && \
15+
(DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm3), nxp_lpc_i2s, okay)) && \
16+
CONFIG_I2S
17+
18+
/* Set shared signal set 0 SCK, WS from Transmit I2S - Flexcomm3 */
19+
SYSCTL1->SHAREDCTRLSET[0] = SYSCTL1_SHAREDCTRLSET_SHAREDSCKSEL(3) |
20+
SYSCTL1_SHAREDCTRLSET_SHAREDWSSEL(3);
21+
22+
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES
23+
/* Select Data in from Transmit I2S - Flexcomm 3 */
24+
SYSCTL1->SHAREDCTRLSET[0] |= SYSCTL1_SHAREDCTRLSET_SHAREDDATASEL(3);
25+
/* Enable Transmit I2S - Flexcomm 3 for Shared Data Out */
26+
SYSCTL1->SHAREDCTRLSET[0] |= SYSCTL1_SHAREDCTRLSET_FC3DATAOUTEN(1);
27+
#endif
28+
29+
/* Set Receive I2S - Flexcomm 1 SCK, WS from shared signal set 0 */
30+
SYSCTL1->FCCTRLSEL[1] = SYSCTL1_FCCTRLSEL_SCKINSEL(1) |
31+
SYSCTL1_FCCTRLSEL_WSINSEL(1);
32+
33+
/* Set Transmit I2S - Flexcomm 3 SCK, WS from shared signal set 0 */
34+
SYSCTL1->FCCTRLSEL[3] = SYSCTL1_FCCTRLSEL_SCKINSEL(1) |
35+
SYSCTL1_FCCTRLSEL_WSINSEL(1);
36+
37+
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES
38+
/* Select Receive I2S - Flexcomm 1 Data in from shared signal set 0 */
39+
SYSCTL1->FCCTRLSEL[1] |= SYSCTL1_FCCTRLSEL_DATAINSEL(1);
40+
/* Select Transmit I2S - Flexcomm 3 Data out to shared signal set 0 */
41+
SYSCTL1->FCCTRLSEL[3] |= SYSCTL1_FCCTRLSEL_DATAOUTSEL(1);
42+
#endif
43+
44+
#endif
45+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright 2024 NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
identifier: mimxrt685_evk/mimxrt685s/hifi4
8+
name: NXP MIMXRT685-EVK (HiFi 4)
9+
type: mcu
10+
arch: xtensa
11+
ram: 64
12+
flash: 64
13+
toolchain:
14+
- zephyr
15+
- xt-clang
16+
- xtools
17+
supported:
18+
- dma
19+
- gpio
20+
- i2c
21+
- i3c
22+
- i2s
23+
- spi
24+
testing:
25+
only_tags:
26+
- kernel
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright 2024 NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_CONSOLE=y
8+
CONFIG_UART_CONSOLE=y
9+
CONFIG_SERIAL=y
10+
CONFIG_GPIO=y
11+
12+
CONFIG_GEN_ISR_TABLES=y
13+
CONFIG_GEN_IRQ_VECTOR_TABLE=n
14+
CONFIG_XTENSA_SMALL_VECTOR_TABLE_ENTRY=y
15+
CONFIG_NXP_IMXRT_BOOT_HEADER=n

0 commit comments

Comments
 (0)