Skip to contentSkip to conversation

Add Realtek automotive PCIe driver

PATCH Superseded Justin Lai 2 participants 5 messages Aug 18, 2023 – Aug 21, 2023

Subsystems (3)

v5 of 30 Superseded Latest is v30 →

lore
Share & tools
lore

Justin Lai

author maintainer
#0 lore raw

v5 cover Add Realtek automotive PCIe driver

This series includes adding realtek automotive ethernet driver and adding rtase ethernet driver entry in MAINTAINERS file.

This ethernet device driver for the PCIe interface of Realtek Automotive Ethernet Switch, applicable to RTL9054, RTL9068, RTL9072, RTL9075, RTL9068, RTL9071.

v4 -> v5:
- Modify ethtool function - Remove some unnecessary code.
- Don't use inline function - Let the compiler decide.

Justin Lai (2):
net/ethernet/realtek: Add Realtek automotive PCIe driver code
MAINTAINERS: Add the rtase ethernet driver entry

 MAINTAINERS                                   |    7 +
 drivers/net/ethernet/realtek/Kconfig          |   17 +
 drivers/net/ethernet/realtek/Makefile         |    1 +
 drivers/net/ethernet/realtek/rtase/Makefile   |   10 +
 drivers/net/ethernet/realtek/rtase/rtase.h    |  391 +++
 .../net/ethernet/realtek/rtase/rtase_main.c   | 2484 +++++++++++++++++
 6 files changed, 2910 insertions(+)
 create mode 100644 drivers/net/ethernet/realtek/rtase/Makefile
 create mode 100644 drivers/net/ethernet/realtek/rtase/rtase.h
 create mode 100644 drivers/net/ethernet/realtek/rtase/rtase_main.c
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v5 1/2 net/ethernet/realtek: Add Realtek automotive PCIe driver code

This patch is to add the ethernet device driver for the PCIe interface of Realtek Automotive Ethernet Switch, applicable to RTL9054, RTL9068, RTL9072, RTL9075, RTL9068, RTL9071.

Below is a simplified block diagram of the chip and its relevant interfaces.

*************************
* *
* CPU network device *
* ____________ *
* | | *
* | PCIE Host | *
*************************
||
PCIE
||
****************************************

  *          | PCIE Endpoint |           *
  *          |---------------|           *
  *              | GMAC |                *
  *              |------|  Realtek       *
  *                 ||   RTL90xx Series  *
  *                 ||                   *
  *    _____________||______________     *
  *   |            |MAC|            |    *
  *   |            |---|            |    *
  *   |                             |    *
  *   |     Ethernet Switch Core    |    *
  *   |                             |    *
  *   |  -----             -----    |    *
  *   |  |MAC| ............|MAC|    |    *
  *   |__|___|_____________|___|____|    *
  *      |PHY| ............|PHY|         *
  *      -----             -----         *

*********||****************||***********

The block of the Realtek RTL90xx series is our entire chip architecture, the GMAC is connected to the switch core, and there is no PHY in between. In addition, this driver is mainly used to control GMAC, but does not control the switch core, so it is not the same as DSA.

---
 drivers/net/ethernet/realtek/Kconfig          |   17 +
 drivers/net/ethernet/realtek/Makefile         |    1 +
 drivers/net/ethernet/realtek/rtase/Makefile   |   10 +
 drivers/net/ethernet/realtek/rtase/rtase.h    |  391 +++
 .../net/ethernet/realtek/rtase/rtase_main.c   | 2484 +++++++++++++++++
 5 files changed, 2903 insertions(+)
 create mode 100644 drivers/net/ethernet/realtek/rtase/Makefile
 create mode 100644 drivers/net/ethernet/realtek/rtase/rtase.h
 create mode 100644 drivers/net/ethernet/realtek/rtase/rtase_main.c
drivers/net/ethernet/realtek/Kconfig +17 -0
index 93d9df55b361..0250d1c3874b 100644
@@ -113,4 +113,21 @@ config R8169
 	  To compile this driver as a module, choose M here: the module
 	  will be called r8169.  This is recommended.
 
+config RTASE
+	tristate "Realtek Automotive Switch 9054/9068/9072/9075/9068/9071 PCIe Interface support"
+	depends on PCI
+	select CRC32
+	help
+	  Say Y here if you have a Realtek Ethernet adapter belonging to
+	  the following families:
+	  RTL9054 5GBit Ethernet
+	  RTL9068 5GBit Ethernet
+	  RTL9072 5GBit Ethernet
+	  RTL9075 5GBit Ethernet
+	  RTL9068 5GBit Ethernet
+	  RTL9071 5GBit Ethernet
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called rtase.  This is recommended.
+
 endif # NET_VENDOR_REALTEK
drivers/net/ethernet/realtek/Makefile +1 -0
index 2e1d78b106b0..0c1c16f63e9a 100644
@@ -8,3 +8,4 @@ obj-$(CONFIG_8139TOO) += 8139too.o
 obj-$(CONFIG_ATP) += atp.o
 r8169-objs += r8169_main.o r8169_firmware.o r8169_phy_config.o
 obj-$(CONFIG_R8169) += r8169.o
+obj-$(CONFIG_RTASE) += rtase/
drivers/net/ethernet/realtek/rtase/Makefile new file +10 -0
new file mode 100644
index 000000000000..5205bd330041
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved.
+
+#
+# Makefile for the Realtek PCIe driver
+#
+
+obj-$(CONFIG_RTASE) += rtase.o
+
+rtase-objs := rtase_main.o
drivers/net/ethernet/realtek/rtase/rtase.h new file +391 -0

391 lines not on this page · raw message

drivers/net/ethernet/realtek/rtase/rtase_main.c new file +2484 -0

2,484 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH net-next v5 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code

Fri, Aug 18, 2023 at 01:55:00PM CEST, [email protected] wrote:
V>This patch is to add the ethernet device driver for the PCIe interface of Realtek Automotive Ethernet Switch,

Quoted 37 lines

applicable to RTL9054, RTL9068, RTL9072, RTL9075, RTL9068, RTL9071.

Below is a simplified block diagram of the chip and its relevant interfaces.

*************************
* *
* CPU network device *
* ____________ *
* | | *
* | PCIE Host | *
*************************
||
PCIE
||
****************************************

 *          | PCIE Endpoint |           *
 *          |---------------|           *
 *              | GMAC |                *
 *              |------|  Realtek       *
 *                 ||   RTL90xx Series  *
 *                 ||                   *
 *    _____________||______________     *
 *   |            |MAC|            |    *
 *   |            |---|            |    *
 *   |                             |    *
 *   |     Ethernet Switch Core    |    *
 *   |                             |    *
 *   |  -----             -----    |    *
 *   |  |MAC| ............|MAC|    |    *
 *   |__|___|_____________|___|____|    *
 *      |PHY| ............|PHY|         *
 *      -----             -----         *

*********||****************||***********

The block of the Realtek RTL90xx series is our entire chip architecture, the GMAC is connected to the switch core, and there is no PHY in between. In addition, this driver is mainly used to control GMAC, but does not control the switch core, so it is not the same as DSA.

[..]

drivers/net/ethernet/realtek/rtase/rtase.h line 15

Quoted 5 lines
drivers/net/ethernet/realtek/rtase/rtase.h new file +5 -0
+
+#define NETIF_F_ALL_CSUM NETIF_F_CSUM_MASK
+
+#define NETIF_F_HW_VLAN_RX NETIF_F_HW_VLAN_CTAG_RX
+#define NETIF_F_HW_VLAN_TX NETIF_F_HW_VLAN_CTAG_TX

[..]

I see 3 essentials wrong from 10sec review:
1) You don't cc people who commented your previous versions
2) You don't respect 72cols for patch description text (checkpatch did warn you, didn't it?)
3) You are defining very odd macros like these 3

No need to read any longer... Really, can't you please ask someone who knows to help you with the submission preparation? You are vasting time of people :/

author maintainer
#3 lore raw

RE: [PATCH net-next v5 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code

Quoted 53 lines

Fri, Aug 18, 2023 at 01:55:00PM CEST, [email protected] wrote:
V>This patch is to add the ethernet device driver for the PCIe interface V>of Realtek Automotive Ethernet Switch,

Quoted 32 lines

applicable to RTL9054, RTL9068, RTL9072, RTL9075, RTL9068, RTL9071.

Below is a simplified block diagram of the chip and its relevant interfaces.

*************************
* *
* CPU network device *
* ____________ *
* | | *
* | PCIE Host | *
*************************
||
PCIE
||
****************************************

 *          | PCIE Endpoint |           *
 *          |---------------|           *
 *              | GMAC |                *
 *              |------|  Realtek       *
 *                 ||   RTL90xx Series  *
 *                 ||                   *
 *    _____________||______________     *
 *   |            |MAC|            |    *
 *   |            |---|            |    *
 *   |                             |    *
 *   |     Ethernet Switch Core    |    *
 *   |                             |    *
 *   |  -----             -----    |    *
 *   |  |MAC| ............|MAC|    |    *
 *   |__|___|_____________|___|____|    *
 *      |PHY| ............|PHY|         *
 *      -----             -----         *
Quoted 5 lines

*********||****************||***********

The block of the Realtek RTL90xx series is our entire chip architecture, the GMAC is connected to the switch core, and there is no PHY in between. In addition, this driver is mainly used to control GMAC, but

does not control the switch core, so it is not the same as DSA.

[..]

Quoted 5 lines
drivers/net/ethernet/realtek/rtase/rtase.h new file +5 -0
+
+#define NETIF_F_ALL_CSUM NETIF_F_CSUM_MASK
+
+#define NETIF_F_HW_VLAN_RX NETIF_F_HW_VLAN_CTAG_RX #define
+NETIF_F_HW_VLAN_TX NETIF_F_HW_VLAN_CTAG_TX

[..]

Quoted 9 lines

I see 3 essentials wrong from 10sec review:
1) You don't cc people who commented your previous versions
2) You don't respect 72cols for patch description text (checkpatch did warn you, didn't it?)
3) You are defining very odd macros like these 3

No need to read any longer... Really, can't you please ask someone who knows to help you with the submission preparation? You are vasting time of people :/

Thank you for your reply, I will re-check this driver and the content you mentioned above.

author maintainer
#4 lore raw

PATCH v5 2/2 MAINTAINERS: Add the rtase ethernet driver entry

In reply to Justin Lai

Add myself and Larry Chiu as the maintainer for the rtase ethernet driver.

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index 53b7ca804465..239aae94dc0f 100644
@@ -18476,6 +18476,13 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/tty/rpmsg_tty.c
 
+RTASE ETHERNET DRIVER
+M:	Justin Lai <[email protected]>
+M:	Larry Chiu <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/net/ethernet/realtek/rtase/
+
 RTL2830 MEDIA DRIVER
 M:	Antti Palosaari <[email protected]>
 L:	[email protected]
Signature · 1 line
2.34.1