Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: sparx5-serdes: add function for getting the CMU index

The SERDES to CMU mapping is different on Sparx5 and lan969x. Therefore
create a function for getting the CMU index on Sparx5.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Link: https://lore.kernel.org/r/20240909-sparx5-lan969x-serdes-driver-v2-5-d695bcb57b84@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Daniel Machon and committed by
Vinod Koul
f16df057 d61d42a9

+11 -9
+2 -9
drivers/phy/microchip/sparx5_serdes.c
··· 28 28 /* Optimal power settings from GUC */ 29 29 #define SPX5_SERDES_QUIET_MODE_VAL 0x01ef4e0c 30 30 31 - enum sparx5_10g28cmu_mode { 32 - SPX5_SD10G28_CMU_MAIN = 0, 33 - SPX5_SD10G28_CMU_AUX1 = 1, 34 - SPX5_SD10G28_CMU_AUX2 = 3, 35 - SPX5_SD10G28_CMU_NONE = 4, 36 - SPX5_SD10G28_CMU_MAX, 37 - }; 38 - 39 31 enum sparx5_sd25g28_mode_preset_type { 40 32 SPX5_SD25G28_MODE_PRESET_25000, 41 33 SPX5_SD25G28_MODE_PRESET_10000, ··· 1640 1648 if (params->skip_cmu_cfg) 1641 1649 return 0; 1642 1650 1643 - cmu_idx = sparx5_serdes_cmu_get(params->cmu_sel, lane_index); 1651 + cmu_idx = priv->data->ops.serdes_cmu_get(params->cmu_sel, macro->sidx); 1644 1652 err = sparx5_cmu_cfg(priv, cmu_idx); 1645 1653 if (err) 1646 1654 return err; ··· 2512 2520 }, 2513 2521 .ops = { 2514 2522 .serdes_type_set = &sparx5_serdes_type_set, 2523 + .serdes_cmu_get = &sparx5_serdes_cmu_get, 2515 2524 }, 2516 2525 }; 2517 2526
+9
drivers/phy/microchip/sparx5_serdes.h
··· 26 26 SPX5_SD_MODE_SFI, 27 27 }; 28 28 29 + enum sparx5_10g28cmu_mode { 30 + SPX5_SD10G28_CMU_MAIN = 0, 31 + SPX5_SD10G28_CMU_AUX1 = 1, 32 + SPX5_SD10G28_CMU_AUX2 = 3, 33 + SPX5_SD10G28_CMU_NONE = 4, 34 + SPX5_SD10G28_CMU_MAX, 35 + }; 36 + 29 37 struct sparx5_serdes_macro { 30 38 struct sparx5_serdes_private *priv; 31 39 u32 sidx; ··· 52 44 53 45 struct sparx5_serdes_ops { 54 46 void (*serdes_type_set)(struct sparx5_serdes_macro *macro, int sidx); 47 + int (*serdes_cmu_get)(enum sparx5_10g28cmu_mode mode, int sd_index); 55 48 }; 56 49 57 50 struct sparx5_serdes_match_data {