From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6D60C4743E for ; Tue, 8 Jun 2021 03:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DEDF61182 for ; Tue, 8 Jun 2021 03:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbhFHD61 (ORCPT ); Mon, 7 Jun 2021 23:58:27 -0400 Received: from mga04.intel.com ([192.55.52.120]:59065 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbhFHD6X (ORCPT ); Mon, 7 Jun 2021 23:58:23 -0400 IronPort-SDR: kHWE92+0cKnk6qSF+bZqqwiNOv54Uwdx8y4WBWzq4dpj+tq8T7P8teeORizfrlhGj9KbuXFk36 4TJ++emEkC/g== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="202907288" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="202907288" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 20:56:31 -0700 IronPort-SDR: LkHDzyQxgNDZoKa960r1knAVOy2PIdkFjY8FPX5jbTnpbZazyHOkyZxq5SU5KMG32yzsbPJ2a2 FFMq5EeClSGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="440308736" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga007.jf.intel.com with ESMTP; 07 Jun 2021 20:56:26 -0700 From: Michael Sit Wei Hong To: Jose.Abreu@synopsys.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, kuba@kernel.org, netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, davem@davemloft.net, mcoquelin.stm32@gmail.com, weifeng.voon@intel.com, boon.leong.ong@intel.com, tee.min.tan@intel.com, vee.khee.wong@linux.intel.com, vee.khee.wong@intel.com, michael.wei.hong.sit@intel.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, vladimir.oltean@nxp.com Subject: [PATCH net-next v6 0/3] Enable 2.5Gbps speed for stmmac Date: Tue, 8 Jun 2021 11:51:55 +0800 Message-Id: <20210608035158.4869-1-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Intel mGbE supports 2.5Gbps link speed by overclocking the clock rate by 2.5 times to support 2.5Gbps link speed. In this mode, the serdes/PHY operates at a serial baud rate of 3.125 Gbps and the PCS data path and GMII interface of the MAC operate at 312.5 MHz instead of 125 MHz. This is configured in the BIOS during boot up. The kernel driver is not able access to modify the clock rate for 1Gbps/2.5G mode on the fly. The way to determine the current 1G/2.5G mode is by reading a dedicated adhoc register through mdio bus. Changes: v5 -> v6 patch 1/3 - Check if mdio_bus_data is populated to prevent NULL pointer dereferencing when accesing mdio_bus_data member v4 -> v5 patch 1/3 - Rebase to latest code changes after Vladimir's code is merged and fix build warnings v3 -> v4 patch 1/3 - Rebase to latest code and Initialize 'found' to 0 to avoid build warning patch 2/3 - Fix indentation issue from v3 v2 -> v3 patch 1/3 -New patch added to restructure the code. enabling reading the dedicated adhoc register to determine link speed mode. patch 2/3 -Restructure for 2.5G speed to use 2500BaseX configuration as the PHY interface. patch 3/3 -Restructure to read serdes registers to set max_speed and configure to use 2500BaseX in 2.5G speeds. v1 -> v2 patch 1/2 -Remove MAC supported link speed masking patch 2/2 -Add supported link speed masking in the PCS iperf3 and ping for 2.5Gbps and regression test on 10M/100M/1000Mbps is done to prevent regresson issues. 2500Mbps PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.526 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.509 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.507 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.508 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.539 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.516 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.548 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.513 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.509 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.508 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9222ms rtt min/avg/max/mdev = 0.507/0.518/0.548/0.013 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 40092 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 205 MBytes 1.72 Gbits/sec 0 604 KBytes [ 5] 1.00-2.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 2.00-3.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 3.00-4.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes [ 5] 4.00-5.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 5.00-6.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes [ 5] 6.00-7.00 sec 204 MBytes 1.71 Gbits/sec 0 632 KBytes [ 5] 7.00-8.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes [ 5] 8.00-9.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 9.00-10.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 2.00 GBytes 1.72 Gbits/sec 0 sender [ 5] 0.00-10.00 sec 2.00 GBytes 1.72 Gbits/sec receiver iperf Done. 10Mbps host@EHL$ ethtool -s enp0s30f4 duplex full speed 10 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.46 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.761 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.744 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.753 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.746 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.786 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.740 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.757 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.742 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.772 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9208ms rtt min/avg/max/mdev = 0.740/0.826/1.461/0.212 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 35304 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 1.26 MBytes 10.6 Mbits/sec 0 29.7 KBytes [ 5] 1.00-2.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 2.00-3.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 3.00-4.00 sec 1.15 MBytes 9.68 Mbits/sec 0 29.7 KBytes [ 5] 4.00-5.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 5.00-6.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 6.00-7.00 sec 1.15 MBytes 9.68 Mbits/sec 0 29.7 KBytes [ 5] 7.00-8.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 8.00-9.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 9.00-10.00 sec 1.15 MBytes 9.68 Mbits/sec 0 29.7 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 11.3 MBytes 9.47 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 11.1 MBytes 9.33 Mbits/sec receiver iperf Done. 100Mbps host@EHL$ ethtool -s enp0s30f4 duplex full speed 100 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.05 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.535 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.522 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.529 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.523 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.543 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.553 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.542 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.517 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.515 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9233ms rtt min/avg/max/mdev = 0.515/0.582/1.048/0.155 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 35308 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 11.8 MBytes 99.1 Mbits/sec 0 147 KBytes [ 5] 1.00-2.00 sec 10.9 MBytes 91.2 Mbits/sec 0 187 KBytes [ 5] 2.00-3.00 sec 11.4 MBytes 95.4 Mbits/sec 0 230 KBytes [ 5] 3.00-4.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 4.00-5.00 sec 10.4 MBytes 87.6 Mbits/sec 0 230 KBytes [ 5] 5.00-6.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 6.00-7.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 7.00-8.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 8.00-9.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 9.00-10.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 110 MBytes 92.4 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 109 MBytes 91.5 Mbits/sec receiver iperf Done. 1000Mbps host@EHL$ ethtool -s enp0s30f4 duplex full speed 1000 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.02 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.507 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.539 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.506 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.504 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.489 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.499 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.483 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.480 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.493 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9213ms rtt min/avg/max/mdev = 0.480/0.551/1.015/0.155 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 35312 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 114 MBytes 960 Mbits/sec 0 437 KBytes [ 5] 1.00-2.00 sec 112 MBytes 940 Mbits/sec 0 437 KBytes [ 5] 2.00-3.00 sec 112 MBytes 937 Mbits/sec 0 437 KBytes [ 5] 3.00-4.00 sec 112 MBytes 941 Mbits/sec 0 437 KBytes [ 5] 4.00-5.00 sec 112 MBytes 939 Mbits/sec 0 457 KBytes [ 5] 5.00-6.00 sec 112 MBytes 941 Mbits/sec 0 457 KBytes [ 5] 6.00-7.00 sec 112 MBytes 944 Mbits/sec 0 457 KBytes [ 5] 7.00-8.00 sec 112 MBytes 937 Mbits/sec 0 457 KBytes [ 5] 8.00-9.00 sec 113 MBytes 946 Mbits/sec 0 457 KBytes [ 5] 9.00-10.00 sec 112 MBytes 937 Mbits/sec 0 457 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.10 GBytes 942 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver iperf Done. Voon Weifeng (3): net: stmmac: split xPCS setup from mdio register net: pcs: add 2500BASEX support for Intel mGbE controller net: stmmac: enable Intel mGbE 2.5Gbps link speed .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 48 +++++++++++++- .../net/ethernet/stmicro/stmmac/dwmac-intel.h | 13 ++++ .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +++++ .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 64 ++++++++++--------- drivers/net/pcs/pcs-xpcs.c | 56 ++++++++++++++++ include/linux/pcs/pcs-xpcs.h | 1 + include/linux/stmmac.h | 1 + 9 files changed, 171 insertions(+), 30 deletions(-) -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48D36C4743D for ; Tue, 8 Jun 2021 03:59:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 18BD161208 for ; Tue, 8 Jun 2021 03:59:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18BD161208 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CPNMFpdphhdDlL8Xssgpgy+qzAujGlhyRDW6yuqJwME=; b=ZOySv6jVPEjdfQ 9/d87FvfNzwkRpepzyodAm+xfq26O7DwWe1f7m9gaqNqajBCUrbBoNQbjiZUHtOI6ckyCcg4VR3XQ J9c5UPuxDdbwNNcioID2NwEJTDZdlFo0QaKJq2bRmr4sNTDa+RgtHcorAe1Wat8UyKUbb9aFkTEoh bVrlx5jesxQBTbMtG0L2KDCBVh4z8hdxbF9+9HYf1itfFpAeuEEvwxFmObnUUb/7El5r9IArk38Ny Ida0QY6nFiu4XS3pdqyFBzK2CBoO3L6OJGOZ3OC5843cQDf8PYNRNRwtC1sj98Jg6umnmmIpsId3O NgXM6HsG25Blgez10vqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqSrH-006M4c-2e; Tue, 08 Jun 2021 03:56:55 +0000 Received: from mga18.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqSqu-006M3l-Ue for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 03:56:34 +0000 IronPort-SDR: gJlt4OcjFK3x2tN/AUnJTGuRa2eIB9ZJZInzmNx3GWplsWhY9N9SeqTuMpFQ6TxIAT71MKoNc6 fJidYnwso4cg== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="192092430" X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="192092430" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 20:56:31 -0700 IronPort-SDR: LkHDzyQxgNDZoKa960r1knAVOy2PIdkFjY8FPX5jbTnpbZazyHOkyZxq5SU5KMG32yzsbPJ2a2 FFMq5EeClSGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,256,1616482800"; d="scan'208";a="440308736" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga007.jf.intel.com with ESMTP; 07 Jun 2021 20:56:26 -0700 From: Michael Sit Wei Hong To: Jose.Abreu@synopsys.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, kuba@kernel.org, netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, davem@davemloft.net, mcoquelin.stm32@gmail.com, weifeng.voon@intel.com, boon.leong.ong@intel.com, tee.min.tan@intel.com, vee.khee.wong@linux.intel.com, vee.khee.wong@intel.com, michael.wei.hong.sit@intel.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, vladimir.oltean@nxp.com Subject: [PATCH net-next v6 0/3] Enable 2.5Gbps speed for stmmac Date: Tue, 8 Jun 2021 11:51:55 +0800 Message-Id: <20210608035158.4869-1-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210607_205633_054750_1338D2F3 X-CRM114-Status: GOOD ( 14.25 ) 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: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Intel mGbE supports 2.5Gbps link speed by overclocking the clock rate by 2.5 times to support 2.5Gbps link speed. In this mode, the serdes/PHY operates at a serial baud rate of 3.125 Gbps and the PCS data path and GMII interface of the MAC operate at 312.5 MHz instead of 125 MHz. This is configured in the BIOS during boot up. The kernel driver is not able access to modify the clock rate for 1Gbps/2.5G mode on the fly. The way to determine the current 1G/2.5G mode is by reading a dedicated adhoc register through mdio bus. Changes: v5 -> v6 patch 1/3 - Check if mdio_bus_data is populated to prevent NULL pointer dereferencing when accesing mdio_bus_data member v4 -> v5 patch 1/3 - Rebase to latest code changes after Vladimir's code is merged and fix build warnings v3 -> v4 patch 1/3 - Rebase to latest code and Initialize 'found' to 0 to avoid build warning patch 2/3 - Fix indentation issue from v3 v2 -> v3 patch 1/3 -New patch added to restructure the code. enabling reading the dedicated adhoc register to determine link speed mode. patch 2/3 -Restructure for 2.5G speed to use 2500BaseX configuration as the PHY interface. patch 3/3 -Restructure to read serdes registers to set max_speed and configure to use 2500BaseX in 2.5G speeds. v1 -> v2 patch 1/2 -Remove MAC supported link speed masking patch 2/2 -Add supported link speed masking in the PCS iperf3 and ping for 2.5Gbps and regression test on 10M/100M/1000Mbps is done to prevent regresson issues. 2500Mbps PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.526 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.509 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.507 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.508 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.539 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.516 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.548 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.513 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.509 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.508 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9222ms rtt min/avg/max/mdev = 0.507/0.518/0.548/0.013 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 40092 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 205 MBytes 1.72 Gbits/sec 0 604 KBytes [ 5] 1.00-2.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 2.00-3.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 3.00-4.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes [ 5] 4.00-5.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 5.00-6.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes [ 5] 6.00-7.00 sec 204 MBytes 1.71 Gbits/sec 0 632 KBytes [ 5] 7.00-8.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes [ 5] 8.00-9.00 sec 205 MBytes 1.72 Gbits/sec 0 632 KBytes [ 5] 9.00-10.00 sec 206 MBytes 1.73 Gbits/sec 0 632 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 2.00 GBytes 1.72 Gbits/sec 0 sender [ 5] 0.00-10.00 sec 2.00 GBytes 1.72 Gbits/sec receiver iperf Done. 10Mbps host@EHL$ ethtool -s enp0s30f4 duplex full speed 10 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.46 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.761 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.744 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.753 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.746 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.786 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.740 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.757 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.742 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.772 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9208ms rtt min/avg/max/mdev = 0.740/0.826/1.461/0.212 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 35304 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 1.26 MBytes 10.6 Mbits/sec 0 29.7 KBytes [ 5] 1.00-2.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 2.00-3.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 3.00-4.00 sec 1.15 MBytes 9.68 Mbits/sec 0 29.7 KBytes [ 5] 4.00-5.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 5.00-6.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 6.00-7.00 sec 1.15 MBytes 9.68 Mbits/sec 0 29.7 KBytes [ 5] 7.00-8.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 8.00-9.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes [ 5] 9.00-10.00 sec 1.15 MBytes 9.68 Mbits/sec 0 29.7 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 11.3 MBytes 9.47 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 11.1 MBytes 9.33 Mbits/sec receiver iperf Done. 100Mbps host@EHL$ ethtool -s enp0s30f4 duplex full speed 100 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.05 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.535 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.522 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.529 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.523 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.543 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.553 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.542 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.517 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.515 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9233ms rtt min/avg/max/mdev = 0.515/0.582/1.048/0.155 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 35308 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 11.8 MBytes 99.1 Mbits/sec 0 147 KBytes [ 5] 1.00-2.00 sec 10.9 MBytes 91.2 Mbits/sec 0 187 KBytes [ 5] 2.00-3.00 sec 11.4 MBytes 95.4 Mbits/sec 0 230 KBytes [ 5] 3.00-4.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 4.00-5.00 sec 10.4 MBytes 87.6 Mbits/sec 0 230 KBytes [ 5] 5.00-6.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 6.00-7.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 7.00-8.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 8.00-9.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes [ 5] 9.00-10.00 sec 10.9 MBytes 91.7 Mbits/sec 0 230 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 110 MBytes 92.4 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 109 MBytes 91.5 Mbits/sec receiver iperf Done. 1000Mbps host@EHL$ ethtool -s enp0s30f4 duplex full speed 1000 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.02 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.507 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.539 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.506 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.504 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=0.489 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=0.499 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=0.483 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=0.480 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.493 ms --- 192.168.1.1 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9213ms rtt min/avg/max/mdev = 0.480/0.551/1.015/0.155 ms Connecting to host 192.168.1.1, port 5201 [ 5] local 192.168.1.2 port 35312 connected to 192.168.1.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 114 MBytes 960 Mbits/sec 0 437 KBytes [ 5] 1.00-2.00 sec 112 MBytes 940 Mbits/sec 0 437 KBytes [ 5] 2.00-3.00 sec 112 MBytes 937 Mbits/sec 0 437 KBytes [ 5] 3.00-4.00 sec 112 MBytes 941 Mbits/sec 0 437 KBytes [ 5] 4.00-5.00 sec 112 MBytes 939 Mbits/sec 0 457 KBytes [ 5] 5.00-6.00 sec 112 MBytes 941 Mbits/sec 0 457 KBytes [ 5] 6.00-7.00 sec 112 MBytes 944 Mbits/sec 0 457 KBytes [ 5] 7.00-8.00 sec 112 MBytes 937 Mbits/sec 0 457 KBytes [ 5] 8.00-9.00 sec 113 MBytes 946 Mbits/sec 0 457 KBytes [ 5] 9.00-10.00 sec 112 MBytes 937 Mbits/sec 0 457 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.10 GBytes 942 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver iperf Done. Voon Weifeng (3): net: stmmac: split xPCS setup from mdio register net: pcs: add 2500BASEX support for Intel mGbE controller net: stmmac: enable Intel mGbE 2.5Gbps link speed .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 48 +++++++++++++- .../net/ethernet/stmicro/stmmac/dwmac-intel.h | 13 ++++ .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +++++ .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 64 ++++++++++--------- drivers/net/pcs/pcs-xpcs.c | 56 ++++++++++++++++ include/linux/pcs/pcs-xpcs.h | 1 + include/linux/stmmac.h | 1 + 9 files changed, 171 insertions(+), 30 deletions(-) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel