From patchwork Thu Jun 22 04:18:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Choong Yong Liang X-Patchwork-Id: 11144 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4826757vqr; Wed, 21 Jun 2023 21:58:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61/kmCLzgyQ1x9+mOrZvS0hsOB+jz2vc5lKvF8T93pdN7CUzDCn7NCfY3n+Dsn/gdZZtSm X-Received: by 2002:a05:6214:c6e:b0:628:ed0e:a165 with SMTP id t14-20020a0562140c6e00b00628ed0ea165mr10853587qvj.58.1687409907240; Wed, 21 Jun 2023 21:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687409907; cv=none; d=google.com; s=arc-20160816; b=udkpUOyj3rBB/y/u9sjED5b+GshH4aW5N0Co20KSwBtIZHSqdABBbCYlAkfYPNftOR LF+ul6QdcrgRI6Rt0q1jX1/dBSZsjYf3Tp4/LBogL5fkBmPl0FZnkmCWkxmlHydwkC9H Wi4V/ZUyQknUbKm2/86Gj8t/AVabEt+235mcE5NxgFHsMFpu+rGNsPibmrBDDy/wOuUV 9q8AJCkoGfLPsHyulgBeivSmYi2fl6vS/bndE2KlJ18rCAA/2d/7pidZ3jYpo1wMgvco N2QU9yqiiMzcT1xzwer0d2u2mQPckhkG+tj1g9phRP3iaKVJYfhvXeqYQ3tzy0twVVno PWug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/MLIHhVgM7pQmEDZ9ZAw+jOsv6Vtuu8jczqp8bZfJGY=; b=ORb9xHirZ2g7zFrJhD3cRjTkq015N7AxQiXgP43fK9mMiZ5stEojBv0XY1Foz9V7E+ jj8GdrKNGVCQD5ngvpPcHXXs7o/jyoVMTAX7fwfE3ggbVFNWEndCUTRiocAy7QerhF8u E5pPSRKSmF+2JWlynp/g7SV0JmVmOTu+LqKON1DG+V2IOfuCKI+f/LFIG2ODTRx7b+b9 ec/DBvSIOZZCx6RrH5rOjkshKt1a38NDoWY5AotTIojRWliGzP9U000LGg3oARFR+/ND XGD09A0XzCu8OBmp+XwOtmr8uhXlK41ahPQ1YjnLKXdVRzWubRTjEJCbogM9rCon6Cn7 xiYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=gj96WUnn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020aa79728000000b00662db175212si2930654pfg.47.2023.06.21.21.58.14; Wed, 21 Jun 2023 21:58:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=gj96WUnn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230244AbjFVETo (ORCPT + 99 others); Thu, 22 Jun 2023 00:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbjFVETn (ORCPT ); Thu, 22 Jun 2023 00:19:43 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92BA719C; Wed, 21 Jun 2023 21:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687407582; x=1718943582; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=rKgnFurbdIRdoh4CHd4XKUen+Eh+ergId4ed9rxs1x8=; b=gj96WUnnBYTye/kmRrfT2ZVvXrLM1DUUXYOZQyYq6oV++xu0RFbgIXVM Z1l79ss+1h0KOQziz4jbh3O/VgPQjnp6JNLQOHCGre0jt+aYx71SrwlKR lgCaNfAmcchuHagP/0Zk53Z99bwN/wUD0YOaSIsd7bwF1HPR+8xnaEqyW j4wI8fWuAtxgLTdFg8j7em+3Q2C6x9/2X4qlbhZTurtxHBgTjwDD5tryC K1PcmEQ8BUOzGr0qFkk96Ss3AYgRyvb1tLLMmZlN0C9dzLvGnaiNHijiR FsCCJJJKkUTVEzUm4VmjiDgm8F8PuNj+zp7xmez5GzQKxDopNczzNOGIC w==; X-IronPort-AV: E=McAfee;i="6600,9927,10748"; a="363811732" X-IronPort-AV: E=Sophos;i="6.00,262,1681196400"; d="scan'208";a="363811732" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2023 21:19:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10748"; a="744453724" X-IronPort-AV: E=Sophos;i="6.00,262,1681196400"; d="scan'208";a="744453724" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by orsmga008.jf.intel.com with ESMTP; 21 Jun 2023 21:19:27 -0700 From: Choong Yong Liang To: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Jose Abreu , Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?q?Marek_Beh=C3=BAn?= , Jean Delvare , Guenter Roeck , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Philipp Zabel , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Wong Vee Khee , Jon Hunter , Jesse Brandeburg , Revanth Kumar Uppala , Shenwei Wang , Andrey Konovalov , Jochen Henneberg Cc: 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 , Tan@vger.kernel.org, Tee Min , Michael Sit Wei Hong , Lai Peter Jun Ann Subject: [PATCH net-next 0/6] TSN auto negotiation between 1G and 2.5G Date: Thu, 22 Jun 2023 12:18:59 +0800 Message-Id: <20230622041905.629430-1-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.3 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769377530413609709?= X-GMAIL-MSGID: =?utf-8?q?1769377530413609709?= Intel platforms’ integrated Gigabit Ethernet controllers support 2.5Gbps mode statically using BIOS programming. In the current implementation, the BIOS menu provides an option to select between 10/100/1000Mbps and 2.5Gbps modes. Based on the selection, the BIOS programs the Phase Lock Loop (PLL) registers. The BIOS also read the TSN lane registers from Flexible I/O Adapter (FIA) block and provided 10/100/1000Mbps/2.5Gbps information to the stmmac driver. But auto-negotiation between 10/100/1000Mbps and 2.5Gbps is not allowed. The new proposal is to support auto-negotiation between 10/100/1000Mbps and 2.5Gbps . Auto-negotiation between 10, 100, 1000Mbps will use in-band auto negotiation. Auto-negotiation between 10/100/1000Mbps and 2.5Gbps will work as the following proposed flow, the stmmac driver reads the PHY link status registers then identifies the negotiated speed. Based on the speed stmmac driver will identify TSN lane registers from FIA then send IPC command to the Power Management controller (PMC) through PMC driver/API. PMC will act as a proxy to programs the PLL registers. Choong Yong Liang (1): net: stmmac: Add 1G/2.5G auto-negotiation support for ADL-N David E. Box (1): platform/x86: intel_pmc_core: Add IPC mailbox accessor function and add SoC register access Michael Sit Wei Hong (1): stmmac: intel: Separate driver_data of ADL-N from TGL Tan, Tee Min (3): net: pcs: xpcs: combine C37 SGMII AN and 2500BASEX for Intel mGbE controller net: phy: update in-band AN mode when changing interface by PHY driver net: stmmac: enable Intel mGbE 1G/2.5G auto-negotiation support MAINTAINERS | 1 + drivers/net/ethernet/stmicro/stmmac/Kconfig | 1 + .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 183 +++++++++++++++++- .../net/ethernet/stmicro/stmmac/dwmac-intel.h | 81 ++++++++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 20 ++ drivers/net/pcs/pcs-xpcs.c | 72 +++++-- drivers/net/phy/marvell10g.c | 6 + drivers/net/phy/phylink.c | 3 + drivers/platform/x86/intel/pmc/adl.c | 2 +- drivers/platform/x86/intel/pmc/cnp.c | 2 +- drivers/platform/x86/intel/pmc/core.c | 63 +++++- drivers/platform/x86/intel/pmc/icl.c | 2 +- drivers/platform/x86/intel/pmc/mtl.c | 2 +- drivers/platform/x86/intel/pmc/spt.c | 2 +- drivers/platform/x86/intel/pmc/tgl.c | 2 +- .../core.h => include/linux/intel_pmc_core.h | 27 ++- include/linux/pcs/pcs-xpcs.h | 1 + include/linux/phy.h | 2 + include/linux/stmmac.h | 1 + 19 files changed, 449 insertions(+), 24 deletions(-) rename drivers/platform/x86/intel/pmc/core.h => include/linux/intel_pmc_core.h (95%)