From patchwork Thu Sep 21 12:19:41 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: 13393903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3766E71062 for ; Thu, 21 Sep 2023 12:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=P4kEGzCIcL0mGZhLYsVPApLz3nGXGsrfR1jeVQcFnEA=; b=NqKsfxKtM5LSkf 0AtL+tcWeVCDDMVETIrYFJw9HNI081aythuvXTbkuNeJ/C4Fwy8uL6RVPj7/Sg0y4HSJ3+H8md9te SWXtbzUcKGagEAiWQiXhpjVNZQAzT/Zsyupl7l4wYUkRb09eIFqnx15F2w2PkLAQ8mquTFsrwhtFE zrlBaqXFJgb0lV+cIynn0y4kivS8VhE4BIPSndrl9u2yR/aRA3GHIUKpJxkxYxI6gmIsGScBKEVwf fdI9e/0WMEr0XucOI01yCtCFcqt4oU49jYNQg4DU4JWCMvXQKVevuLCOHidjjrz4HnpR4cxU6CDHB OoU6LfOWrMTT65q0clwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjIfX-005zvb-12; Thu, 21 Sep 2023 12:20:31 +0000 Received: from mgamail.intel.com ([134.134.136.31]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qjIfU-005zuD-0F for linux-arm-kernel@lists.infradead.org; Thu, 21 Sep 2023 12:20:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695298828; x=1726834828; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6hzWF6t3usS5DT5I810V3jYMFYBjf/9WntyNrqaTQuo=; b=TaprHpR5bRWFJxvss4Jx3vpffdzISGWfhW3VoPagUnAwdgaUUz4Goyc6 RRSHjlpj2qRmm/BO2RkH+Pb9qYPu3J0cAQLYbk/6pBEiZarTBmbG5i5am 0apzKuavYz4o3oSo/L/o7ycd9xLYtw7ic3ZabGWfqUcIRJVP1j46I5OXT +xiPUKGgDmwxVGriUDeGibPVrViCvaHaqCzAkrWEyIItrZv0oEWnjpfNH TuHRWOTaq77vbzawnNsNd23OyzUzDqkEdomiZQSBOkC+jzO18o5egpLgR A/SkSq8pKtdRB8WZiiyUgI9BSRimlmWkLeUvjMpeiAbXuTFTumRp7eDbm A==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="444608121" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="444608121" 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_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: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230921_052028_276582_E451668B X-CRM114-Status: GOOD ( 14.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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