mbox series

[net-next,00/11] net: dsa: microchip: common spi probe for the ksz series switches - part 1

Message ID 20220617084255.19376-1-arun.ramadoss@microchip.com (mailing list archive)
Headers show
Series net: dsa: microchip: common spi probe for the ksz series switches - part 1 | expand

Message

Arun Ramadoss June 17, 2022, 8:42 a.m. UTC
This patch series aims to refactor the ksz_switch_register routine to have the
common flow for the ksz series switch. At present ksz8795.c & ksz9477.c have
its own dsa_switch_ops and switch detect functionality.
In ksz_switch_register, ksz_dev_ops is assigned based on the function parameter
passed by the individual ksz8/ksz9477 switch register function. And then switch
detect is performed based on the ksz_dev_ops.detect hook.  This patch modifies
the ksz_switch_register such a way that switch detect is performed first, based
on the chip ksz_dev_ops is assigned to ksz_device structure. It ensures the
common flow for the existing as well as LAN937x switches.
In the next series of patch, it will move ksz_dsa_ops and dsa_switch_ops
from ksz8795.c and ksz9477.c to ksz_common.c and have the common spi
probe all the ksz based switches.

Changes in v1
- Splitted the patch series into two.
- Replaced all occurrence of REG_PORT_STATUS_0 and PORT_FIBER_MODE to
  KSZ8_PORT_STATUS_0 and KSZ8_PORT_FIBER_MODE.
- Separated the tag protocol and phy read/write patch into two.
- Assigned the DSA_TAG_PROTO_NONE as the default value for get_tag_protocol hook.
- Reduced the indentation level by using the if(!dev->dev_ops->mirror_add).
- Added the stp_ctrl_reg as a member in ksz_chip_data and removed the member
  in ksz_dev_ops.
- Removed the r_dyn_mac_table, r_sta_mac_table and w_sta_mac_table from the
  ksz_dev_ops since it is used only in the ksz8795.c.

Changes in RFC v2
- Fixed the compilation issue.
- Reduced the patch set to 15.

Arun Ramadoss (11):
  net: dsa: microchip: ksz9477: cleanup the ksz9477_switch_detect
  net: dsa: microchip: move switch chip_id detection to ksz_common
  net: dsa: microchip: move tag_protocol to ksz_common
  net: dsa: microchip: ksz9477: use ksz_read_phy16 & ksz_write_phy16
  net: dsa: microchip: move vlan functionality to ksz_common
  net: dsa: microchip: move the port mirror to ksz_common
  net: dsa: microchip: get P_STP_CTRL in ksz_port_stp_state by
    ksz_dev_ops
  net: dsa: microchip: update the ksz_phylink_get_caps
  net: dsa: microchip: update the ksz_port_mdb_add/del
  net: dsa: microchip: update fdb add/del/dump in ksz_common
  net: dsa: microchip: move get_phy_flags & mtu to ksz_common

 drivers/net/dsa/microchip/ksz8795.c     | 233 ++++++++--------
 drivers/net/dsa/microchip/ksz8795_reg.h |  16 --
 drivers/net/dsa/microchip/ksz9477.c     | 181 +++++--------
 drivers/net/dsa/microchip/ksz9477_reg.h |   1 -
 drivers/net/dsa/microchip/ksz_common.c  | 342 ++++++++++++++++++------
 drivers/net/dsa/microchip/ksz_common.h  |  80 +++++-
 6 files changed, 517 insertions(+), 336 deletions(-)


base-commit: e8b03391b6a7353368d0d2d6ed2b5f03e0c6112f

Comments

Vladimir Oltean June 21, 2022, 11:18 a.m. UTC | #1
On Fri, Jun 17, 2022 at 02:12:44PM +0530, Arun Ramadoss wrote:
> This patch series aims to refactor the ksz_switch_register routine to have the
> common flow for the ksz series switch. At present ksz8795.c & ksz9477.c have
> its own dsa_switch_ops and switch detect functionality.
> In ksz_switch_register, ksz_dev_ops is assigned based on the function parameter
> passed by the individual ksz8/ksz9477 switch register function. And then switch
> detect is performed based on the ksz_dev_ops.detect hook.  This patch modifies
> the ksz_switch_register such a way that switch detect is performed first, based
> on the chip ksz_dev_ops is assigned to ksz_device structure. It ensures the
> common flow for the existing as well as LAN937x switches.
> In the next series of patch, it will move ksz_dsa_ops and dsa_switch_ops
> from ksz8795.c and ksz9477.c to ksz_common.c and have the common spi
> probe all the ksz based switches.
> 
> Changes in v1
> - Splitted the patch series into two.
> - Replaced all occurrence of REG_PORT_STATUS_0 and PORT_FIBER_MODE to
>   KSZ8_PORT_STATUS_0 and KSZ8_PORT_FIBER_MODE.
> - Separated the tag protocol and phy read/write patch into two.
> - Assigned the DSA_TAG_PROTO_NONE as the default value for get_tag_protocol hook.
> - Reduced the indentation level by using the if(!dev->dev_ops->mirror_add).
> - Added the stp_ctrl_reg as a member in ksz_chip_data and removed the member
>   in ksz_dev_ops.
> - Removed the r_dyn_mac_table, r_sta_mac_table and w_sta_mac_table from the
>   ksz_dev_ops since it is used only in the ksz8795.c.
> 
> Changes in RFC v2
> - Fixed the compilation issue.
> - Reduced the patch set to 15.

For the series:

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
patchwork-bot+netdevbpf@kernel.org June 21, 2022, 1:50 p.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 17 Jun 2022 14:12:44 +0530 you wrote:
> This patch series aims to refactor the ksz_switch_register routine to have the
> common flow for the ksz series switch. At present ksz8795.c & ksz9477.c have
> its own dsa_switch_ops and switch detect functionality.
> In ksz_switch_register, ksz_dev_ops is assigned based on the function parameter
> passed by the individual ksz8/ksz9477 switch register function. And then switch
> detect is performed based on the ksz_dev_ops.detect hook.  This patch modifies
> the ksz_switch_register such a way that switch detect is performed first, based
> on the chip ksz_dev_ops is assigned to ksz_device structure. It ensures the
> common flow for the existing as well as LAN937x switches.
> In the next series of patch, it will move ksz_dsa_ops and dsa_switch_ops
> from ksz8795.c and ksz9477.c to ksz_common.c and have the common spi
> probe all the ksz based switches.
> 
> [...]

Here is the summary with links:
  - [net-next,01/11] net: dsa: microchip: ksz9477: cleanup the ksz9477_switch_detect
    https://git.kernel.org/netdev/net-next/c/27faa0aa85f6
  - [net-next,02/11] net: dsa: microchip: move switch chip_id detection to ksz_common
    https://git.kernel.org/netdev/net-next/c/91a98917a883
  - [net-next,03/11] net: dsa: microchip: move tag_protocol to ksz_common
    https://git.kernel.org/netdev/net-next/c/534a0431e9e6
  - [net-next,04/11] net: dsa: microchip: ksz9477: use ksz_read_phy16 & ksz_write_phy16
    https://git.kernel.org/netdev/net-next/c/930e579083d7
  - [net-next,05/11] net: dsa: microchip: move vlan functionality to ksz_common
    https://git.kernel.org/netdev/net-next/c/f0d997e31bb3
  - [net-next,06/11] net: dsa: microchip: move the port mirror to ksz_common
    https://git.kernel.org/netdev/net-next/c/00a298bbc238
  - [net-next,07/11] net: dsa: microchip: get P_STP_CTRL in ksz_port_stp_state by ksz_dev_ops
    https://git.kernel.org/netdev/net-next/c/e593df51ffe8
  - [net-next,08/11] net: dsa: microchip: update the ksz_phylink_get_caps
    https://git.kernel.org/netdev/net-next/c/7012033ce10e
  - [net-next,09/11] net: dsa: microchip: update the ksz_port_mdb_add/del
    https://git.kernel.org/netdev/net-next/c/980c7d171d3a
  - [net-next,10/11] net: dsa: microchip: update fdb add/del/dump in ksz_common
    https://git.kernel.org/netdev/net-next/c/e587be759e6e
  - [net-next,11/11] net: dsa: microchip: move get_phy_flags & mtu to ksz_common
    https://git.kernel.org/netdev/net-next/c/1fe94f542e66

You are awesome, thank you!