]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: sparx5: add is_sparx5 macro and use it throughout
authorDaniel Machon <daniel.machon@microchip.com>
Fri, 4 Oct 2024 13:19:40 +0000 (15:19 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 8 Oct 2024 10:07:01 +0000 (12:07 +0200)
commit4b67bcb9094e74890483e55ea2aaf2d57c4df843
tree434d68225618a8fb14dca4aa6da16da260fe170d
parenta0dd8906824b1131ad21d2d689d54628917ce8d1
net: sparx5: add is_sparx5 macro and use it throughout

We dont want to ops out each time a function needs to do some platform
specifics. In particular we have a few places, where it would be
convenient to just branch out on the platform type. Add the function
is_sparx5() and, initially, use it for:

    - register writes that should only be done on Sparx5 (QSYS_CAL_CTRL,
      CLKGEN_LCPLL1_CORE_CLK).

    - function calls that should only be done on Sparx5
      (ethtool_op_get_ts_info())

    - register writes that are chip-exclusive (MASK_CFG1/2, PGID_CFG1/2,
      these are replicated for n_ports >32 on Sparx5).

The is_sparx5() function simply checks the target chip type, to
determine if this is a Sparx5 SKU or not.

Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
drivers/net/ethernet/microchip/sparx5/sparx5_main.c
drivers/net/ethernet/microchip/sparx5/sparx5_main.h
drivers/net/ethernet/microchip/sparx5/sparx5_vlan.c