Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2443228rdb; Thu, 21 Sep 2023 20:56:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJoMpM/Rq4Af/5Y8NZ9rQ50APgc0YP5vB3WhqtIX9t7CCjH63PWfTIRQM5UAWJfsPVnzxY X-Received: by 2002:a17:902:c191:b0:1c4:4c73:94e6 with SMTP id d17-20020a170902c19100b001c44c7394e6mr6606884pld.51.1695354962172; Thu, 21 Sep 2023 20:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695354962; cv=none; d=google.com; s=arc-20160816; b=k1Df5jrBZxRxaD1kmgt6Y+T9ZuZT4YC+29ei3SKmYHGxVtlsvrYb+gsq3oKmm30f3u rWDcBerXkOXJfneqNkzh2u4CyW/6p4UFdE29tLWWLlK2FzLb6oGs9hwVBzgCvfv/lUsb 4F7RbKDprsdCZBw7SIaqxgxElk3iBRHG93DY/83Gbl+tOj6UbBWXxUvZWuNUba6mOIek GrYrESw3uSiVej6mvgLir8e4+1Sl5kpjyiHvb3lSuMfTFhnD1XnpX0X/QGy0URvB4DYP HWZRXe+IT7MM7fWTfRJ432c+3TQgKFn7sm1bHrn4CqvLPAmfk72TLWqr/nzCKOs1Q62C XnYg== 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=M32thRBOPkBckWJpcAFkau8lCWBw2Lz+ljD9wFZ24XE=; fh=eopC7/l+nVuh6mxtuaUTGuElFjyXo3EdPF+w+AmilC8=; b=eAIV8pj3dpzhKQdvy78Ysn/wB7uZImfHNi19aECx4O8HjbNCbTnN7WmvqVI88b2380 sbzn+4t1f2/w7ebYpRjAI9AGJFHQroqlzSjQaw9cRiuu17AjUQ3FfD6DEDERCnhVjBlW 6TtN157U3ZGf6fAv6hycZqlCb0T9B+DbGAEDDBgyOnpuE8pahDLzOnKGD7mFSTLDWVni dUzivz3XEg5mTqvuPrK5+D/NOt9qCmUmpN/GHxXnRDfjs59Rub/YkhvBrprx/pfG3u0E q555Kgw0Yx9kc2Gqx07VH3rqQKkSZq/fiqxtEgzc3/+m3nz7PJve1dmKgkrVaykNvpqR vYuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bJ2vQwqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o21-20020a170903211500b001c33d7759c8si2714765ple.47.2023.09.21.20.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 20:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bJ2vQwqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5F78C80F6684; Thu, 21 Sep 2023 13:12:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbjIUUMM (ORCPT + 99 others); Thu, 21 Sep 2023 16:12:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbjIUULs (ORCPT ); Thu, 21 Sep 2023 16:11:48 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B23551F54; Thu, 21 Sep 2023 10:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695316619; x=1726852619; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6hzWF6t3usS5DT5I810V3jYMFYBjf/9WntyNrqaTQuo=; b=bJ2vQwqqvZUSlPQef5CO7qJl7hpl60lcNGbtiepil+vDOyE23iqnsvjZ H7zkCcVHvqSwcypLhDNlwLZ54wSS1+8xJfjNzdE1vXSYvsfSRkxVh34eM O2Cngk1Rgx4fPh3dw1G6aisXoiElqyZGzi2EVbLpbduE02b+LXisOuUQk IMYrjpOJLF0ns1TO3cDk0t4xUPYqLcwEMwZH25mCgNbn/ldbS9XjVXnFc OWSUyOhYUuGfxhfY5nsDskRSA/VnF9VW4SWmOeylepvNlHL0GowqnPRM7 GmS0AO9h/cctYPyXDZ5THol3YJtVszkXIap6NGeW+S5yPfh+m7IZohWaE g==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="444608109" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="444608109" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 05:20:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="862441612" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="862441612" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmsmga002.fm.intel.com with ESMTP; 21 Sep 2023 05:20:13 -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=20Beh=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: David E Box , Andrew Halaney , Simon Horman , Bartosz Golaszewski , 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 Tee Min , Michael Sit Wei Hong , Lai Peter Jun Ann Subject: [PATCH net-next v3 0/5] TSN auto negotiation between 1G and 2.5G Date: Thu, 21 Sep 2023 20:19:41 +0800 Message-Id: <20230921121946.3025771-1-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:12:17 -0700 (PDT) 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. changelog: 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. --- Choong Yong Liang (2): net: phy: update in-band AN mode when changing interface by PHY driver stmmac: intel: Add 1G/2.5G auto-negotiation support for ADL-N David E. Box (1): arch: x86: Add IPC mailbox accessor function and add SoC register access Tan, Tee Min (2): net: pcs: xpcs: combine C37 SGMII AN and 2500BASEX for Intel mGbE controller net: stmmac: enable Intel mGbE 1G/2.5G auto-negotiation support 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 | 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/phylink.c | 30 ++- include/linux/pcs/pcs-xpcs.h | 1 + .../linux/platform_data/x86/intel_pmc_ipc.h | 34 ++++ include/linux/stmmac.h | 1 + 13 files changed, 493 insertions(+), 17 deletions(-) create mode 100644 arch/x86/platform/intel/pmc_ipc.c create mode 100644 include/linux/platform_data/x86/intel_pmc_ipc.h -- 2.25.1