From patchwork Mon Oct 21 13:58:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13844288 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 E5E68D15DA8 for ; Mon, 21 Oct 2024 14:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject: 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=7o99bHq2yGP6GQwJV8Yn5Us3C50/QMBKIdwo8ewAYhg=; b=yh1VDPtlqYwod3 TfEnvKHa5XhsvVohh2/6B5R6wGcfyqG8cbo28yE4NlFlkCaj6En52ZdX8ThdrdEdScrtfjq63N+Xa VstvOg6LP0Mfh19IRv32yBi/16Qhs21NEODumnoXwQ6zx4LKfFrBRlURaXcYSbz59GMDHr3Nb3rmr 03NavxXQirxjjtoEM1yxDLE4ypRFwbovYgU1hM+hgbGcHJUgh1RAPSXLcN/TmJQagRnElz70/e2eo pbN6p7NYFCwrbQsrIeggkDwoika3BoxFR6bYvUMxIkjS4ly+VOc0JkS9Qf5/TpRn12YuH552QdoHa F8Kh5fEi4k1M+w7jDpZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2tnc-00000007gP1-23iG; Mon, 21 Oct 2024 14:54:24 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2swH-00000007WRj-1w1N for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 13:59:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1729519157; x=1761055157; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=aY0YypQAngRekw2GELmtGYkeTWjSw4VkDJVyIfxc2hA=; b=v+MGiOSR2AfXDhZXV24LNghUg9lQUH2ZBtVyl2o9UeBbSZjwtIz51w5S 0rqhz1+mTlYD9Cyuk45iqZcV4TaISyilp7fo5M6XSZ4ifIqeHWDqmiky2 7xEMoLH2FHyNao/lAxxn6jQI1QO57oWCEfxDdtiEIMUyycGeAf/yNYCgi vU6HNEBLs93amvPlK2OGj1Zz7BB7vQIEbiIVmBYznfhREvThU4InUo2j1 kBsMZwKcFAVXV+TF5Qt/kL269ptcxUMG5w3I3woRmqS6qqC6Er6m6u1xi XmP20u07rpDJVKbwGc8+lj+BkMnDkUdegw6MlZ9jEqz60OIx62URPfTAp Q==; X-CSE-ConnectionGUID: Ky42XnPuQxK/Okp36Nw4mA== X-CSE-MsgGUID: bBh1YTz8SNKwmHppzXUp1A== X-IronPort-AV: E=Sophos;i="6.11,221,1725346800"; d="scan'208";a="200707744" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Oct 2024 06:59:14 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 21 Oct 2024 06:58:54 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 21 Oct 2024 06:58:50 -0700 From: Daniel Machon Subject: [PATCH net-next 00/15] net: sparx5: add support for lan969x switch device Date: Mon, 21 Oct 2024 15:58:37 +0200 Message-ID: <20241021-sparx5-lan969x-switch-driver-2-v1-0-c8c49ef21e0f@microchip.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAA1eFmcC/x2NQQqDMBAAvyJ77oLGRk2/Ij3EuNaFdiubYAPi3 5v2OAzMHBBJmSLcqgOUdo78lgLNpYKwenkQ8lwYTG2uTd10GDev2eLTi+tcxvjhFFaclXdSNNg HWqzth9a1A5TIprRw/g9GEEoolBPci5l8JJzUS1h/g5dngfP8AhHsB92RAAAA To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , Lars Povlsen , Steen Hegelund , , , , , , Richard Cochran , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , CC: , , , Steen Hegelund , X-Mailer: b4 0.14-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_065917_806722_3BA1C813 X-CRM114-Status: GOOD ( 17.02 ) 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 == Description: This series is the second of a multi-part series, that prepares and adds support for the new lan969x switch driver. The upstreaming efforts is split into multiple series (might change a bit as we go along): 1) Prepare the Sparx5 driver for lan969x (merged) --> 2) add support lan969x (same basic features as Sparx5 provides excl. FDMA and VCAP). 3) Add support for lan969x VCAP, FDMA and RGMII == Lan969x in short: The lan969x Ethernet switch family [1] provides a rich set of switching features and port configurations (up to 30 ports) from 10Mbps to 10Gbps, with support for RGMII, SGMII, QSGMII, USGMII, and USXGMII, ideal for industrial & process automation infrastructure applications, transport, grid automation, power substation automation, and ring & intra-ring topologies. The LAN969x family is hardware and software compatible and scalable supporting 46Gbps to 102Gbps switch bandwidths. == Preparing Sparx5 for lan969x: The main preparation work for lan969x has already been merged [1]. After this series is applied, lan969x will have the same functionality as Sparx5, except for VCAP and FDMA support. QoS features that requires the VCAP (e.g. PSFP, port mirroring) will obviously not work until VCAP support is added later. == Patch breakdown: Patch #1-#4 do some preparation work for lan969x Patch #5 adds new registers required by lan969x Patch #6 adds initial match data for lan969x Patch #7 defines the lan969x register differences Patch #8 adds lan969x constants to match data Patch #9 adds some lan969x ops in bulk Patch #10 adds PTP function to ops Patch #11 adds lan969x_calendar.c for calculating the calendar Patch #12 makes additional use of the is_sparx5() macro to branch out in certain places. Patch #13 documents lan969x in the dt-bindings Patch #14 introduces new concept of devicetree target Patch #15 introduces new concept of per-SKU features [1] https://lore.kernel.org/netdev/20241004-b4-sparx5-lan969x-switch-driver-v2-0-d3290f581663@microchip.com/ To: David S. Miller To: Eric Dumazet To: Jakub Kicinski To: Paolo Abeni To: andrew@lunn.ch To: Lars Povlsen To: Steen Hegelund To: horatiu.vultur@microchip.com To: jensemil.schulzostergaard@microchip.com To: Parthiban.Veerasooran@microchip.com To: Raju.Lakkaraju@microchip.com To: UNGLinuxDriver@microchip.com To: Richard Cochran To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: jacob.e.keller@intel.com To: ast@fiberby.net To: maxime.chevallier@bootlin.com Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Steen Hegelund Cc: devicetree@vger.kernel.org Signed-off-by: Daniel Machon --- Daniel Machon (15): net: sparx5: add support for lan969x SKU's and core clock net: sparx5: change spx5_wr to spx5_rmw in cal update() net: sparx5: change frequency calculation for SDLB's net: sparx5: add sparx5 context pointer to a few functions net: sparx5: add registers required by lan969x net: lan969x: add match data for lan969x net: lan969x: add register diffs to match data net: lan969x: add constants to match data net: lan969x: add lan969x ops to match data net: lan969x: add PTP handler function net: lan969x: add function for calculating the DSM calendar net: sparx5: use is_sparx5() macro throughout dt-bindings: net: add compatible strings for lan969x SKU's net: sparx5: add compatible strings for lan969x and verify the target net: sparx5: add feature support .../bindings/net/microchip,sparx5-switch.yaml | 17 +- MAINTAINERS | 7 + drivers/net/ethernet/microchip/Kconfig | 1 + drivers/net/ethernet/microchip/Makefile | 1 + drivers/net/ethernet/microchip/lan969x/Kconfig | 5 + drivers/net/ethernet/microchip/lan969x/Makefile | 13 + drivers/net/ethernet/microchip/lan969x/lan969x.c | 349 +++++++++++++++++++++ drivers/net/ethernet/microchip/lan969x/lan969x.h | 56 ++++ .../ethernet/microchip/lan969x/lan969x_calendar.c | 190 +++++++++++ .../net/ethernet/microchip/lan969x/lan969x_regs.c | 223 +++++++++++++ drivers/net/ethernet/microchip/sparx5/Makefile | 1 + .../ethernet/microchip/sparx5/sparx5_calendar.c | 72 +++-- .../net/ethernet/microchip/sparx5/sparx5_fdma.c | 2 +- .../net/ethernet/microchip/sparx5/sparx5_main.c | 272 +++++++++++++++- .../net/ethernet/microchip/sparx5/sparx5_main.h | 76 ++++- .../ethernet/microchip/sparx5/sparx5_main_regs.h | 132 ++++++++ .../net/ethernet/microchip/sparx5/sparx5_mirror.c | 10 +- .../net/ethernet/microchip/sparx5/sparx5_netdev.c | 26 +- .../net/ethernet/microchip/sparx5/sparx5_packet.c | 16 +- .../net/ethernet/microchip/sparx5/sparx5_port.c | 46 +++ drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 13 +- drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 3 +- .../net/ethernet/microchip/sparx5/sparx5_regs.c | 5 +- .../net/ethernet/microchip/sparx5/sparx5_regs.h | 5 +- .../net/ethernet/microchip/sparx5/sparx5_sdlb.c | 10 +- .../ethernet/microchip/sparx5/sparx5_tc_flower.c | 5 + 26 files changed, 1471 insertions(+), 85 deletions(-) --- base-commit: 30d9d8f6a2d7e44a9f91737dd409dbc87ac6f6b7 change-id: 20241016-sparx5-lan969x-switch-driver-2-7cef55783938 Best regards,