From patchwork Thu May 19 13:56:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 12855235 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 3A8BEC433F5 for ; Thu, 19 May 2022 15:01:24 +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=+c2DAyzLLhbfB8/vbmHs+ZRDMBmRyho4V6bhnSV93aE=; b=TVuQKr8JIyJJ9j nAGOFZ6SDPmgTewG+AC2au8fvFcL+6TYm9UEn+t+5DCkbkwZo+BRjZhc4jWmEJ02lg0tkA6eqR/Va kwF6lPfBLVvGxU9vylVKMVdyIny+zQdNQ9+gnZnpZRbEcuyOcB79g35VXyHu/i2iZMOG8syHro36s QAXlMON2nmCTudXPc48BYvd/FBoo5guSxVnEBSGuR7vTnX6Hbrus56EpO5Hr05f81qenvMiqTGiIu DJ5bKynhI2rL1SqFzRhEsgfjXdJblUQR8ukfoU+Qubg1Z7pKdqFIKI1gZ/T5K1GicuwM204anREoq qT71V4gIUQIU4hAW+ojQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrhd2-007fQl-Rn; Thu, 19 May 2022 14:59:53 +0000 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrgeB-007BXO-6q for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2022 13:57:01 +0000 Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 63F63240014; Thu, 19 May 2022 13:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652968613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UIKY8sH1X5ECVbyISXl1wSkKulCZceNUKGMFNeLBB58=; b=dH4zG/rLfn5lYbDoNTUtI2jjvNpKLyNMlTWaHhX8zJXuzpS057KPCaTrElRlKJqiztw1SL 6cDNU52AmZBbS64wCDX99mR2mee3NMLZsxFm0pTSyhrUPDM1zR69Cx4gbDX6UFV4ANUdht bLkjlOEuRSSXheDO5Nie6fMJwdzagP4oDIAj0ccaT9vmSCsyT425Nk87Yjgob5MxAhEHK7 459gkEsdaifm2rqribGwOUl+WFphaRd87RhixGgEnBxFGQ6mkjcYxJ9t0vyL3XOT3sPy62 lcNEGBRZL5Acis5qxAzkxQdIPyHvI0nmQZDQHfc0QuQ9LsrcP5b2vTONY2ISZQ== From: Maxime Chevallier To: davem@davemloft.net, Rob Herring Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Richard Cochran , Horatiu.Vultur@microchip.com, Allan.Nielsen@microchip.com, UNGLinuxDriver@microchip.com Subject: [PATCH net-next 0/6] net: Introduce Ethernet Inband Extensions Date: Thu, 19 May 2022 15:56:41 +0200 Message-Id: <20220519135647.465653-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_065659_915020_D12FEBBF X-CRM114-Status: GOOD ( 15.56 ) 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 Hello everyone, This series introduces support for Ethernet in-band extensions, a mechanism proposed by Cisco as part of the USXGMII spec. The idea is to leverage the 7 bytes preamble to convey meaningful data, in what's called an "extension". This series adds the QUSGMII mode, which is a quad variant of the USXGMII standard, and adds its support in the lan966x driver. In QUSGMII, extensions can be used. The only extension support thus far is the PCH mode, a way to convey part of a timestamp into the ethernet preamble. That's a pretty straightfoward extension, documented in the Cisco spec. Other extensions can exist, each being identified by a 2 bits code in the preamble, parsed by the hardware. We therefore need an API to synchronise which mode is supported by a given PHY, then a way to enable it in the PHY, from the MAC's control. This is done through a new phy_driver callback, .inband_ext_config(), that the MAC driver will call to ask a PHY driver to enable a given extension. The PCH mode that is added in this series is used to offload a bit the MDIO bus when doing PHY-side timestamping, by conveying the nanoseconds part of the timestamp into the preamble. The MAC driver then extracts the timestamp (using lan966x's IFH mechanism), puts the nanosecond part in the SKB. The RX deferred timestamping then asks the PHY for the rest of the timestamp. Other modes exists, such as Microchip's MCH mode, but this series only include PCH since it's simple enough and keeps the code reviewable. Thanks, Maxime Maxime Chevallier (6): net: phy: Introduce QUSGMII PHY mode dt-bindings: net: ethernet-controller: add QUSGMII mode net: lan966x: Add QUSGMII support for lan966x net: phy: Add support for inband extensions net: lan966x: Allow using PCH extension for PTP net: phy: micrel: Add QUSGMII support and PCH extension .../bindings/net/ethernet-controller.yaml | 1 + Documentation/networking/phy.rst | 9 ++ .../ethernet/microchip/lan966x/lan966x_main.c | 14 +-- .../ethernet/microchip/lan966x/lan966x_main.h | 6 ++ .../microchip/lan966x/lan966x_phylink.c | 9 +- .../ethernet/microchip/lan966x/lan966x_port.c | 33 ++++-- .../ethernet/microchip/lan966x/lan966x_ptp.c | 93 +++++++++++++++- .../ethernet/microchip/lan966x/lan966x_regs.h | 72 +++++++++++++ drivers/net/phy/micrel.c | 102 ++++++++++++++++-- drivers/net/phy/phy.c | 68 ++++++++++++ drivers/net/phy/phylink.c | 3 + include/linux/phy.h | 28 ++++- 12 files changed, 413 insertions(+), 25 deletions(-)