[PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver

Lukasz Majewski posted 4 patches 8 months, 3 weeks ago
There is a newer version of this series
.../bindings/net/nxp,imx287-mtip-switch.yaml  |  154 ++
MAINTAINERS                                   |    7 +
arch/arm/boot/dts/nxp/mxs/imx28-xea.dts       |   54 +
arch/arm/boot/dts/nxp/mxs/imx28.dtsi          |    8 +-
drivers/net/ethernet/freescale/Kconfig        |    1 +
drivers/net/ethernet/freescale/Makefile       |    1 +
drivers/net/ethernet/freescale/mtipsw/Kconfig |   13 +
.../net/ethernet/freescale/mtipsw/Makefile    |    3 +
.../net/ethernet/freescale/mtipsw/mtipl2sw.c  | 1964 +++++++++++++++++
.../net/ethernet/freescale/mtipsw/mtipl2sw.h  |  780 +++++++
.../ethernet/freescale/mtipsw/mtipl2sw_br.c   |  113 +
.../ethernet/freescale/mtipsw/mtipl2sw_mgnt.c |  449 ++++
12 files changed, 3545 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/nxp,imx287-mtip-switch.yaml
create mode 100644 drivers/net/ethernet/freescale/mtipsw/Kconfig
create mode 100644 drivers/net/ethernet/freescale/mtipsw/Makefile
create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw.c
create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw.h
create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw_br.c
create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw_mgnt.c
[PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver
Posted by Lukasz Majewski 8 months, 3 weeks ago
This patch series adds support for More Than IP's L2 switch driver embedded
in some NXP's SoCs. This one has been tested on imx287, but is also available
in the vf610.

In the past there has been performed some attempts to upstream this driver:
1. The 4.19-cip based one [1]
2. DSA based one for 5.12 [2] - i.e. the switch itself was treat as a DSA switch
   with NO tag appended.
3. The extension for FEC driver for 5.12 [3] - the trick here was to fully reuse
   FEC when the in-HW switching is disabled. When bridge offloading is enabled,
   the driver uses already configured MAC and PHY to also configure PHY.

All three approaches were not accepted as eligible for upstreaming.

The driver from this series has floowing features:

1. It is fully separated from fec_main - i.e. can be used interchangeable
   with it. To be more specific - one can build them as modules and
   if required switch between them when e.g. bridge offloading is required.

   To be more specific:
        - Use FEC_MAIN: When one needs support for two ETH ports with separate
          uDMAs used for both and bridging can be realized in SW.

        - Use MTIPL2SW: When it is enough to support two ports with only uDMA0
          attached to switch and bridging shall be offloaded to HW. 

2. This driver uses MTIP's L2 switch internal VLAN feature to provide port
   separation at boot time. Port separation is disabled when bridging is
   required.

3. Example usage:
        Configuration:
        ip link set lan0 up; sleep 1;
        ip link set lan1 up; sleep 1;
        ip link add name br0 type bridge;
        ip link set br0 up; sleep 1;
        ip link set lan0 master br0;
        ip link set lan1 master br0;
        bridge link;
        ip addr add 192.168.2.17/24 dev br0;
        ping -c 5 192.168.2.222

        Removal:
        ip link set br0 down;
        ip link delete br0 type bridge;
        ip link set dev lan1 down
        ip link set dev lan0 down

4. Limitations:
        - Driver enables and disables switch operation with learning and ageing.
        - Missing is the advanced configuration (e.g. adding entries to FBD). This is
          on purpose, as up till now we didn't had consensus about how the driver
          shall be added to Linux.

Links:
[1] - https://github.com/lmajewski/linux-imx28-l2switch/commits/master
[2] - https://github.com/lmajewski/linux-imx28-l2switch/tree/imx28-v5.12-L2-upstream-RFC_v1
[3] - https://source.denx.de/linux/linux-imx28-l2switch/-/tree/imx28-v5.12-L2-upstream-switchdev-RFC_v1?ref_type=heads

Lukasz Majewski (4):
  dt-bindings: net: Add MTIP L2 switch description
  ARM: dts: nxp: mxs: Adjust the imx28.dtsi L2 switch description
  ARM: dts: nxp: mxs: Adjust XEA board's DTS to support L2 switch
  net: mtip: The L2 switch driver for imx287

 .../bindings/net/nxp,imx287-mtip-switch.yaml  |  154 ++
 MAINTAINERS                                   |    7 +
 arch/arm/boot/dts/nxp/mxs/imx28-xea.dts       |   54 +
 arch/arm/boot/dts/nxp/mxs/imx28.dtsi          |    8 +-
 drivers/net/ethernet/freescale/Kconfig        |    1 +
 drivers/net/ethernet/freescale/Makefile       |    1 +
 drivers/net/ethernet/freescale/mtipsw/Kconfig |   13 +
 .../net/ethernet/freescale/mtipsw/Makefile    |    3 +
 .../net/ethernet/freescale/mtipsw/mtipl2sw.c  | 1964 +++++++++++++++++
 .../net/ethernet/freescale/mtipsw/mtipl2sw.h  |  780 +++++++
 .../ethernet/freescale/mtipsw/mtipl2sw_br.c   |  113 +
 .../ethernet/freescale/mtipsw/mtipl2sw_mgnt.c |  449 ++++
 12 files changed, 3545 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/nxp,imx287-mtip-switch.yaml
 create mode 100644 drivers/net/ethernet/freescale/mtipsw/Kconfig
 create mode 100644 drivers/net/ethernet/freescale/mtipsw/Makefile
 create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw.c
 create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw.h
 create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw_br.c
 create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw_mgnt.c

-- 
2.39.5
Re: [PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver
Posted by Jakub Kicinski 8 months, 3 weeks ago
On Mon, 31 Mar 2025 12:31:12 +0200 Lukasz Majewski wrote:
> This patch series adds support for More Than IP's L2 switch driver embedded
> in some NXP's SoCs. This one has been tested on imx287, but is also available
> in the vf610.

Lukasz, please post with RFC in the subject tags during the merge
window. As I already said net-next is closed.
Re: [PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver
Posted by Lukasz Majewski 8 months, 3 weeks ago
Hi Jakub,

> On Mon, 31 Mar 2025 12:31:12 +0200 Lukasz Majewski wrote:
> > This patch series adds support for More Than IP's L2 switch driver
> > embedded in some NXP's SoCs. This one has been tested on imx287,
> > but is also available in the vf610.  
> 
> Lukasz, please post with RFC in the subject tags during the merge
> window. As I already said net-next is closed.

Ach, Ok.

I hope, that we will finish all reviews till 07.04, so v4 would be the
final version.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
Re: [PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver
Posted by Stefan Wahren 8 months, 3 weeks ago
Hi Lukasz,

Am 31.03.25 um 21:11 schrieb Lukasz Majewski:
> Hi Jakub,
>
>> On Mon, 31 Mar 2025 12:31:12 +0200 Lukasz Majewski wrote:
>>> This patch series adds support for More Than IP's L2 switch driver
>>> embedded in some NXP's SoCs. This one has been tested on imx287,
>>> but is also available in the vf610.
>> Lukasz, please post with RFC in the subject tags during the merge
>> window. As I already said net-next is closed.
> Ach, Ok.
>
> I hope, that we will finish all reviews till 07.04, so v4 would be the
> final version.
well i appreciate your work on this driver, but this is not how it's
going to work. No version of this patch series had a review time of a
week. It's about quality not about deadlines.

Regards
Re: [PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver
Posted by Lukasz Majewski 8 months, 3 weeks ago
Hi Stefan,

> Hi Lukasz,
> 
> Am 31.03.25 um 21:11 schrieb Lukasz Majewski:
> > Hi Jakub,
> >  
> >> On Mon, 31 Mar 2025 12:31:12 +0200 Lukasz Majewski wrote:  
> >>> This patch series adds support for More Than IP's L2 switch driver
> >>> embedded in some NXP's SoCs. This one has been tested on imx287,
> >>> but is also available in the vf610.  
> >> Lukasz, please post with RFC in the subject tags during the merge
> >> window. As I already said net-next is closed.  
> > Ach, Ok.
> >
> > I hope, that we will finish all reviews till 07.04, so v4 would be
> > the final version.  
> well i appreciate your work on this driver,

Do you maintain some vf610 or imx28 devices, which would like to use L2
switch?

> but this is not how it's
> going to work. No version of this patch series had a review time of a
> week.

I just pointed out that patches would not be pulled (or anything else
would be done with them) until the merge window is re-opened.

> It's about quality not about deadlines.
> 

:-D

> Regards

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
Re: [PATCH v3 0/4] net: mtip: Add support for MTIP imx287 L2 switch driver
Posted by Stefan Wahren 8 months, 3 weeks ago
Am 31.03.25 um 23:42 schrieb Lukasz Majewski:
> Hi Stefan,
>
>> Hi Lukasz,
>>
>> Am 31.03.25 um 21:11 schrieb Lukasz Majewski:
>>> Hi Jakub,
>>>
>>>> On Mon, 31 Mar 2025 12:31:12 +0200 Lukasz Majewski wrote:
>>>>> This patch series adds support for More Than IP's L2 switch driver
>>>>> embedded in some NXP's SoCs. This one has been tested on imx287,
>>>>> but is also available in the vf610.
>>>> Lukasz, please post with RFC in the subject tags during the merge
>>>> window. As I already said net-next is closed.
>>> Ach, Ok.
>>>
>>> I hope, that we will finish all reviews till 07.04, so v4 would be
>>> the final version.
>> well i appreciate your work on this driver,
> Do you maintain some vf610 or imx28 devices, which would like to use L2
> switch?
I've have been working with some i.MX28 devices and still "maintain" one
i.MX28 platform of my employer. But it doesn't have a L2 switch.

Many years again, I tried to mainline a driver for the on-chip regulator
of i.MX28 SoC with cpufreq support at the end.

https://github.com/lategoodbye/linux-mxs-power

Regards