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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E0A3C433F5 for ; Thu, 19 May 2022 13:59:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238357AbiESN7F (ORCPT ); Thu, 19 May 2022 09:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237072AbiESN5I (ORCPT ); Thu, 19 May 2022 09:57:08 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B0838AB; Thu, 19 May 2022 06:56:58 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.36.1