mbox series

[U-Boot,RFC,0/2] Add a driver for the Felix Ethernet switch on NXP LS1028A

Message ID 20190808160749.20617-1-alexandru.marginean@nxp.com
Headers show
Series Add a driver for the Felix Ethernet switch on NXP LS1028A | expand

Message

Alexandru Marginean Aug. 8, 2019, 4:07 p.m. UTC
The driver sets up the switch during probe making external and internal ports
available to use.  It does not support direct I/O through these switch ports
in this version and I'm not sure that is a feature useful in U-Boot.  Instead
ENETC ethernet interfaces that are internally linked to the switch can be used
after the switch is set up.

This is where the RFC part comes in.  Both the switch as a device and its ports
are probed as ethernet devices.  That's handy as accessors to connect to the PHY
can be used but otherwise they are useful as the user can't ping to these
interfaces.  I'd like to get some feedback on whether this is acceptable or
instead I should use some other structure for describing the switch and its
ports, maybe have a new DM uclass.  Other switch devices are registered as PHYs
but that's not too useful if the external ports of the switch have PHYs of their
own and they need to be driven too.

Using a complete DTS the switch looks like this:

=> dm tree
 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
....
 pci          2  [ + ]   pci_generic_ecam      |-- pcie@1f0000000
 eth          1  [ + ]   enetc_eth             |   |-- enetc-0
 eth          2  [ + ]   enetc_eth             |   |-- enetc-1
 eth          3  [ + ]   enetc_eth             |   |-- enetc-2
 mdio         5  [ + ]   enetc_mdio            |   |-- emdio-3
 pci_generi   0  [   ]   pci_generic_drv       |   |-- pci_3:0.4
 eth          4  [ + ]   felix_ethsw           |   |-- felix_ethsw
 eth          6  [ + ]   felix-port            |   |   |-- port@0
 eth          7  [ + ]   felix-port            |   |   |-- port@1
 eth          8  [ + ]   felix-port            |   |   |-- port@2
 eth          9  [ + ]   felix-port            |   |   |-- port@3
 eth         10  [ + ]   felix-port            |   |   |-- port@4
 eth         11  [ + ]   felix-port            |   |   `-- port@5
 eth          5  [ + ]   enetc_eth             |   |-- enetc-6
 pci_generi   1  [   ]   pci_generic_drv       |   `-- pci_3:1f.0

=> mdio list
felix_ethsw:
emdio-3:
mdio@50:
0 - Aquantia AQR412 <--> port@0
1 - Aquantia AQR412 <--> port@1
2 - Aquantia AQR412 <--> port@2
3 - Aquantia AQR412 <--> port@3
mdio@00:
5 - AR8035 <--> enetc-1
mdio@40:
2 - Aquantia AQR112 <--> enetc-0
mdio@60:
mdio@70:

Any feedback is welcome, of course :)

Thank you!
Alex

Depends on https://patchwork.ozlabs.org/project/uboot/list/?series=123813


Alex Marginean (2):
  drivers: net: Add a driver for the Felix Ethernet switch on NXP
    LS1028A
  arm: dts: ls1028a: add node for the integrated Ethernet switch

 arch/arm/dts/fsl-ls1028a.dtsi |  31 +++
 drivers/net/Kconfig           |   7 +
 drivers/net/Makefile          |   1 +
 drivers/net/fsl_enetc.h       |   5 +
 drivers/net/fsl_felix.c       | 414 ++++++++++++++++++++++++++++++++++
 5 files changed, 458 insertions(+)
 create mode 100644 drivers/net/fsl_felix.c

Comments

Alexandru Marginean Aug. 8, 2019, 7:18 p.m. UTC | #1
On 8/8/2019 7:07 PM, Alex Marginean wrote:
> The driver sets up the switch during probe making external and internal ports
> available to use.  It does not support direct I/O through these switch ports
> in this version and I'm not sure that is a feature useful in U-Boot.  Instead
> ENETC ethernet interfaces that are internally linked to the switch can be used
> after the switch is set up.
> 
> This is where the RFC part comes in.  Both the switch as a device and its ports
> are probed as ethernet devices.  That's handy as accessors to connect to the PHY
> can be used but otherwise they are useful as the user can't ping to these
^ I mean to say useless, not useful :)

> interfaces.  I'd like to get some feedback on whether this is acceptable or
> instead I should use some other structure for describing the switch and its
> ports, maybe have a new DM uclass.  Other switch devices are registered as PHYs
> but that's not too useful if the external ports of the switch have PHYs of their
> own and they need to be driven too.
> 
> Using a complete DTS the switch looks like this:
> 
> => dm tree
>   Class     Index  Probed  Driver                Name
> -----------------------------------------------------------
> ....
>   pci          2  [ + ]   pci_generic_ecam      |-- pcie@1f0000000
>   eth          1  [ + ]   enetc_eth             |   |-- enetc-0
>   eth          2  [ + ]   enetc_eth             |   |-- enetc-1
>   eth          3  [ + ]   enetc_eth             |   |-- enetc-2
>   mdio         5  [ + ]   enetc_mdio            |   |-- emdio-3
>   pci_generi   0  [   ]   pci_generic_drv       |   |-- pci_3:0.4
>   eth          4  [ + ]   felix_ethsw           |   |-- felix_ethsw
>   eth          6  [ + ]   felix-port            |   |   |-- port@0
>   eth          7  [ + ]   felix-port            |   |   |-- port@1
>   eth          8  [ + ]   felix-port            |   |   |-- port@2
>   eth          9  [ + ]   felix-port            |   |   |-- port@3
>   eth         10  [ + ]   felix-port            |   |   |-- port@4
>   eth         11  [ + ]   felix-port            |   |   `-- port@5
>   eth          5  [ + ]   enetc_eth             |   |-- enetc-6
>   pci_generi   1  [   ]   pci_generic_drv       |   `-- pci_3:1f.0
> 
> => mdio list
> felix_ethsw:
> emdio-3:
> mdio@50:
> 0 - Aquantia AQR412 <--> port@0
> 1 - Aquantia AQR412 <--> port@1
> 2 - Aquantia AQR412 <--> port@2
> 3 - Aquantia AQR412 <--> port@3
> mdio@00:
> 5 - AR8035 <--> enetc-1
> mdio@40:
> 2 - Aquantia AQR112 <--> enetc-0
> mdio@60:
> mdio@70:
> 
> Any feedback is welcome, of course :)
> 
> Thank you!
> Alex
> 
> Depends on https://patchwork.ozlabs.org/project/uboot/list/?series=123813
> 
> 
> Alex Marginean (2):
>    drivers: net: Add a driver for the Felix Ethernet switch on NXP
>      LS1028A
>    arm: dts: ls1028a: add node for the integrated Ethernet switch
> 
>   arch/arm/dts/fsl-ls1028a.dtsi |  31 +++
>   drivers/net/Kconfig           |   7 +
>   drivers/net/Makefile          |   1 +
>   drivers/net/fsl_enetc.h       |   5 +
>   drivers/net/fsl_felix.c       | 414 ++++++++++++++++++++++++++++++++++
>   5 files changed, 458 insertions(+)
>   create mode 100644 drivers/net/fsl_felix.c
>