Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: ethernet: renesas: Support Renesas RA8 Ethernet driver #77850

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions boards/renesas/ek_ra8d1/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

if BOARD_EK_RA8D1

if NETWORKING

config NET_L2_ETHERNET
default y

endif # NETWORKING

endif # BOARD_EK_RA8D1
12 changes: 12 additions & 0 deletions boards/renesas/ek_ra8d1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board:
+--------------+------------+------------------+
| I2C | on-chip | i2c |
+--------------+------------+------------------+
| ETHERNET | on-chip | ethernet |
+--------------+------------+------------------+

**Note:** for using Ethernet on RA8D1 board please set switch SW1 as following configuration:

+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
| SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C |
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
| OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF |
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+

**CAUTION:** Do not enable SW1-4 and SW1-5 together

Other hardware features are currently not supported by the port.

Expand Down
25 changes: 21 additions & 4 deletions boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
spi0_default: spi0_default {
group1 {
/* MISO MOSI RSPCK SSL */
psels = <RA_PSEL(RA_PSEL_SPI, 7, 0)>,
<RA_PSEL(RA_PSEL_SPI, 7, 1)>,
<RA_PSEL(RA_PSEL_SPI, 7, 2)>,
<RA_PSEL(RA_PSEL_SPI, 7, 3)>;
psels = <RA_PSEL(RA_PSEL_SPI, 4, 10)>,
<RA_PSEL(RA_PSEL_SPI, 4, 11)>,
<RA_PSEL(RA_PSEL_SPI, 4, 12)>,
<RA_PSEL(RA_PSEL_SPI, 4, 13)>;
};
};

Expand Down Expand Up @@ -53,4 +53,21 @@
drive-strength = "medium";
};
};

ether_default: ether_default {
group1 {
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>, /* ET0_MDC */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>, /* ET0_MDIO */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>, /* ET0_LINKSTA */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>, /* RMII0_TXD_EN_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>, /* RMII0_TXD1_BR */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>, /* RMII0_TXD0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>, /* REF50CK0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>, /* RMII0_RXD0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>, /* RMII0_RXD1_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>, /* RMII0_RX_ER_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>; /* RMII0_CRS_DV_B */
drive-strength = "high";
};
};
};
18 changes: 18 additions & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,21 @@
pinctrl-0 = <&iic1_default>;
pinctrl-names = "default";
};

&eth {
local-mac-address = [74 90 50 B0 5D E9];
status = "okay";
phy-handle = <&phy>;
};

&mdio {
pinctrl-0 = <&ether_default>;
pinctrl-names = "default";
status = "okay";

phy: ethernet-phy@5 {
compatible = "ethernet-phy";
reg = <5>;
status = "okay";
};
};
13 changes: 13 additions & 0 deletions boards/renesas/ek_ra8m1/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

if BOARD_EK_RA8M1

if NETWORKING

config NET_L2_ETHERNET
default y

endif # NETWORKING

endif # BOARD_EK_RA8M1
4 changes: 4 additions & 0 deletions boards/renesas/ek_ra8m1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board:
+-----------+------------+----------------------+
| CAN | on-chip | canfd |
+-----------+------------+----------------------+
| ETHERNET | on-chip | ethernet |
+-----------+------------+----------------------+

**Note:** For using Ethernet module on EK-RA8M1, remove jumper J61 to enable Ethernet B

Other hardware features are currently not supported by the port.

Expand Down
17 changes: 17 additions & 0 deletions boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,21 @@
drive-strength = "high";
};
};

ether_default: ether_default {
group1 {
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>, /* ET0_MDC */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>, /* ET0_MDIO */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>, /* ET0_LINKSTA */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>, /* RMII0_TXD_EN_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>, /* RMII0_TXD1_BR */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>, /* RMII0_TXD0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>, /* REF50CK0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>, /* RMII0_RXD0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>, /* RMII0_RXD1_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>, /* RMII0_RX_ER_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>; /* RMII0_CRS_DV_B */
drive-strength = "high";
};
};
};
18 changes: 18 additions & 0 deletions boards/renesas/ek_ra8m1/ek_ra8m1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,21 @@ pmod2_serial: &uart2 {};

pmod_serial: &pmod1_serial {};
pmod_header: &pmod1_header {};

&eth {
local-mac-address = [74 90 50 B0 6D 5A];
status = "okay";
phy-handle = <&phy>;
};

&mdio {
pinctrl-0 = <&ether_default>;
pinctrl-names = "default";
status = "okay";

phy: ethernet-phy@5 {
compatible = "ethernet-phy";
reg = <5>;
status = "okay";
};
};
13 changes: 13 additions & 0 deletions boards/renesas/mck_ra8t1/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

if BOARD_MCK_RA8T1

if NETWORKING

config NET_L2_ETHERNET
default y

endif # NETWORKING

endif # BOARD_MCK_RA8T1
2 changes: 2 additions & 0 deletions boards/renesas/mck_ra8t1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board:
+--------------+------------+----------------------+
| I2C | on-chip | i2c |
+--------------+------------+----------------------+
| ETHERNET | on-chip | ethernet |
+--------------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
17 changes: 17 additions & 0 deletions boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,21 @@
drive-strength = "medium";
};
};

ether_default: ether_default {
group1 {
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>, /* ET0_MDC */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>, /* ET0_MDIO */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>, /* ET0_LINKSTA */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>, /* RMII0_TXD_EN_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>, /* RMII0_TXD1_BR */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>, /* RMII0_TXD0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>, /* REF50CK0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>, /* RMII0_RXD0_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>, /* RMII0_RXD1_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>, /* RMII0_RX_ER_B */
<RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>; /* RMII0_CRS_DV_B */
drive-strength = "high";
};
};
};
18 changes: 18 additions & 0 deletions boards/renesas/mck_ra8t1/mck_ra8t1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,21 @@
pinctrl-0 = <&iic1_default>;
pinctrl-names = "default";
};

&eth {
local-mac-address = [74 90 50 6D 81 75];
status = "okay";
phy-handle = <&phy>;
};

&mdio {
pinctrl-0 = <&ether_default>;
pinctrl-names = "default";
status = "okay";

phy: ethernet-phy@5 {
compatible = "ethernet-phy";
reg = <5>;
status = "okay";
};
};
1 change: 1 addition & 0 deletions drivers/ethernet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ zephyr_library_sources_ifdef(CONFIG_ETH_ADIN2111 eth_adin2111.c)
zephyr_library_sources_ifdef(CONFIG_ETH_LAN865X eth_lan865x.c oa_tc6.c)
zephyr_library_sources_ifdef(CONFIG_ETH_XMC4XXX eth_xmc4xxx.c)
zephyr_library_sources_ifdef(CONFIG_ETH_TEST eth_test.c)
zephyr_library_sources_ifdef(CONFIG_ETH_RENESAS_RA eth_renesas_ra.c)

if(CONFIG_ETH_NXP_S32_NETC)
zephyr_library_sources(eth_nxp_s32_netc.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ source "drivers/ethernet/dwc_xgmac/Kconfig"
source "drivers/ethernet/phy/Kconfig"

source "drivers/ethernet/nxp_enet/Kconfig"
source "drivers/ethernet/Kconfig.renesas_ra"

endif # "Ethernet Drivers"

Expand Down
36 changes: 36 additions & 0 deletions drivers/ethernet/Kconfig.renesas_ra
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config ETH_RENESAS_RA
bool "Renesas RA Ethernet"
default y
depends on DT_HAS_RENESAS_RA_ETHERNET_ENABLED
select USE_RA_FSP_ETHER
maass-hamburg marked this conversation as resolved.
Show resolved Hide resolved
select MDIO
help
Enable Renesas RA Ethernet Driver.

if ETH_RENESAS_RA

config ETH_RA_RX_THREAD_STACK_SIZE
int "Stack size for internal incoming packet handler"
default 1500
help
Size of the stack used for internal thread which is ran for
incoming packet processing.

config ETH_RA_RX_THREAD_PRIORITY
int "Renesas RA Ethernet receive thread priority"
default 2

config ETH_RENESAS_TX_BUF_NUM
int "Number of Transmit buffer"
default 4
range 1 8

config ETH_RENESAS_RX_BUF_NUM
int "Number of Receive buffer"
default 4
range 1 8

endif
Loading
Loading