Skip to content

Commit

Permalink
test: i2s: Reconfigure i2s speed test HW environment on RT1170 EVK board
Browse files Browse the repository at this point in the history
Use TX and RX blocks on SAI for i2s speed test, by this way we can avoid
HW reworking.
Update Readme file and DMA channel configuration in overlay file to avoid
DMA channel conflict with other peripherals like UART.

Signed-off-by: Raymond Lei <[email protected]>
  • Loading branch information
Raymond0225 authored and mmahadevan108 committed Jan 27, 2025
1 parent 332115c commit 7e8abff
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 29 deletions.
2 changes: 1 addition & 1 deletion boards/nxp/mimxrt1170_evk/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ RT1170 EVKB (``mimxrt1170_evk@B//cm7/cm4``)
+-----------+------------+------------------------------------------------+-----------------+-----------------+
| ENET1G | on-chip | ethernet - 10/100/1000M | Supported (M7) | Supported (M7) |
+-----------+------------+------------------------------------------------+-----------------+-----------------+
| SAI | on-chip | i2s | Supported | No support |
| SAI | on-chip | i2s | Supported (M7) | Supported (M7) |
+-----------+------------+------------------------------------------------+-----------------+-----------------+
| USB | on-chip | USB Device | Supported (M7) | Supported (M7) |
+-----------+------------+------------------------------------------------+-----------------+-----------------+
Expand Down
20 changes: 14 additions & 6 deletions tests/drivers/i2s/i2s_speed/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ i2s_speed Test
Board-specific details:

MIMXRT1170_EVK:
This board uses CONFIG_I2S_TEST_SEPARATE_DEVICES=y and connects two SAI peripherals by shorting
signals externally on the EVK. These are the HW changes required to run this test:
- Remove jumper J8 and resistor R78
- Short BCLK J9-pin1 (SAI1_RX_BCLK) to J66-pin1 (SAI4_TX_BCLK)
- Short SYNC J9-pin5 (SAI1_RX_SYNC) to J64-pin1 (SAI4_TX_SYNC)
- Short Data J61-pin1 (SAI1_RX_DATA) to J63-pin1 (SAI4_TX_DATA)
This board uses CONFIG_I2S_TEST_SEPARATE_DEVICES=n and connects TX and RX blocks in one
SAI peripheral by shorting signals externally on the EVK.
These are the HW changes required to run this test:
- Short BCLK J9-pin1 (SAI1_RX_BCLK) to J9-pin11 (SAI1_TX_BCLK)
- Short SYNC J9-pin5 (SAI1_RX_SYNC) to J9-pin13 (SAI1_TX_SYNC)
- Short Data J9-pin7 (SAI1_RX_DATA) to J9-pin9 (SAI1_TX_DATA)

MIMXRT1170_EVKB (SCH-55139 Rev C/C1/C2):
This board uses CONFIG_I2S_TEST_SEPARATE_DEVICES=n and connects TX and RX blocks in one
SAI peripheral by shorting signals externally on the EVK.
These are the HW changes required to run this test:
- Populate R2124, R2125
- Remove J99, J100
- Short Data J99-pin1 (SAI1_RX_DATA0) to J100-pin1 (SAI1_TX_DATA0)

FRDM-MCXN947:
This board uses CONFIG_I2S_TEST_SEPARATE_DEVICES=y and connects two SAI peripherals by shorting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# SPDX-License-Identifier: Apache-2.0
#

# SAI peripheral does not have loopback mode. Use 2 SAI peripherals connected
# together externally.
CONFIG_I2S_TEST_SEPARATE_DEVICES=y
# SAI peripheral does not have loopback mode but we can connect CLK, SYNC,
# RXD and TXD of one SAI for test purpose.
CONFIG_I2S_TEST_SEPARATE_DEVICES=n

# CONFIG_DMA_TCD_QUEUE_SIZE sets size of queue used to chain DMA blocks (TCDs)
# together, and should be sized as needed by the application. If not large
Expand All @@ -18,7 +18,7 @@ CONFIG_DMA_TCD_QUEUE_SIZE=4
CONFIG_ZTEST_RETEST_IF_PASSED=y

# I2S and DMA logging can occur in interrupt context, and interfere with I2S
# stream timing. If using either logging, set logging to deffered
# stream timing. If using either logging, set logging to deferred
# CONFIG_LOG_MODE_DEFERRED=y

CONFIG_DMA_LOG_LEVEL_OFF=y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
/* i2s_speed with CONFIG_I2S_TEST_SEPARATE_DEVICES=y uses two I2S peripherals:
* i2s-node0 is the receiver - uses SAI1 peripheral on RT1170
* i2s-node1 is the transmitter - uses SAI4 peripheral
/* i2s_speed with CONFIG_I2S_TEST_SEPARATE_DEVICES=n uses only one I2S peripheral:
* i2s-node0 is both the transitter and receiver.
* uses SAI1 peripheral on RT1170
*/

/ {
aliases {
i2s-node0 = &sai1;
i2s-node1 = &sai4;
};
};

/* Enable SAI4, and set clocks to match SAI1 */
&sai4 {
status = "okay";
podf = < 0x4 >;
pinctrl-0 = <&pinmux_sai4>;
pinctrl-names = "default";
};

/* On MIMXRT1170-EVK, there is a conflict with signal SAI4_TX_BCLK shared with
* ENET_RST. For i2s_speed test, disable ENET peripheral.
*/
&enet {
status = "disabled";
/* Default DMA channel 0 and 1 maybe used by other peripherals like UART. */
&sai1 {
nxp,tx-dma-channel = <8>;
nxp,rx-dma-channel = <9>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2021, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

# SAI peripheral does not have loopback mode but we can connect CLK, SYNC,
# RXD and TXD of one SAI for test purpose.
CONFIG_I2S_TEST_SEPARATE_DEVICES=n

# CONFIG_DMA_TCD_QUEUE_SIZE sets size of queue used to chain DMA blocks (TCDs)
# together, and should be sized as needed by the application. If not large
# enough, the DMA may starve. Symptoms of this issue include transmit blocks
# repeated, or RX blocks skipped. For I2S driver, queue size must be at least 3.
CONFIG_DMA_TCD_QUEUE_SIZE=4

# Repeat test continually to help find intermittent issues
CONFIG_ZTEST_RETEST_IF_PASSED=y

# I2S and DMA logging can occur in interrupt context, and interfere with I2S
# stream timing. If using either logging, set logging to deferred
# CONFIG_LOG_MODE_DEFERRED=y

CONFIG_DMA_LOG_LEVEL_OFF=y
CONFIG_I2S_LOG_LEVEL_OFF=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* i2s_speed with CONFIG_I2S_TEST_SEPARATE_DEVICES=n uses only one I2S peripheral:
* i2s-node0 is both the transitter and receiver.
* uses SAI1 peripheral on RT1170
*/
/ {
aliases {
i2s-node0 = &sai1;
};
};

/* Default DMA channel 0 and 1 maybe used by other peripherals like UART. */
&sai1 {
nxp,tx-dma-channel = <8>;
nxp,rx-dma-channel = <9>;
};

0 comments on commit 7e8abff

Please sign in to comment.