net: stmmac: configure SerDes according to the interface mode
authorChoong Yong Liang <yong.liang.choong@linux.intel.com>
Thu, 27 Feb 2025 12:15:21 +0000 (20:15 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Mar 2025 03:02:47 +0000 (19:02 -0800)
commita42f6b3f1cc164781af144a71684d50b2d7d36f2
tree06a3d4c7d1bd2815663b91d160a5c1777082621b
parente654cfc718d451bdf6c1554efc945171239f03f5
net: stmmac: configure SerDes according to the interface mode

Intel platform will configure the SerDes through PMC API based on the
provided interface mode.

This patch adds several new functions below:-
- intel_tsn_lane_is_available(): This new function reads FIA lane
  ownership registers and common lane registers through IPC commands
  to know which lane the mGbE port is assigned to.
- intel_mac_finish(): To configure the SerDes based on the assigned
  lane and latest interface mode, it sends IPC command to the PMC through
  PMC driver/API. The PMC acts as a proxy for R/W on behalf of the driver.
- intel_set_reg_access(): Set the register access to the available TSN
  interface.

Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Link: https://patch.msgid.link/20250227121522.1802832-6-yong.liang.choong@linux.intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/Kconfig
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h