mbox series

[v2,net-next,00/13] New DSA driver for VSC9953 Seville switch

Message ID 20200530115142.707415-1-olteanv@gmail.com
Headers show
Series New DSA driver for VSC9953 Seville switch | expand

Message

Vladimir Oltean May 30, 2020, 11:51 a.m. UTC
From: Vladimir Oltean <vladimir.oltean@nxp.com>

Looking at the Felix and Ocelot drivers, Maxim asked if it would be
possible to use them as a base for a new driver for the Seville switch
inside NXP T1040. Turns out, it is! The result is that the mscc_felix
driver was extended to probe on Seville.

The biggest challenge seems to be getting register read/write API
generic enough to cover such wild bitfield variations between hardware
generations.

There is a trivial dependency patch on the regmap core which is in Mark
Brown's for-next tree:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?h=for-next&id=8baebfc2aca26e3fa67ab28343671b82be42b22c
I didn't know what to do with it, so I just added it here as well, as
01/13, so that net-next builds wouldn't break.

Maxim Kochetkov (4):
  soc/mscc: ocelot: add MII registers description
  net: mscc: ocelot: convert SYS_PAUSE_CFG register access to regfield
  net: mscc: ocelot: extend watermark encoding function
  net: dsa: felix: introduce support for Seville VSC9953 switch

Vladimir Oltean (9):
  regmap: add helper for per-port regfield initialization
  net: dsa: felix: set proper link speed in felix_phylink_mac_config
  net: mscc: ocelot: convert port registers to regmap
  net: mscc: ocelot: convert QSYS_SWITCH_PORT_MODE and SYS_PORT_MODE to
    regfields
  net: dsa: felix: create a template for the DSA tags on xmit
  net: mscc: ocelot: split writes to pause frame enable bit and to
    thresholds
  net: mscc: ocelot: disable flow control on NPI interface
  net: dsa: felix: support half-duplex link modes
  net: dsa: felix: move probing to felix_vsc9959.c

 .../devicetree/bindings/net/dsa/ocelot.txt    |  106 +-
 drivers/net/dsa/ocelot/Kconfig                |   12 +-
 drivers/net/dsa/ocelot/Makefile               |    3 +-
 drivers/net/dsa/ocelot/felix.c                |  269 +---
 drivers/net/dsa/ocelot/felix.h                |   22 +-
 drivers/net/dsa/ocelot/felix_vsc9959.c        |  313 ++++-
 drivers/net/dsa/ocelot/seville_vsc9953.c      | 1111 +++++++++++++++++
 drivers/net/ethernet/mscc/ocelot.c            |   86 +-
 drivers/net/ethernet/mscc/ocelot.h            |    9 +-
 drivers/net/ethernet/mscc/ocelot_board.c      |   21 +-
 drivers/net/ethernet/mscc/ocelot_io.c         |   18 +-
 drivers/net/ethernet/mscc/ocelot_regs.c       |   61 +-
 include/linux/regmap.h                        |    8 +
 include/soc/mscc/ocelot.h                     |   68 +-
 include/soc/mscc/ocelot_dev.h                 |   78 --
 include/soc/mscc/ocelot_qsys.h                |   13 -
 include/soc/mscc/ocelot_sys.h                 |   23 -
 net/dsa/tag_ocelot.c                          |   21 +-
 18 files changed, 1811 insertions(+), 431 deletions(-)
 create mode 100644 drivers/net/dsa/ocelot/seville_vsc9953.c

Comments

David Miller May 31, 2020, 1:03 a.m. UTC | #1
From: Vladimir Oltean <olteanv@gmail.com>
Date: Sat, 30 May 2020 14:51:29 +0300

> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> Looking at the Felix and Ocelot drivers, Maxim asked if it would be
> possible to use them as a base for a new driver for the Seville switch
> inside NXP T1040. Turns out, it is! The result is that the mscc_felix
> driver was extended to probe on Seville.
> 
> The biggest challenge seems to be getting register read/write API
> generic enough to cover such wild bitfield variations between hardware
> generations.
> 
> There is a trivial dependency patch on the regmap core which is in Mark
> Brown's for-next tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?h=for-next&id=8baebfc2aca26e3fa67ab28343671b82be42b22c
> I didn't know what to do with it, so I just added it here as well, as
> 01/13, so that net-next builds wouldn't break.

Looks good, series applied, thanks.
David Miller May 31, 2020, 1:08 a.m. UTC | #2
From: David Miller <davem@davemloft.net>
Date: Sat, 30 May 2020 18:03:51 -0700 (PDT)

> Looks good, series applied, thanks.

Actually, reverted, this doesn't build:

[davem@localhost net-next]$ make -s -j14
ld: drivers/net/dsa/ocelot/seville_vsc9953.o: in function `seville_driver_init':
seville_vsc9953.c:(.init.text+0x0): multiple definition of `init_module'; drivers/net/dsa/ocelot/felix_vsc9959.o:felix_vsc9959.c:(.init.text+0x0): first defined here
ld: drivers/net/dsa/ocelot/seville_vsc9953.o: in function `seville_driver_exit':
seville_vsc9953.c:(.exit.text+0x0): multiple definition of `cleanup_module'; drivers/net/dsa/ocelot/felix_vsc9959.o:felix_vsc9959.c:(.exit.text+0x0): first defined here
make[4]: *** [scripts/Makefile.build:422: drivers/net/dsa/ocelot/mscc_felix.o] Error 1
make[3]: *** [scripts/Makefile.build:488: drivers/net/dsa/ocelot] Error 2
make[2]: *** [scripts/Makefile.build:488: drivers/net/dsa] Error 2