Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp290962rdb; Wed, 14 Feb 2024 23:19:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWduovsgA/97m3vY0W3mEZAeS2D/6eh9/W/lo1qsz2sridtm0H0ihoVJdf9HFO1pzh1nE+6VSgIkKSe0zfVp91rV1gGIQFU6vKuELhEwg== X-Google-Smtp-Source: AGHT+IE8A8nFreKxTJ4uOjp6DF7JFJNLRsUCOIp6zsZMmhGLopBF0KLLOrXckpjha4TLDlVfsyRp X-Received: by 2002:a17:903:120d:b0:1d7:836d:7b3f with SMTP id l13-20020a170903120d00b001d7836d7b3fmr1350877plh.9.1707981542771; Wed, 14 Feb 2024 23:19:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707981542; cv=pass; d=google.com; s=arc-20160816; b=E0ElsBPPCb/o8ADZkhqAUXx7zleYqE+6u5ODI0cDp0uanrzhVrQEW93SI7ZWpQVxOS aaGh8iAIHCBYBx7p3rZessU8FbyOFQ0cUTgQJO5zjx/T1SzUGvz1B4bPbcM6oVACgblp xxqqQe9vUSNUbxuoa2AaF3fFirvudVrjbXfNm6a3I3S0J2qJt1m9SuUjTVO+/0xqfXwS T/WQoDKj2VuOqzHcJGKqIftMlM7nbBABjl8dEH2+MgN0uKB4GxAZ4FWKCUjheHdFsvVl dtAF8pexKPsYJ9ZEzu7U7qoym+BLKp6CnLtsnMQgR4rOuWfZljIubl5A6tq3WhogJJxL vJrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=nEq7dOQW5JZsh3wqIP/m+aYf7UDk56jMnOuM9HZYXdE=; fh=chTeah25dtsI+fnQYorT/69F850asxoXrFC8SVATgvA=; b=lehSm7l50T0W+ZmhHPOS4X+hjR7QkvgZHo7KQK0pD76b/00pOAGG627C6aJW+h1+uj 6kGXYbakgoaOtoNvDa+kDC3slCwjn78MCWlKKyu7caKbaZ6eicMTc9SHsHRqV4iQhjE1 L+XvWJBNBdHhBP3WcsSC53wIG2WqmT5A1weAo9XnF8xNoqhoXu5+4npNoAgp2RUQEti1 TeCvyOfqPZol0WB26sYDGSLROLE04T9VkZai92M8DRD2nTCYmeHlzdmtS45s5gt852S2 7JTDAoWsPH7dFVUbeb5MYhKD7jgTMQAKh9RSa0HsPCnoZpqToONSU3RKkI1XMPExfBrG KHuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=heb5Zclc; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j8-20020a170903024800b001db43f02760si674307plh.389.2024.02.14.23.19.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 23:19:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=heb5Zclc; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 42F3A2884BB for ; Thu, 15 Feb 2024 03:07:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E24B6107; Thu, 15 Feb 2024 03:07:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="heb5Zclc" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 266841870; Thu, 15 Feb 2024 03:07:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707966450; cv=none; b=nrbplWpLAeS3oB0zZYsGE07Qk4l9BdeKazPjeaGqadsn3zilxZgN3ci35wtoxJnJLKfzcYpPAcjFzvIOZEbZCm+DErN26x9FnaaX9zyizNdPCAD4wxyh/0IZRDuLRiyxPUSQxbt996Qu3elL7Y4cFgIiF2Tv6QkZ8zOJojfAO3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707966450; c=relaxed/simple; bh=qwwasO+1xBKjEezC6aXWqJJmEG8jQepQBuZ9KNK5I8Y=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=RKehzgzwOshpO00cl4Ct58VMa6Tt20Ge51ZfXi1gahESQaQyYp74+GCIskN/W3ck7f6LwI7LQCygDW/0oOyuRQsB+iJbll/mnNL7+azK9YvulOgs02SLeqaus+IxMogySsDEGY+Hy34mn98ymw0b4WeH2kj347obGCKkT/E54bY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=heb5Zclc; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707966450; x=1739502450; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qwwasO+1xBKjEezC6aXWqJJmEG8jQepQBuZ9KNK5I8Y=; b=heb5ZclcVvK5Havye35ORgU/HuR1tlGUYPHV9B7NPewpumBoEIBGWKRf Yus6w3PNaTnWaXlrUOod08VjgnDaoA93ig4cGaoOv5Z/c7JcY2JNguwC7 kjRB2DXhlngi/7H9F8eu1ABKkFVgiQE9jkH1zkr83s5do2GnpXS0C+7lw kF0/XzfKM/Z0nU+P8pUGJNWbSGYdCuBZAJj2dGPNcYRuYUzh/pwa/BL4O A5NCjC+c1JAdfDmqxJim1nAaE9MEB3Tx0NK2n9dacQjCeCSoFY8QpQDqu n5jDDJxusdaLTBfrqjR/3ot+5Gx9reUO5VsP3Dfj2jL3krr20cUypzvtM A==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="19461201" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="19461201" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 19:07:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="3385643" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmviesa009.fm.intel.com with ESMTP; 14 Feb 2024 19:07:21 -0800 From: Choong Yong Liang 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 , Serge Semin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Michael Sit Wei Hong , Lai Peter Jun Ann , Abdul Rahim Faizal Subject: [PATCH net-next v5 0/9] Enable SGMII and 2500BASEX interface mode switching for Intel platforms Date: Thu, 15 Feb 2024 11:04:50 +0800 Message-Id: <20240215030500.3067426-1-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: root 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 mode for the Intel platform. - mac_get_pcs_neg_mode: A new function that selects the PCS negotiation mode according to the interface mode. - xpcs_do_config: Re-initiate clause 37 auto-negotiation for 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 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. 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. Choong Yong Liang (7): 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: pcs: xpcs: re-initiate clause 37 Auto-negotiation 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 | 2 + .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 233 ++++++++++++++++-- .../net/ethernet/stmicro/stmmac/dwmac-intel.h | 81 ++++++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 30 +++ drivers/net/pcs/pcs-xpcs.c | 62 ++++- drivers/net/phy/phylink.c | 21 +- include/linux/phylink.h | 8 + .../linux/platform_data/x86/intel_pmc_ipc.h | 34 +++ include/linux/stmmac.h | 5 + 13 files changed, 538 insertions(+), 25 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