Skip to content

Commit 68a9208

Browse files
duynguyenxakartben
authored andcommitted
boards: renesas: ra: Add Ethernet support for RA8 boards
Enable Ethernet controller node and mdio node for RA boards. Add pinctl for mdio and Ethernet usage Signed-off-by: Duy Nguyen <[email protected]>
1 parent 6b287b0 commit 68a9208

File tree

12 files changed

+166
-4
lines changed

12 files changed

+166
-4
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_EK_RA8D1
5+
6+
if NETWORKING
7+
8+
config NET_L2_ETHERNET
9+
default y
10+
11+
endif # NETWORKING
12+
13+
endif # BOARD_EK_RA8D1

boards/renesas/ek_ra8d1/doc/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board:
112112
+--------------+------------+------------------+
113113
| I2C | on-chip | i2c |
114114
+--------------+------------+------------------+
115+
| ETHERNET | on-chip | ethernet |
116+
+--------------+------------+------------------+
117+
118+
**Note:** for using Ethernet on RA8D1 board please set switch SW1 as following configuration:
119+
120+
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
121+
| SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C |
122+
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
123+
| OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF |
124+
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
125+
126+
**CAUTION:** Do not enable SW1-4 and SW1-5 together
115127

116128
Other hardware features are currently not supported by the port.
117129

boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
spi0_default: spi0_default {
2020
group1 {
2121
/* MISO MOSI RSPCK SSL */
22-
psels = <RA_PSEL(RA_PSEL_SPI, 7, 0)>,
23-
<RA_PSEL(RA_PSEL_SPI, 7, 1)>,
24-
<RA_PSEL(RA_PSEL_SPI, 7, 2)>,
25-
<RA_PSEL(RA_PSEL_SPI, 7, 3)>;
22+
psels = <RA_PSEL(RA_PSEL_SPI, 4, 10)>,
23+
<RA_PSEL(RA_PSEL_SPI, 4, 11)>,
24+
<RA_PSEL(RA_PSEL_SPI, 4, 12)>,
25+
<RA_PSEL(RA_PSEL_SPI, 4, 13)>;
2626
};
2727
};
2828

@@ -53,4 +53,21 @@
5353
drive-strength = "medium";
5454
};
5555
};
56+
57+
ether_default: ether_default {
58+
group1 {
59+
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>, /* ET0_MDC */
60+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>, /* ET0_MDIO */
61+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>, /* ET0_LINKSTA */
62+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>, /* RMII0_TXD_EN_B */
63+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>, /* RMII0_TXD1_BR */
64+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>, /* RMII0_TXD0_B */
65+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>, /* REF50CK0_B */
66+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>, /* RMII0_RXD0_B */
67+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>, /* RMII0_RXD1_B */
68+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>, /* RMII0_RX_ER_B */
69+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>; /* RMII0_CRS_DV_B */
70+
drive-strength = "high";
71+
};
72+
};
5673
};

boards/renesas/ek_ra8d1/ek_ra8d1.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,21 @@
160160
pinctrl-0 = <&iic1_default>;
161161
pinctrl-names = "default";
162162
};
163+
164+
&eth {
165+
local-mac-address = [74 90 50 B0 5D E9];
166+
status = "okay";
167+
phy-handle = <&phy>;
168+
};
169+
170+
&mdio {
171+
pinctrl-0 = <&ether_default>;
172+
pinctrl-names = "default";
173+
status = "okay";
174+
175+
phy: ethernet-phy@5 {
176+
compatible = "ethernet-phy";
177+
reg = <5>;
178+
status = "okay";
179+
};
180+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_EK_RA8M1
5+
6+
if NETWORKING
7+
8+
config NET_L2_ETHERNET
9+
default y
10+
11+
endif # NETWORKING
12+
13+
endif # BOARD_EK_RA8M1

boards/renesas/ek_ra8m1/doc/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board:
112112
+-----------+------------+----------------------+
113113
| CAN | on-chip | canfd |
114114
+-----------+------------+----------------------+
115+
| ETHERNET | on-chip | ethernet |
116+
+-----------+------------+----------------------+
117+
118+
**Note:** For using Ethernet module on EK-RA8M1, remove jumper J61 to enable Ethernet B
115119

116120
Other hardware features are currently not supported by the port.
117121

boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,21 @@
9797
drive-strength = "high";
9898
};
9999
};
100+
101+
ether_default: ether_default {
102+
group1 {
103+
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>, /* ET0_MDC */
104+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>, /* ET0_MDIO */
105+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>, /* ET0_LINKSTA */
106+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>, /* RMII0_TXD_EN_B */
107+
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>, /* RMII0_TXD1_BR */
108+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>, /* RMII0_TXD0_B */
109+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>, /* REF50CK0_B */
110+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>, /* RMII0_RXD0_B */
111+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>, /* RMII0_RXD1_B */
112+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>, /* RMII0_RX_ER_B */
113+
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>; /* RMII0_CRS_DV_B */
114+
drive-strength = "high";
115+
};
116+
};
100117
};

boards/renesas/ek_ra8m1/ek_ra8m1.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,21 @@ pmod2_serial: &uart2 {};
287287

288288
pmod_serial: &pmod1_serial {};
289289
pmod_header: &pmod1_header {};
290+
291+
&eth {
292+
local-mac-address = [74 90 50 B0 6D 5A];
293+
status = "okay";
294+
phy-handle = <&phy>;
295+
};
296+
297+
&mdio {
298+
pinctrl-0 = <&ether_default>;
299+
pinctrl-names = "default";
300+
status = "okay";
301+
302+
phy: ethernet-phy@5 {
303+
compatible = "ethernet-phy";
304+
reg = <5>;
305+
status = "okay";
306+
};
307+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_MCK_RA8T1
5+
6+
if NETWORKING
7+
8+
config NET_L2_ETHERNET
9+
default y
10+
11+
endif # NETWORKING
12+
13+
endif # BOARD_MCK_RA8T1

boards/renesas/mck_ra8t1/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board:
110110
+--------------+------------+----------------------+
111111
| I2C | on-chip | i2c |
112112
+--------------+------------+----------------------+
113+
| ETHERNET | on-chip | ethernet |
114+
+--------------+------------+----------------------+
113115

114116
Other hardware features are currently not supported by the port.
115117

0 commit comments

Comments
 (0)