netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 00/11] Enable SGMII and 2500BASEX interface mode switching for Intel platforms
@ 2024-01-29 13:02 Choong Yong Liang
  2024-01-29 13:02 ` [PATCH net-next v4 01/11] net: phylink: publish ethtool link modes that supported and advertised Choong Yong Liang
                   ` (10 more replies)
  0 siblings, 11 replies; 24+ messages in thread
From: Choong Yong Liang @ 2024-01-29 13:02 UTC (permalink / raw)
  To: Rajneesh Bhardwaj, David E Box, Hans de Goede, Mark Gross,
	Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Richard Cochran,
	Russell King, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Andrew Lunn,
	Heiner Kallweit, Philipp Zabel
  Cc: Andrew Halaney, Simon Horman, Serge Semin, netdev, linux-kernel,
	linux-stm32, linux-arm-kernel, platform-driver-x86, linux-hwmon,
	bpf, Voon Wei Feng, Michael Sit Wei Hong, Lai Peter Jun Ann,
	Abdul Rahim Faizal

From: Choong Yong Liang <yong.liang.choong@intel.com>

At the start of link initialization, the 'allow_switch_interface' flag is
set to true. Based on 'allow_switch_interface' flag, the interface mode is
configured to PHY_INTERFACE_MODE_NA within the 'phylink_validate_phy'
function. This setting allows all ethtool link modes that are supported and
advertised will be published. Then interface mode switching occurs based on
the selection of different link modes.

During the interface mode change, the 'phylink_major_config' function
will be triggered in phylink. The modification of the following functions
will be triggered to support the switching between SGMII and 2500BASEX
interfaces for the Intel platform.

- mac_get_pcs_neg_mode: A new function that selects the PCS negotiation
  mode according to the interface mode.
- mac_select_pcs: Destroys and creates a new PCS according to the
  interface mode.
- mac_finish: Configures the SerDes according to the interface mode.

With the above changes, the code will work as follows during the
interface mode change. The PCS and PCS negotiation mode will be selected
for PCS configuration according to the interface mode. Then, the MAC
driver will perform SerDes configuration on the 'mac_finish' based on the
interface mode. During the SerDes configuration, the selected interface
mode will identify TSN lane registers from FIA and then send IPC commands
to the Power Management Controller (PMC) through the PMC driver/API.
PMC will act as a proxy to program the PLL registers.

Change log:
v1 -> v2: 
 - Add static to pmc_lpm_modes declaration
 - Add cur_link_an_mode to the kernel doc
 - Combine 2 commits i.e. "stmmac: intel: Separate driver_data of ADL-N
 from TGL" and "net: stmmac: Add 1G/2.5G auto-negotiation
 support for ADL-N" into 1 commit.

v2 -> v3:
 - Create `pmc_ipc.c` file for `intel_pmc_ipc()` function and 
 allocate the file in `arch/x86/platform/intel/` directory.
 - Update phylink's AN mode during phy interface change and 
 not exposing phylink's AN mode into phylib.
 
 v3 -> v4:
 - Introduce `allow_switch_interface` flag to have all ethtool 
 link modes that are supported and advertised will be published.
 - Introduce `mac_get_pcs_neg_mode` function that selects the PCS 
 negotiation mode according to the interface mode.
 - Remove pcs-xpcs.c changes and handle pcs during `mac_select_pcs`
 function
 - Configure SerDes base on the interface on `mac_finish` function.

Choong Yong Liang (9):
  net: phylink: publish ethtool link modes that supported and advertised
  net: stmmac: provide allow_switch_interface flag
  net: phylink: provide mac_get_pcs_neg_mode() function
  net: phylink: add phylink_pcs_neg_mode() declaration into phylink.h
  net: stmmac: select PCS negotiation mode according to the interface
    mode
  net: stmmac: resetup XPCS according to the new interface mode
  net: stmmac: configure SerDes on mac_finish
  stmmac: intel: interface switching support for EHL platform
  stmmac: intel: interface switching support for ADL-N platform

David E. Box (1):
  arch: x86: Add IPC mailbox accessor function and add SoC register
    access

Tan, Tee Min (1):
  stmmac: intel: configure SerDes according to the interface mode

 MAINTAINERS                                   |   2 +
 arch/x86/Kconfig                              |   9 +
 arch/x86/platform/intel/Makefile              |   1 +
 arch/x86/platform/intel/pmc_ipc.c             |  75 ++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |   1 +
 .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 233 ++++++++++++++++--
 .../net/ethernet/stmicro/stmmac/dwmac-intel.h |  81 ++++++
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |   2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  48 +++-
 .../net/ethernet/stmicro/stmmac/stmmac_mdio.c |   7 +-
 drivers/net/phy/phylink.c                     |  30 ++-
 include/linux/phylink.h                       |   9 +
 .../linux/platform_data/x86/intel_pmc_ipc.h   |  34 +++
 include/linux/stmmac.h                        |   6 +
 14 files changed, 506 insertions(+), 32 deletions(-)
 create mode 100644 arch/x86/platform/intel/pmc_ipc.c
 create mode 100644 include/linux/platform_data/x86/intel_pmc_ipc.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-02-15  3:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 13:02 [PATCH net-next v4 00/11] Enable SGMII and 2500BASEX interface mode switching for Intel platforms Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 01/11] net: phylink: publish ethtool link modes that supported and advertised Choong Yong Liang
2024-01-30  9:27   ` Russell King (Oracle)
2024-01-29 13:02 ` [PATCH net-next v4 02/11] net: stmmac: provide allow_switch_interface flag Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 03/11] net: phylink: provide mac_get_pcs_neg_mode() function Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 04/11] net: phylink: add phylink_pcs_neg_mode() declaration into phylink.h Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 05/11] net: stmmac: select PCS negotiation mode according to the interface mode Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 06/11] net: stmmac: resetup XPCS according to the new " Choong Yong Liang
2024-01-30 10:21   ` Russell King (Oracle)
2024-02-01  5:10     ` Choong Yong Liang
2024-02-01  8:38       ` Russell King (Oracle)
2024-02-02  3:00         ` Choong Yong Liang
2024-02-02  8:50           ` Russell King (Oracle)
2024-02-15  3:14             ` Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 07/11] arch: x86: Add IPC mailbox accessor function and add SoC register access Choong Yong Liang
2024-01-31 10:54   ` Ilpo Järvinen
2024-02-02  3:04     ` Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 08/11] stmmac: intel: configure SerDes according to the interface mode Choong Yong Liang
2024-01-30  8:48   ` kernel test robot
2024-01-31 10:58   ` Ilpo Järvinen
2024-02-02  3:06     ` Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 09/11] net: stmmac: configure SerDes on mac_finish Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 10/11] stmmac: intel: interface switching support for EHL platform Choong Yong Liang
2024-01-29 13:02 ` [PATCH net-next v4 11/11] stmmac: intel: interface switching support for ADL-N platform Choong Yong Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).