netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v7 0/7] Enable SGMII and 2500BASEX interface mode switching for Intel platforms
@ 2025-02-06 13:18 Choong Yong Liang
  2025-02-06 13:18 ` [PATCH net-next v7 1/7] net: phylink: use pl->link_interface in phylink_expects_phy() Choong Yong Liang
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Choong Yong Liang @ 2025-02-06 13:18 UTC (permalink / raw)
  To: Simon Horman, Jose Abreu, Jose Abreu, David E Box,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H . Peter Anvin, Rajneesh Bhardwaj, David E Box, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maxime Coquelin, Alexandre Torgue, Jiawen Wu, Mengyuan Lou,
	Heiner Kallweit, Russell King, Hans de Goede, Ilpo Järvinen,
	Richard Cochran, Serge Semin
  Cc: x86, linux-kernel, netdev, platform-driver-x86, linux-stm32,
	linux-arm-kernel

During the interface mode change, the 'phylink_major_config' function will
be triggered in phylink. The modification of the following functions will
support the switching between SGMII and 2500BASE-X interface modes for
the Intel platform:

- xpcs_switch_interface_mode: Re-initiates clause 37 auto-negotiation for
  the SGMII interface mode to perform auto-negotiation.
- 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 will reconfigure according to the pcs_neg_mode and the
selected interface mode. Then, the MAC driver will perform SerDes
configuration in 'mac_finish' based on the selected 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. The 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.
 
 v4 -> v5:
 - remove 'allow_switch_interface' related patches.
 - remove 'mac_select_pcs' related patches.
 - add a soft reset according to XPCS datasheet for re-initiate Clause 37
 auto-negotiation when switching to SGMII interface mode.

v5 -> v6:
- Remove 'mac_get_pcs_neg_mode' related patches. 
  The pcs_neg_mode is properly handled by the
  'net: add negotiation of in-band capabilities' patch series:
  https://patchwork.kernel.org/project/netdevbpf/cover/Z08kCwxdkU4n2V6x@shell.armlinux.org.uk/
- Using act_link_an_mode to determine PHY, as cfg_link_an_mode was not
  updated for the 2500BASE-X interface mode, caused a failure to link up.
- Clean up and standardize the interface mode switch for xpcs.

v6 -> v7:
- Remove the "net: phylink: use act_link_an_mode to determine PHY" patch.
- Use pl->link_interface in phylink_expects_phy().
- Remove priv->plat->serdes_powerup in intel_tsn_lane_is_available() as it is
  always true.
- Refactor the code in intel_config_serdes().
- Rename intel_config_serdes() to intel_mac_finish() with an AN mode parameter.
- Define the magic number as "max_fia_regs".
- Store the pointer and the number of elements in the platform info structure.
- Move the arrays to the C file.

v1: https://patchwork.kernel.org/project/netdevbpf/cover/20230622041905.629430-1-yong.liang.choong@linux.intel.com/
v2: https://patchwork.kernel.org/project/netdevbpf/cover/20230804084527.2082302-1-yong.liang.choong@linux.intel.com/
v3: https://patchwork.kernel.org/project/netdevbpf/cover/20230921121946.3025771-1-yong.liang.choong@linux.intel.com/
v4: https://patchwork.kernel.org/project/netdevbpf/cover/20240129130253.1400707-1-yong.liang.choong@linux.intel.com/
v5: https://patchwork.kernel.org/project/netdevbpf/cover/20240215030500.3067426-1-yong.liang.choong@linux.intel.com/
v6: https://patchwork.kernel.org/project/netdevbpf/cover/20250204061020.1199124-1-yong.liang.choong@linux.intel.com/

Choong Yong Liang (6):
  net: phylink: use pl->link_interface in phylink_expects_phy()
  net: pcs: xpcs: re-initiate clause 37 Auto-negotiation
  stmmac: intel: configure SerDes according to the 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

 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   |   2 +
 .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 229 +++++++++++++++++-
 .../net/ethernet/stmicro/stmmac/dwmac-intel.h |  29 +++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  13 +
 drivers/net/pcs/pcs-xpcs-wx.c                 |   4 +-
 drivers/net/pcs/pcs-xpcs.c                    |  60 ++++-
 drivers/net/phy/phylink.c                     |   2 +-
 .../linux/platform_data/x86/intel_pmc_ipc.h   |  34 +++
 include/linux/stmmac.h                        |   4 +
 13 files changed, 452 insertions(+), 12 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] 19+ messages in thread

end of thread, other threads:[~2025-02-20  2:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 13:18 [PATCH net-next v7 0/7] Enable SGMII and 2500BASEX interface mode switching for Intel platforms Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 1/7] net: phylink: use pl->link_interface in phylink_expects_phy() Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 2/7] net: pcs: xpcs: re-initiate clause 37 Auto-negotiation Choong Yong Liang
2025-02-06 15:30   ` Russell King (Oracle)
2025-02-07  9:20     ` Choong Yong Liang
2025-02-07 13:32       ` Andrew Lunn
2025-02-08  3:33         ` Choong Yong Liang
2025-02-20  2:12     ` Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 3/7] arch: x86: add IPC mailbox accessor function and add SoC register access Choong Yong Liang
2025-02-06 16:46   ` Dave Hansen
2025-02-06 22:48     ` Andrew Lunn
2025-02-19 17:01     ` David E. Box
2025-02-20  2:29       ` Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 4/7] stmmac: intel: configure SerDes according to the interface mode Choong Yong Liang
2025-02-06 13:31   ` Ilpo Järvinen
2025-02-07  9:53     ` Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 5/7] net: stmmac: configure SerDes on mac_finish Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 6/7] stmmac: intel: interface switching support for EHL platform Choong Yong Liang
2025-02-06 13:18 ` [PATCH net-next v7 7/7] 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).