Skip to contentSkip to conversation

Updating fec driver for kernel 5.4 and I.MX8Q

PATCH Jean-Baptiste Tredez 3 participants 5 messages Apr 26, 2021 – Apr 29, 2021

lore
Share & tools
lore
#0 lore raw

Hello,

Do you have plans for updating fec drivers on xenomai 3.1 ?

We tried to merge uptream linux driver and Philippe Gerum work (commit 1b7a4bd9598aa0d777016fda7e51d2e22aa51e77). Here is the result, it seems to work on kernel 5.4 (I.MX8Q target).

Any testing / help to improve this driver is welcomed.

Jean-Baptiste

--------------------------------------------------------------------------
From: =?UTF-8?q?Jean-Baptiste=20Tr=C3=A9dez?=
<[email protected]>
Date: Mon, 26 Apr 2021 12:42:53 +0200
Subject: [PATCH] Update fec for kernel 5.4

work from :
- linux driver (rel_imx_5.4.70_2.3.0)
- Philippe Gerum work, commit 1b7a4bd9598aa0d777016fda7e51d2e22aa51e77

---
 kernel/drivers/net/drivers/Kconfig            |   11 +-
 kernel/drivers/net/drivers/Makefile           |    6 +-
 kernel/drivers/net/drivers/fec.c              | 1859 -------
 kernel/drivers/net/drivers/freescale/Makefile |    5 +
 kernel/drivers/net/drivers/freescale/fec.h    |  658 +++
 .../drivers/net/drivers/freescale/fec_main.c  | 4926 +++++++++++++++++
 .../drivers/net/drivers/freescale/fec_ptp.c   |  638 +++
 kernel/drivers/net/drivers/rt_fec.h           |  153 -
 kernel/drivers/net/stack/include/rtskb.h      |    2 +-
 kernel/drivers/net/stack/rtnet_chrdev.c       |    8 +-
 kernel/drivers/net/stack/socket.c             |    8 +-
 11 files changed, 6248 insertions(+), 2026 deletions(-)
 delete mode 100644 kernel/drivers/net/drivers/fec.c
 create mode 100644 kernel/drivers/net/drivers/freescale/Makefile
 create mode 100644 kernel/drivers/net/drivers/freescale/fec.h
 create mode 100644 kernel/drivers/net/drivers/freescale/fec_main.c
 create mode 100644 kernel/drivers/net/drivers/freescale/fec_ptp.c
 delete mode 100644 kernel/drivers/net/drivers/rt_fec.h
kernel/drivers/net/drivers/Kconfig +10 -1
index b2df1110f..e88273f27 100644
@@ -116,7 +116,7 @@ config XENO_DRIVERS_NET_DRV_SMC91111
     depends on XENO_DRIVERS_NET
     tristate "SMSC LAN91C111"
 
-if ARM
+if ARM || ARM64
 
 config XENO_DRIVERS_NET_DRV_AT91_ETHER
     depends on XENO_DRIVERS_NET && SOC_AT91RM9200
@@ -131,6 +131,15 @@ config XENO_DRIVERS_NET_DRV_MACB
     Driver for internal MAC-controller on AT91SAM926x microcontrollers.
     Porting by Cristiano Mantovani and Stefano Banzi (Marposs SpA).
 
+config XENO_DRIVERS_NET_FEC
+    depends on XENO_DRIVERS_NET
+    tristate "Freescale FEC"
+    depends on ARCH_MXC || SOC_IMX28
+    select PHYLIB
+    imply PTP_1588_CLOCK
+    ---help---
+    For built-in 10/100 Fast ethernet controller on Freescale i.MX
+    processors.
 endif
 
 source "drivers/xenomai/net/drivers/experimental/Kconfig"
kernel/drivers/net/drivers/Makefile +2 -4
index d97d5591c..03f475fd6 100644
@@ -12,6 +12,8 @@ obj-$(CONFIG_XENO_DRIVERS_NET_DRV_TULIP) += tulip/
 
 obj-$(CONFIG_XENO_DRIVERS_NET_DRV_IGB) += igb/
 
+obj-$(CONFIG_XENO_DRIVERS_NET_FEC) += freescale/
+
 obj-$(CONFIG_XENO_DRIVERS_NET_DRV_8139) += rt_8139too.o
 
 rt_8139too-y := 8139too.o
@@ -40,10 +42,6 @@ obj-$(CONFIG_XENO_DRIVERS_NET_DRV_FEC_ENET) += rt_mpc8xx_fec.o
 
 rt_mpc8xx_fec-y := mpc8xx_fec.o
 
-obj-$(CONFIG_XENO_DRIVERS_NET_DRV_FEC) += rt_fec.o
-
-rt_fec-y := fec.o
-
 obj-$(CONFIG_XENO_DRIVERS_NET_DRV_NATSEMI) += rt_natsemi.o
 
 rt_natsemi-y := natsemi.o
kernel/drivers/net/drivers/fec.c deleted +0 -1859

1,859 lines not on this page · raw message

kernel/drivers/net/drivers/freescale/Makefile new file +5 -0
new file mode 100644
index 000000000..fadab2e43
@@ -0,0 +1,5 @@
+ccflags-y += -Idrivers/xenomai/net/stack/include
+
+obj-$(CONFIG_XENO_DRIVERS_NET_FEC) += rtnet_fec.o
+
+rtnet_fec-y := fec_main.o fec_ptp.o
kernel/drivers/net/drivers/freescale/fec.h new file +658 -0

658 lines not on this page · raw message

kernel/drivers/net/drivers/freescale/fec_main.c new file +4926 -0

437 lines not on this page · raw message

kernel/drivers/net/drivers/freescale/fec_ptp.c new file +638 -0

638 lines not on this page · raw message

kernel/drivers/net/drivers/rt_fec.h deleted +0 -153

153 lines not on this page · raw message

kernel/drivers/net/stack/include/rtskb.h +1 -1
index 522b66715..916f16091 100644

Lines of this file are not shown. View the raw message.

kernel/drivers/net/stack/rtnet_chrdev.c +4 -4
index 9457661a1..782be5728 100644

Lines of this file are not shown. View the raw message.

kernel/drivers/net/stack/socket.c +4 -4
index f030663be..8d6b7a709 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.17.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 10 lines · Jean-Baptiste Tredez via Xenomai

Hello,

Do you have plans for updating fec drivers on xenomai 3.1 ?

We tried to merge uptream linux driver and Philippe Gerum work (commit 1b7a4bd9598aa0d777016fda7e51d2e22aa51e77). Here is the result, it seems to work on kernel 5.4 (I.MX8Q target).

Any testing / help to improve this driver is welcomed.

Unfortunately, the change you shared is massive and does not apply at all to Xenomai (you patched in the kernel tree, not in Xenomai). Could you rebase over next and provide that as patch for review?

I do not have any test targets, so we would definitely need feedback from other users if there are no regressions. But as the change is so significant, that will likely remain a 3.2 topic, nothing for stable anymore (unless you can prove that current 3.1 is broken for anyone).

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 12 lines · Jan Kiszka via Xenomai
Quoted 10 lines · Jean-Baptiste Tredez via Xenomai

Hello,

Do you have plans for updating fec drivers on xenomai 3.1 ?

We tried to merge uptream linux driver and Philippe Gerum work (commit 1b7a4bd9598aa0d777016fda7e51d2e22aa51e77). Here is the result, it seems to work on kernel 5.4 (I.MX8Q target).

Any testing / help to improve this driver is welcomed.

Quoted 9 lines

Unfortunately, the change you shared is massive and does not apply at all to Xenomai (you patched in the kernel tree, not in Xenomai). Could you rebase over next and provide that as patch for review?

I do not have any test targets, so we would definitely need feedback from other users if there are no regressions. But as the change is so significant, that will likely remain a 3.2 topic, nothing for stable anymore (unless you can prove that current 3.1 is broken for anyone).

This is a complete rewrite of the RTnet driver for FEC, rebasing over 4.14.85 required just that unfortunately. This updated driver is part of a larger patch set mostly written by Gilles, I ported from Xenomai 2.6.x to 3.x some time ago. He added support for multicast and VLANs to RTnet; the code was contributed to us by iXblue (https://ixblue.com) who funded the initial development for 2.x.

It may be better to review and consider the whole set once rebased on -next at some point, since there may be some dependencies on other patches from the same set.

Signature · 1 line
Philippe.
#3 lore raw
Quoted 24 lines · Philippe Gerum via Xenomai
Quoted 12 lines · Jan Kiszka via Xenomai
Quoted 10 lines · Jean-Baptiste Tredez via Xenomai

Hello,

Do you have plans for updating fec drivers on xenomai 3.1 ?

We tried to merge uptream linux driver and Philippe Gerum work (commit 1b7a4bd9598aa0d777016fda7e51d2e22aa51e77). Here is the result, it seems to work on kernel 5.4 (I.MX8Q target).

Any testing / help to improve this driver is welcomed.

Quoted 9 lines

Unfortunately, the change you shared is massive and does not apply at all to Xenomai (you patched in the kernel tree, not in Xenomai). Could you rebase over next and provide that as patch for review?

I do not have any test targets, so we would definitely need feedback from other users if there are no regressions. But as the change is so significant, that will likely remain a 3.2 topic, nothing for stable anymore (unless you can prove that current 3.1 is broken for anyone).

Quoted 6 lines

This is a complete rewrite of the RTnet driver for FEC, rebasing over 4.14.85 required just that unfortunately. This updated driver is part of a larger patch set mostly written by Gilles, I ported from Xenomai 2.6.x to 3.x some time ago. He added support for multicast and VLANs to RTnet; the code was contributed to us by iXblue (https://ixblue.com) who funded the initial development for 2.x.

And the port to 3.x as well.

Quoted 4 lines

It may be better to review and consider the whole set once rebased on -next at some point, since there may be some dependencies on other patches from the same set.

Signature · 1 line
Philippe.
#4 lore raw

Le 27/04/2021 à 19:29, Philippe Gerum a écrit :

Quoted 24 lines
Quoted 22 lines · Philippe Gerum via Xenomai
Quoted 20 lines · Jan Kiszka via Xenomai
Quoted 10 lines · Jean-Baptiste Tredez via Xenomai

Hello,

Do you have plans for updating fec drivers on xenomai 3.1 ?

We tried to merge uptream linux driver and Philippe Gerum work (commit 1b7a4bd9598aa0d777016fda7e51d2e22aa51e77). Here is the result, it seems to work on kernel 5.4 (I.MX8Q target).

Any testing / help to improve this driver is welcomed.

Unfortunately, the change you shared is massive and does not apply at all to Xenomai (you patched in the kernel tree, not in Xenomai). Could you rebase over next and provide that as patch for review?

I do not have any test targets, so we would definitely need feedback from other users if there are no regressions. But as the change is so significant, that will likely remain a 3.2 topic, nothing for stable anymore (unless you can prove that current 3.1 is broken for anyone).

Quoted 7 lines
Quoted 6 lines

This is a complete rewrite of the RTnet driver for FEC, rebasing over 4.14.85 required just that unfortunately. This updated driver is part of a larger patch set mostly written by Gilles, I ported from Xenomai 2.6.x to 3.x some time ago. He added support for multicast and VLANs to RTnet; the code was contributed to us by iXblue (https://ixblue.com) who funded the initial development for 2.x.

And the port to 3.x as well.

On xenomai 3.1, current fec driver seems broken, XENO_DRIVERS_NET_DRV_FEC is not in kconfig (fec driver can't be selected) and indeed, if you add the option in kconfig file, the old driver does not compile for kernel 5.4.

Quoted 3 lines
Quoted 3 lines

It may be better to review and consider the whole set once rebased on -next at some point, since there may be some dependencies on other patches from the same set.

Ok, I will rebase on the whole set on next.