Skip to content

Commit 5b95597

Browse files
YuzhuoLiuRTKZhiyuanTang17
authored andcommitted
tests: spi: add rtl87x2j spi tests support
Enable the spi_loopback and spi_controller_peripheral tests for Realtek Bee series rtl87x2j_evb_rtl8762jth board. Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
1 parent 2cb46b7 commit 5b95597

4 files changed

Lines changed: 138 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2026, Realtek Semiconductor Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_TESTED_SPI_MODE=1
5+
CONFIG_SPI_BEE_DMA=y
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright (c) 2026, Realtek Semiconductor Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&spi1 {
8+
status = "okay";
9+
pinctrl-0 = <&spi1_default>;
10+
pinctrl-names = "default";
11+
dmas = <&dma0 3 6 0x30021>, <&dma0 2 7 0x200a>;
12+
dma-names = "tx", "rx";
13+
14+
dut_spi_dt: test-spi-dev@0 {
15+
compatible = "vnd,spi-device";
16+
reg = <0>;
17+
spi-max-frequency = <800>;
18+
};
19+
};
20+
21+
dut_spis: &spi0_slave {
22+
status = "okay";
23+
dmas = <&dma0 1 4 0x10021>, <&dma0 0 5 0xa>;
24+
dma-names = "tx", "rx";
25+
pinctrl-0 = <&spi0_slave_default>;
26+
pinctrl-names = "default";
27+
};
28+
29+
&gpioa {
30+
pinctrl-0 = <&gpioa_default>;
31+
pinctrl-names = "default";
32+
status = "okay";
33+
};
34+
35+
&dma0 {
36+
status = "okay";
37+
};
38+
39+
&pinctrl {
40+
spi1_default: spi1_default {
41+
group1 {
42+
psels = <BEE_PSEL(SPI1_CLK_MASTER, P4_0)>,
43+
<BEE_PSEL(SPI1_MO_MASTER, P4_1)>,
44+
<BEE_PSEL(SPI1_MI_MASTER, P4_2)>,
45+
<BEE_PSEL(SPI1_SS_N_0_MASTER, P4_3)>;
46+
output-enable;
47+
output-high;
48+
bias-pull-up;
49+
};
50+
};
51+
52+
spi0_slave_default: spi0_slave_default {
53+
group1 {
54+
psels = <BEE_PSEL(SPI0_CLK_SLAVE, P0_4)>,
55+
<BEE_PSEL(SPI0_SI_SLAVE, P0_5)>,
56+
<BEE_PSEL(SPI0_SO_SLAVE, P0_6)>,
57+
<BEE_PSEL(SPI0_SS_N_0_SLAVE, P0_7)>;
58+
output-enable;
59+
output-high;
60+
bias-pull-up;
61+
};
62+
};
63+
64+
gpioa_default: gpioa_default {
65+
group1 {
66+
psels = <BEE_PSEL_GPIOA_30_P4_3>;
67+
};
68+
};
69+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2026, Realtek Semiconductor Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_GPIO=y
5+
CONFIG_SPI_BEE_DMA=y
6+
CONFIG_SPI_BEE_DMA_BUF_SIZE=8192
7+
CONFIG_SPI_BEE_DMA_BUF_COUNT=2
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2026, Realtek Semiconductor Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&gpioa {
8+
status = "okay";
9+
pinctrl-0 = <&gpioa_default>;
10+
pinctrl-names = "default";
11+
ngpios = <32>;
12+
status = "okay";
13+
};
14+
15+
&dma0 {
16+
status = "okay";
17+
};
18+
19+
&spi0 {
20+
status = "okay";
21+
pinctrl-0 = <&spi0_default>;
22+
pinctrl-names = "default";
23+
cs-gpios = <&gpioa 30 GPIO_ACTIVE_LOW>;
24+
dmas = <&dma0 2 4 0x10021>, <&dma0 3 5 0xa>;
25+
dma-names = "tx", "rx";
26+
27+
slow@0 {
28+
compatible = "test-spi-loopback-slow";
29+
reg = <0>;
30+
spi-max-frequency = <500000>;
31+
};
32+
33+
fast@0 {
34+
compatible = "test-spi-loopback-fast";
35+
reg = <0>;
36+
spi-max-frequency = <1000000>;
37+
};
38+
};
39+
40+
&pinctrl {
41+
spi0_default: spi0_default {
42+
group1 {
43+
psels = <BEE_PSEL(SPI0_CLK_MASTER, P4_0)>,
44+
<BEE_PSEL(SPI0_MO_MASTER, P4_1)>,
45+
<BEE_PSEL(SPI0_MI_MASTER, P4_2)>;
46+
output-enable;
47+
output-high;
48+
bias-pull-up;
49+
};
50+
};
51+
52+
gpioa_default: gpioa_default {
53+
group1 {
54+
psels = <BEE_PSEL_GPIOA_30_P4_3>;
55+
};
56+
};
57+
};

0 commit comments

Comments
 (0)