Skip to content

Commit c49ec80

Browse files
Amneesh Singhaescolar
authored andcommitted
am243x_evm/am2434/r5f0_0: add SPI support
Add OMAP multi-channel SPI node to the device tree and add overlay for the SPI loopback test. Signed-off-by: Amneesh Singh <[email protected]>
1 parent b6d261b commit c49ec80

File tree

6 files changed

+61
-0
lines changed

6 files changed

+61
-0
lines changed

boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0-pinctrl.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@
2424
i2c0_sda: i2c0_sda_default {
2525
pinmux = <K3_PINMUX(0x264, PIN_INPUT_PULLUP, MUX_MODE_0)>;
2626
};
27+
28+
spi0_cs0: spi0_cs0_default {
29+
pinmux = <K3_PINMUX(0x208, PIN_OUTPUT, MUX_MODE_0)>;
30+
};
31+
32+
spi0_clk: spi0_clk_default {
33+
pinmux = <K3_PINMUX(0x210, PIN_OUTPUT, MUX_MODE_0)>;
34+
};
35+
36+
spi0_d0: spi0_d0_default {
37+
pinmux = <K3_PINMUX(0x214, PIN_INPUT, MUX_MODE_0)>;
38+
};
39+
40+
spi0_d1: spi0_d1_default {
41+
pinmux = <K3_PINMUX(0x218, PIN_OUTPUT, MUX_MODE_0)>;
42+
};
2743
};
2844

2945
&mcu_pinctrl {

boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@
8989
power-domains = <&i2c0_pd>;
9090
};
9191

92+
&mcspi0 {
93+
pinctrl-0 = <&spi0_clk &spi0_cs0 &spi0_d0 &spi0_d1>;
94+
pinctrl-names = "default";
95+
status = "okay";
96+
};
97+
9298
&adc0 {
9399
ti,vrefp = <1800>;
94100
ti,fifo = <0>;

boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ram: 256
1010
toolchain:
1111
- zephyr
1212
- gnuarmemb
13+
supported:
14+
- spi
1315
vendor: ti

dts/arm/ti/am64x_main.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@
215215
status = "disabled";
216216
};
217217

218+
mcspi0: spi@20100000 {
219+
compatible = "ti,omap-mcspi";
220+
reg = <0x20100000 0x400>;
221+
clock-frequency = <DT_FREQ_M(50)>;
222+
ti,spi-num-cs = <4>;
223+
#address-cells = <1>;
224+
#size-cells = <0>;
225+
status = "disabled";
226+
};
227+
218228
adc0: adc@28001000 {
219229
compatible = "ti,am335x-adc";
220230
reg = <0x28001000 DT_SIZE_K(1)>;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2025 Texas Instruments
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
CONFIG_SPI_LOOPBACK_MODE_LOOP=y
6+
CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=25
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2025 Texas Instruments
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <freq.h>
8+
9+
&mcspi0 {
10+
slow@0 {
11+
compatible = "test-spi-loopback-slow";
12+
reg = <0>;
13+
spi-max-frequency = <DT_FREQ_K(500)>;
14+
};
15+
16+
fast@0 {
17+
compatible = "test-spi-loopback-fast";
18+
reg = <0>;
19+
spi-max-frequency = <DT_FREQ_M(50)>;
20+
};
21+
};

0 commit comments

Comments
 (0)