Skip to content

Commit

Permalink
drivers: ethernet: Initial support for Ethernet driver for RA8
Browse files Browse the repository at this point in the history
Add minimal support for ethernet driver use FSP on EK-RA8M1,
EK-RA8D1 and MCK-RA8T1

Signed-off-by: Tri Nguyen <[email protected]>
Signed-off-by: Thao Luong <[email protected]>
  • Loading branch information
thaoluonguw committed Sep 23, 2024
1 parent f61b8f9 commit b8d2bdf
Show file tree
Hide file tree
Showing 26 changed files with 765 additions and 0 deletions.
14 changes: 14 additions & 0 deletions boards/renesas/ek_ra8d1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,23 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board:
+--------------+------------+------------------+
| FLASH | on-chip | flash |
+--------------+------------+------------------+
| ETHERNET | on-chip | ethernet |
+--------------+------------+------------------+

Other hardware features are currently not supported by the port.

**Note:**

ETHERNET B is default support. Set the configuration switches (SW1) as below to enable ETHERNET B.

+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
| 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.

Programming and Debugging
*************************

Expand Down
58 changes: 58 additions & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,62 @@
<RA_PSEL(RA_PSEL_SPI, 7, 3)>;
};
};

ether_default: ether_default {
group1 {
/* ET0_MDC */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>;
drive-strength = "medium";
};
group2 {
/* ET0_MDIO */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>;
drive-strength = "medium";
};
group3 {
/* ET0_LINKSTA */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>;
drive-strength = "high";
};
group5 {
/* RMII0_TXD_EN */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>;
drive-strength = "high";
};
group6 {
/* RMII0_TXD1 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>;
drive-strength = "high";
};
group7 {
/* RMII0_TXD0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>;
drive-strength = "high";
};
group8 {
/* REF50CK0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>;
drive-strength = "high";
};
group9 {
/* RMII0_RXD0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>;
drive-strength = "high";
};
group10 {
/* RMII0_RXD1 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>;
drive-strength = "high";
};
group11 {
/* RMII0_RX_ER */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>;
drive-strength = "high";
};
group12 {
/* RMII0_CRS_DV */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>;
drive-strength = "high";
};
};
};
12 changes: 12 additions & 0 deletions boards/renesas/ek_ra8m1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,21 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board:
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| ETHERNET | on-chip | ethernet |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

**Note:**

ETHERNET B is default support. Remove jumper J61 to enable Ethernet B.

+--------+----------------+
| Jumper | Configurations |
+ ------ + ---------------+
| J61 | Open |
+--------+----------------+

Programming and Debugging
*************************

Expand Down
58 changes: 58 additions & 0 deletions boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,62 @@
<RA_PSEL(RA_PSEL_SPI, 4, 13)>;
};
};

ether_default: ether_default {
group1 {
/* ET0_MDC */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>;
drive-strength = "medium";
};
group2 {
/* ET0_MDIO */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>;
drive-strength = "medium";
};
group3 {
/* ET0_LINKSTA */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>;
drive-strength = "high";
};
group4 {
/* RMII0_TXD_EN */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>;
drive-strength = "high";
};
group5 {
/* RMII0_TXD1 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>;
drive-strength = "high";
};
group6 {
/* RMII0_TXD0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>;
drive-strength = "high";
};
group7 {
/* REF50CK0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>;
drive-strength = "high";
};
group8 {
/* RMII0_RXD0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>;
drive-strength = "high";
};
group9 {
/* RMII0_RXD1 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>;
drive-strength = "high";
};
group10 {
/* RMII0_RX_ER */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>;
drive-strength = "high";
};
group11 {
/* RMII0_CRS_DV */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>;
drive-strength = "high";
};
};
};
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 @@ -102,6 +102,8 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board:
+--------------+------------+----------------------+
| FLASH | on-chip | flash |
+--------------+------------+----------------------+
| ETHERNET | on-chip | ethernet |
+--------------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
58 changes: 58 additions & 0 deletions boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,62 @@
<RA_PSEL(RA_PSEL_SPI, 2, 4)>;
};
};

ether_default: ether_default {
group1 {
/* ET0_MDC */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 1)>;
drive-strength = "medium";
};
group2 {
/* ET0_MDIO */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 2)>;
drive-strength = "medium";
};
group3 {
/* ET0_LINKSTA */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 3)>;
drive-strength = "high";
};
group4 {
/* RMII0_TXD_EN */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 5)>;
drive-strength = "high";
};
group5 {
/* RMII0_TXD1 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 4, 6)>;
drive-strength = "high";
};
group6 {
/* RMII0_TXD0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 0)>;
drive-strength = "high";
};
group7 {
/* REF50CK0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 1)>;
drive-strength = "high";
};
group8 {
/* RMII0_RXD0 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 2)>;
drive-strength = "high";
};
group9 {
/* RMII0_RXD1 */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 3)>;
drive-strength = "high";
};
group10 {
/* RMII0_RX_ER */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 4)>;
drive-strength = "high";
};
group11 {
/* RMII0_CRS_DV */
psels = <RA_PSEL(RA_PSEL_ETH_RMII, 7, 5)>;
drive-strength = "high";
};
};
};
1 change: 1 addition & 0 deletions drivers/ethernet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ zephyr_library_sources_ifdef(CONFIG_ETH_IVSHMEM eth_ivshmem.c eth_ivshmem_queue
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_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 @@ -80,6 +80,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
24 changes: 24 additions & 0 deletions drivers/ethernet/Kconfig.renesas_ra
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config ETH_RENESAS_RA
bool "Renesas RA Ethernet"
default y
select USE_RA_FSP_ETHER
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 800
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

endif
Loading

0 comments on commit b8d2bdf

Please sign in to comment.