From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796479486; b=qn6vw408n2iuL6CMFgbd3pFGFXr3+LnqZP9qBoIkdMtdlyFpQrI4Af60ENF/HDenDTsc iH4ifORL8wkybHZJDOEYG+X8gfUOGRGNSjU1Y2jvwWWCzQkg8TJWznRuaDALGJZNDzTEf 8f7hHaTNekGnQczumjdCT3Wzm3uu/n/5mZx1MZSGrKyzoECeP1Q9fYuE4iw796j4grl2H lcTBhPfGGn8W4M5O085/7cw7+Xm/eer7rHUih1OJoVRjj24719uxUzkjQopNpisUN2xEw vUbDH3eMwftIpRBuHInWZfPEBJFq0KuOczUlQkoNM94S4x+3AHi3xzM7LfBtHLJP90g== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796479486; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=ODzhOmmMI5AmdF/zsres/u6JQ0+XIMOFSN6+7yRfXaw=; b=Gor9f0HQJNRGgLDGoonSF+gWl63DOfg75/oaeZkmCNYgMkg+2F2iEshyx75gRi5mkY/k rTbQlk5AgK3M2eBkN3Pz5NAx7T8cTz7I3XQko5LYqe6bGFX+/CXAZZfs84bBSR7TYyCM9 zm2fe32R1PERiSqyD+GtKVjbYzLIqVYGfefPrpdQxKNv2cXoFEAzjUKJ4I9wTE6nFKVyW 33NTp4A5h1+VjyjC0RXfke0C/I0TXgWVk+kR1l0J+jkmvl9z6/9K9MslMhJXuvMAofx1U Ybl1x0HUJQafCMzoMsgDemSunltNpFqdNm483bAhcQ/flghkFiJqMLYXyww8AD1xgZg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y8fHY5vw; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01070606A333; Sat, 5 Dec 2026 14:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y8fHY5vw Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796479485; b=tJFaIhbOtpfBmEXq6ChYihLFkqJtAP+l/xSxDCOO91QTyjoCL8bq1BtUil0DUv2E1gYW Dyx/V5YV3waRoBsgODv2mztDX+7ovcxht25VOhVszEDQkN7nywLYJSbRSZHx9im91/GLj APmWhT4z4zmXabbAFaXsRfJlf/+XiHBlSH3ggQbeKdxNEJhfRnsidrluXH/h6+pz8HOjN fNKPFfbCBOIOUZ7uyHh1XYEp4a0NEyX2SertRXE1HuY4TEvC0j8kTiWBR6JKMFt9xfW8n rEBdYy3rZ5iI1t5yWxRMm+VPeKiTUfwL1WxJxf1a/qEPJqoT6gYk3u9HQgnAlnIqN5A== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796479485; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=ODzhOmmMI5AmdF/zsres/u6JQ0+XIMOFSN6+7yRfXaw=; b=TKt5UusR32mBoQEee7zlF1ixyPwFMTOwSgI5ZlHIboaOXiaEUHJM8rzD2FZkhVupfcbn BxPDkzyveE5lxImrWMnQfg8vwjTyiLleFmh4Z0AUAVZ5tiSOlreHtyhndds2LGUvNYuBY 9rG6JZvPhoZFGHMQOdPTMzCZUlBE/UKeHv65AJzkcRtbcaopJNNcY4ZwHsHiPzgmLFlEX rx1bpxsHOrXfZ2jp0yIe7SOWEfMxb64RPlHPrdFb79M9hyj9HjzioRgLJ4lnAlmkNOusb o3KXBFYaAKf/ZATqYD+zMrTnft043NRdX9EJFiGSU4ITJvu1N0SocfXz02qzToGFpCg== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 878B01F0092B; Sat, 5 Dec 2026 14:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796479485; bh=ODzhOmmMI5AmdF/zsres/u6JQ0+XIMOFSN6+7yRfXaw=; h=From:Subject:Date:To:Cc:Reply-To; b=Y8fHY5vwgg57ogPTTGXDZ0Gkx3NkYvRHWjuWsejAOcrIPjx0VJjQ6W7pHSGcarIsj xCfnLx1/Kq1/+BKWFUCgailz+9b+hFA3iw+IA3CP8lRU9WKGZhPPIwSy8ZIJ7RFwMk mwdrvT+K8h322qkTKGvUjdfyXwX70naSa3Vlp9jRPoNRzUfAmc+zglJsYWvAofs3BI VkGdnhJh0PNacQ/i5rp3EJSaKQLKFK4hPU2LAELYw1EQdFe/1aEkTZNx+HiyrLNyTU 1ui8bxKWNQoBl6iUcSXPXt+F6VzOeqF7zTPiJmNcIWCdBst3b1hrpdx03ggkZxDesR jsezkiBu14XMg== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id DA28350357; Sat, 5 Dec 2026 14:04:43 +0000 (UTC) From: Fil Dunsky via B4 Relay Subject: [PATCH net-next v9 0/3] Add Cortina Systems CS7542 network engine support Date: Sat, 05 Dec 2026 17:04:42 +0300 Message-Id: <20261205-b4-cs7542-ethernet-v9-0-8fbf7e3314a5@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33RS07DMBAG4KtEWWNkO35WCHEPxMIej9sgkkCcR q2q3h0nFDUKEcuRPZ//8VzKhH2NqdwVl7LHsU511+bCPhQlHFy7R1KHXJeccsUYr4gXBJKWghM cDti3OBBpgcngQaPGMjd+9hjr04y+ltOFFk9D+fZzko7+HWGYzNvdHr+O+d3h1uBdQgJd09TDr nDoVEAXla/AOE4FF9wJcCwGzxUa1CKgjDBRDabk5sC74umW1/6GTecEXUtGRSiRsgoggDKh6Mu +cfXHY37veU54qNPQ9ef5P0Y2B/pv9JFlL2eRaIAHSc3dm7mRLwm5SfBMBIquAoW+0nJNVEtCb RLVNFVOESrNkfmwJsSS0JuEyAQ6EQwEhZH9GUTeCU7ZJiEzQYFqGy0Yz/yaUEuCbxLTepwBZqn E6GxcE3pJbG9Ez39hnYpRe7BqTZglITYJkwnhFZeANqLhS+J6vX4DZu84AjUDAAA= X-Change-ID: 20261123-b4-cs7542-ethernet-59c15dbc7e7e To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij Cc: Philipp Zabel , Hans Ulli Kroll , Russell King , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Willem de Bruijn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796479482; l=8587; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=FLJ3wK+5Xg6MLf5yjW5hBe/Mzw+pcfUKhPN62PA7+wo=; b=M5XM1wEL0iAk8YqzVe+NX6A7pYxs/IetZHtVQwOUEWAfg/xteDppjtk4bXMz/m1JvRoUUb//h g41v6Q7aVk5CMslZAT2xW3m86TpalTNPjeSIq9JlTzsWDq79q88TIHh X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Add the CS7542 CPU network datapath with phylink for three GMACs. Almond+ connects two GMACs to QCA8337 CPU ports handled by DSA. This series depends on the combined CS7542 global controls v6 series. The consumer exclusively acquires NI, FE, TM, SCH, QM, DMA and NI-XRAM reset controls. Board DTS support is separate. The verified 64 MiB no-map queue-manager reservation is required. NAND uses PIO; a separate SSP DMA consumer cannot run concurrently with the shared DMA reset domain. Use normal NAPI weight 64 and external-DDR QM/TM setup, with no module parameters. Support scatter-gather TX and multi-buffer RX, bounded initialization, tracked DMA ownership, shared NI register serialization and protective reset before freeing active mappings. No checksum/NAT offload or performance capability is added. The port byte counters previously wrapped at 4 GiB on 32-bit ARM. Use the network core's 64-bit per-CPU totals and preserve the existing error and drop counters. Allow independent MAC addresses on each netdev. With PAUSE temporarily enabled for testing, QCA8337 PAUSE frames stopped transmission on both GMACs with different addresses. The MAC accepts PAUSE on full-duplex fixed links to a partner described as asymmetric-only. The board DTS change uses the standard asym-pause property and is separate. On Almond+ with TX PAUSE enabled for testing, no outgoing PAUSE frames were observed when the CPU RX ring filled on either GMAC. Leave hardware generation disabled and omit symmetric PAUSE from the advertised MAC capabilities. The driver exposes no MAC-level Wake-on-LAN support. The NI magic-packet comparator uses the shared MAC prefix and cannot follow arbitrary independent netdev MAC addresses. PHY-based wake support can be considered separately once the PHY capability and board wake path are verified. The driver builds for ARM with W=1 and warnings as errors, both as a module and built in. Full allmodconfig and allyesconfig builds complete with W=1 after leaving pre-existing base-tree warnings non-fatal. On Almond+, an OpenWrt RAM build exercised LAN1 over each QCA8337 CPU port with the standard two-byte QCA tag. Five two-packet ICMP exchanges succeeded while assigning and changing different MAC addresses for the two GMACs. RX/TX counters increased on the selected GMAC in each case. All MTD partitions were read-only and the watchdog returned to OpenWrt. Earlier combined-kernel Almond+ checks covered reset/probe/removal, LAN1 protected-data transfers and automatic watchdog return to normal OpenWrt. Separate earlier fixtures checked 600 UDP echoes, 20 ICMPv6 replies and 448 scatter-gather/jumbo frames. Protected-region hashes and flash layout matched; unrelated concurrent settings activity was excluded from any unchanged-settings claim. These observations predate the new retry/context fixes and are integration/functional checks, not throughput or offload results. Changes in v9: - Disable netpoll for the shared TX lock and acquire the GMAC OF node through phylink and netdev teardown. - Use standard drop/error counters and sleepable RX pool allocation. - Drain RX from the refreshed write pointer and preserve the vendor tail settle time. - Write little-endian TX descriptors, publish the head after the full mapping succeeds and program the shared DRR shaper once per port. - Honour RX PAUSE on fixed asymmetric links. In an Almond+ register A/B/A test with a congested receiver, the TCP retransmit counts were 1838 with RX PAUSE off, 75 with it on, and 1066 with it off again. - Publish consumed RX descriptors in eight-packet batches. In paired 200 Mbit/s receive tests on the combined image, the ring was nearly full in 3.80% and 0.89% of samples, with 142 and 38 TCP retransmits. The combined image includes the board DTS and downstream support. - Link to the v8 review: https://lore.kernel.org/all/sashiko-outbox-251080@kernel.org/ - Link to v8: https://patch.msgid.link/20261204-b4-cs7542-ethernet-v8-0-4b625ce9fe82@gmail.com Changes in v8: - Rebase onto current net-next (Willem de Bruijn). - Anchor MAINTAINERS independently of the global-controls entry. - Pick up Rob Herring's Reviewed-by on the unchanged binding. - Link to v7: https://patch.msgid.link/20261203-b4-cs7542-ethernet-v7-0-5d9a6ff7bc96@gmail.com Changes in v7: - Address Andrew Lunn's review. Simplify the FE return path and order local declarations. Separate RX packet handling from the NAPI loop. - Allow independent MAC addresses, retain NVMEM probe deferral and leave hardware pause disabled. - Link to v6: https://patch.msgid.link/20261202-b4-cs7542-ethernet-v6-0-a8c1905efa9f@gmail.com Changes in v6: - Keep zero-budget NAPI polling limited to TX completions. - Link to v5: https://lore.kernel.org/r/20261201-b4-cs7542-ethernet-v5-0-0c079f9c8b1b@gmail.com Changes in v5: - Use the network core's 64-bit per-CPU packet and byte totals. - Pack the MAC register value with get_unaligned_le32(). - Update the global-controls dependency to v6. - Link to v4: https://lore.kernel.org/all/20261127-b4-cs7542-ethernet-v4-0-ea4d8cd6ef18@gmail.com/ Changes in v4: - Bound DMA-owned RX head polling and defer retries with the IRQ masked. - Schedule NAPI with bottom halves disabled from process context. - Link to v3: https://lore.kernel.org/all/20261126-b4-cs7542-ethernet-v3-0-5db5d372e1bd@gmail.com/ Changes in v3: - Include FCS in RX buffer recycling and retry transient descriptor ownership. - Validate the shared MAC prefix and reject sibling-clobbering changes. - Drop the RESET_CONTROLLER select from the Ethernet consumer. - Rely on reset provider error propagation instead of redundant status reads. - Use bulk deassert on bring-up; preserve all protective assertions on teardown. - Link to v2: https://patch.msgid.link/20261125-b4-cs7542-ethernet-v2-0-d0ea3c6eb375@gmail.com Changes in v2: - Use the common parent provider and all seven exclusive reset lines; remove the virtual reset child, duplicate provider and consumer hook. - Assert and verify every line without protective-assert rollback; retain active DMA allocations on any error and deassert in reverse order. - Use rgmii-id in the binding example for switch-inserted RX/TX delays. - Remove module parameters and unused internal-buffer mode; retain the previous default external-DDR initialization policy. - Use NAPI weight64, plain static MMIO helpers and goto-based open cleanup; retain the lock-protected publication and stopping gates. - Serialize shared NI RMW and stop on the first scheduler command error. - Keep MAC preflight before hardware cleanup registration and preserve a late NVMEM probe defer instead of replacing it with a random MAC. - Recycle bounded RX fragments also when the frame is dropped. - Poll already queued RX after open and retain safe closed-port TX reaping. - Review Sashiko 231860: existing NI/SCH/NAPI fixes address the older v1; temporary BM initialization bypass clearing follows the vendor sequence. - Link to v1: https://lore.kernel.org/all/20261123-b4-cs7542-ethernet-v1-0-fdb5e8c2d508@gmail.com/ --- Fil Dunsky (3): dt-bindings: net: Add Cortina CS7542 network engine net: cortina: Add CS7542 CPU network datapath MAINTAINERS: Add CS7542 network engine support .../bindings/net/cortina,cs7542-ethernet.yaml | 162 ++ MAINTAINERS | 7 + drivers/net/ethernet/cortina/Kconfig | 13 + drivers/net/ethernet/cortina/Makefile | 3 + drivers/net/ethernet/cortina/cs752x_fe.c | 475 +++++ drivers/net/ethernet/cortina/cs752x_ne.c | 1903 ++++++++++++++++++++ drivers/net/ethernet/cortina/cs752x_ne.h | 13 + drivers/net/ethernet/cortina/cs752x_sch_tm.c | 689 +++++++ 8 files changed, 3265 insertions(+) --- base-commit: aea6deaf6b3c8a204242a4ca1fdb26e8e74de5fc change-id: 20261123-b4-cs7542-ethernet-59c15dbc7e7e prerequisite-message-id: <20261129-cs7542-syscon-v6-0-553dc4c01460@gmail.com> prerequisite-patch-id: 27fe25055bcadb3c3fbc8b6788f31c2fb791df38 prerequisite-patch-id: ae69b5cca6f4604972300a89411bdca0ea19ab57 prerequisite-patch-id: 55dc4f1e91fc85340c4422438225f50fdf636799 prerequisite-patch-id: 66fccae72a8f951ac0ee182490e98543af29bd89 prerequisite-patch-id: 7fbe9405265ef3d1ec62811415a46c0061afd7c8 prerequisite-patch-id: 01ece2c91e080d5cae6af81944159373776484ca Best regards, -- Fil Dunsky