From nobody Fri Oct 3 05:29:23 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2A18280312; Thu, 4 Sep 2025 20:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757018398; cv=none; b=XepLoWFcrxJYBlMHpFxE3QZqR/xDWCPgkogtyLvaJ1FmYZiUDN9bGHmXkQvaRXGMVEjjxU3oe2E2FIwofsHZmzPKaDMAdhecOHTv53Y6/Ow/PKaWpThrDV2iB69mOedXKET/Oo0qyBsyFYkdniwK5bwjzKLtrrqQMkmFqND2gJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757018398; c=relaxed/simple; bh=Uzh/7AbIGXEzufg8t9H9NLgIIwPD1Tkw2KWwSSBivZs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=trQ8Aa2s1gpNuafat5OaZzEZfL/yMrrB0ZElyaBF++PUtmzbnLvcqjBMBM6a/+Ao0ldzG/pv93k2HlQT1mOWg9RiZSzlge8TYKEinBHFL5tQ3YoyZlhfmp2m3zXPPO4bSv4OMsAr8Bs75a9pEVlz6ljcz437yRgUlmQNksYBPwY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OQDPLxsz; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OQDPLxsz" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-45b8b1a104cso14195555e9.2; Thu, 04 Sep 2025 13:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757018395; x=1757623195; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fizy83t1JAhLvYW6Ng4v/axqSLgHAjf0OCGjjfhXeLQ=; b=OQDPLxszaSWFjeCGboWaWH1946tESo0346XhSIvUrWF3HovP2Iv3ccVrdc4mTQraCW U54wn+JqyTZxPhB8hdjdgPDl8ecEYuiDAYRUc2oE6suwtnTF15SfqhNUCD0lXKfHjvj3 YWWnGu2YJWdLj1zRnF57I67SBtBnRdw8ObyWsx6aaruJhKLwBs6136lE7px6kj9OHM5Z ojgqFUh72rJIfrgMuN52gQdXDyxAmyPkqUny+oRsTZUtyZc6qFSAkZfhcIFAZ4N9800h fhOcEhF47QfvC8EX3ZQ6MCf8FQ3AGP0teErHga+SifQQ8dw43FQwony4nNcH6M58Yjnv 27WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757018395; x=1757623195; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fizy83t1JAhLvYW6Ng4v/axqSLgHAjf0OCGjjfhXeLQ=; b=xLAonMv/0WdnTc9sjpHv7s8CC95Ab485xMlog+zvpIwBUFzLZmy3QZLoL0OR/ktwjD KPLoZXokSMvFFUY0LtwCS30ZLt8ZJAdp3FfnGCAUosGo8XOt6CoaISCwuiZDCiObf1vL nxjPRbHTIyC4+W99SCh6CQst+UlRegmo9m5YVqAjXf1W6j7KQHhHQxQjk/KGwvOsRKRY mjfGtfOWQ8FuYVO8tiQRHEyXCp/YkGI3Qc1Zw0BjAzVbv+9VLTV2M8DW6+Wvt6X7zfTK vVdepMC9M9Yn7p0nfBpCoQ5zfO3/sas4qcYyNPdpnPEa3SB0yS6tUQjRHCZPt6y7WyMl uZPg== X-Forwarded-Encrypted: i=1; AJvYcCV4JD3actRF/tPEaW89KFUSi+/ah7rkeGwT92Rzdvz0S025NpM4YBz3U+W5Hu69b5k/61+/rpH0YVu84Iks@vger.kernel.org, AJvYcCWQb0R80gM0z8z+NhpbziWzbadjTOJbhVrJr40shVGNk8OmLIseu1du5koPEQATieuav1qO0uzCPIxg@vger.kernel.org, AJvYcCXkcUgq/4JptQhttD3kVYR5llOIpSWr3CbxpfmUWHMmdK5SQ+fx/2jhOj9p701zu3OOkiCn/+pRIkrqM1zxNaHMRK0=@vger.kernel.org X-Gm-Message-State: AOJu0YwXfaK22lNZdxsZ9XTGyQBk6Avg/BwuuM4OsInrnGWYtLP6CdU6 3MjMM8BetacLE4JG6HnfH7gPv9Gb2Sj0+6EbtJMNL40QZHsuFFp+SKwASjHqL/m4 X-Gm-Gg: ASbGnctuDmVe0qIVUYbLoHEoC8whhzzI3FJGcrhet2zJqh682f5op4wbFQnBKe4xyU6 vHAs5+ojIRfGSjNVe4IZ81ouEfvFoiTD7C4z1fjCMm8HKQ/NLCNlqNijk7SsawpKhk5B3y/odkh J9fWCpjLzlBQd31H6o/G3mNQ7SaRGJTF7/0PGkNtDKCVt/o717oJRxZTwRijKpyrm86f+xFCGiQ OhRpF2FRdwgu41kftoECnrBAI5y/+rJjrIKH9U40sRPh67yoMJL7840gRzr3bYN2SnEdIjmNh/M wA7CVPicDzJSVXgqrwn4VmzIeb4RqBNtcGzaBxGHiV6PNvxfLXeANH4QjAKjT/YMqis0/WEkPtf 6tNNdEiKA8hNHhTeoU+RTIAGF7xSKwZFFug4Qh6fSW4ODiTU= X-Google-Smtp-Source: AGHT+IENq8QST6cBLls+zIuIq3hvfJjjYPXgjXYTa9U5XxkuNBCv6PPwCKKnufsIwdZ9KJddA59LCw== X-Received: by 2002:a05:600c:458b:b0:45d:d5e2:f65d with SMTP id 5b1f17b1804b1-45dd5e2f7f4mr6413535e9.4.1757018394763; Thu, 04 Sep 2025 13:39:54 -0700 (PDT) Received: from iku.Home ([2a06:5906:61b:2d00:904e:70c8:edf3:59a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f306c93sm385528165e9.14.2025.09.04.13.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 13:39:54 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm , Giuseppe Cavallaro , Jose Abreu Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next v2 1/3] dt-bindings: net: renesas,rzv2h-gbeth: Document Renesas RZ/T2H and RZ/N2H SoCs Date: Thu, 4 Sep 2025 21:39:47 +0100 Message-ID: <20250904203949.292066-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250904203949.292066-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250904203949.292066-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add device tree binding support for the Gigabit Ethernet MAC (GMAC) IP on Renesas RZ/T2H and RZ/N2H SoCs. While these SoCs use the same Synopsys DesignWare MAC version 5.20 as RZ/V2H, they are synthesized with different hardware configurations. Add new compatible strings "renesas,r9a09g077-gbeth" for RZ/T2H and "renesas,r9a09g087-gbeth" for RZ/N2H, with the latter using RZ/T2H as fallback since they share identical GMAC IP. Update the schema to handle hardware differences between SoC variants. RZ/T2H requires only 3 clocks compared to 7 on RZ/V2H, supports 8 RX/TX queue pairs instead of 4, and needs 2 reset controls with reset-names property versus a single unnamed reset. RZ/T2H also has the split header feature enabled which is disabled on RZ/V2H. Add support for an optional pcs-handle property to connect the GMAC to the MIIC PCS converter on RZ/T2H. Use conditional schema validation to enforce the correct clock, reset, and interrupt configurations per SoC variant. Extend the base snps,dwmac.yaml schema to accommodate the increased interrupt count, supporting up to 19 interrupts and extending the rx-queue and tx-queue interrupt name patterns to cover queues 0-7. Signed-off-by: Lad Prabhakar --- v1->v2: - Squshed incerasing interrupt count changes to snps,dwmac.yaml into this p= atch. - Dropped un-necessary blank lines. - Switched using "renesas,r9a09g077-gbeth" compatible string for RZ/T2H instead of "renesas,rzt2h-gbeth" and used it as a fallback for RZ/N2H. - Added pcs-handle property required for RZ/T2H. - Updated description for reset property. - Updated commit message to reflect changes. --- .../bindings/net/renesas,rzv2h-gbeth.yaml | 178 ++++++++++++++---- .../devicetree/bindings/net/snps,dwmac.yaml | 9 +- 2 files changed, 143 insertions(+), 44 deletions(-) diff --git a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml= b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml index 23e39bcea96b..bd53ab300f50 100644 --- a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml +++ b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml @@ -17,63 +17,111 @@ select: - renesas,r9a09g047-gbeth - renesas,r9a09g056-gbeth - renesas,r9a09g057-gbeth + - renesas,r9a09g077-gbeth + - renesas,r9a09g087-gbeth - renesas,rzv2h-gbeth required: - compatible =20 properties: compatible: - items: - - enum: - - renesas,r9a09g047-gbeth # RZ/G3E - - renesas,r9a09g056-gbeth # RZ/V2N - - renesas,r9a09g057-gbeth # RZ/V2H(P) - - const: renesas,rzv2h-gbeth - - const: snps,dwmac-5.20 + oneOf: + - items: + - enum: + - renesas,r9a09g047-gbeth # RZ/G3E + - renesas,r9a09g056-gbeth # RZ/V2N + - renesas,r9a09g057-gbeth # RZ/V2H(P) + - const: renesas,rzv2h-gbeth + - const: snps,dwmac-5.20 + - items: + - const: renesas,r9a09g077-gbeth # RZ/T2H + - const: snps,dwmac-5.20 + - items: + - const: renesas,r9a09g087-gbeth # RZ/N2H + - const: renesas,r9a09g077-gbeth + - const: snps,dwmac-5.20 =20 reg: maxItems: 1 =20 clocks: - items: - - description: CSR clock - - description: AXI system clock - - description: PTP clock - - description: TX clock - - description: RX clock - - description: TX clock phase-shifted by 180 degrees - - description: RX clock phase-shifted by 180 degrees + oneOf: + - items: + - description: CSR clock + - description: AXI system clock + - description: PTP clock + - description: TX clock + - description: RX clock + - description: TX clock phase-shifted by 180 degrees + - description: RX clock phase-shifted by 180 degrees + - items: + - description: CSR clock + - description: AXI system clock + - description: TX clock =20 clock-names: - items: - - const: stmmaceth - - const: pclk - - const: ptp_ref - - const: tx - - const: rx - - const: tx-180 - - const: rx-180 - - interrupts: - minItems: 11 + oneOf: + - items: + - const: stmmaceth + - const: pclk + - const: ptp_ref + - const: tx + - const: rx + - const: tx-180 + - const: rx-180 + - items: + - const: stmmaceth + - const: pclk + - const: tx =20 interrupt-names: - items: - - const: macirq - - const: eth_wake_irq - - const: eth_lpi - - const: rx-queue-0 - - const: rx-queue-1 - - const: rx-queue-2 - - const: rx-queue-3 - - const: tx-queue-0 - - const: tx-queue-1 - - const: tx-queue-2 - - const: tx-queue-3 + oneOf: + - items: + - const: macirq + - const: eth_wake_irq + - const: eth_lpi + - const: rx-queue-0 + - const: rx-queue-1 + - const: rx-queue-2 + - const: rx-queue-3 + - const: tx-queue-0 + - const: tx-queue-1 + - const: tx-queue-2 + - const: tx-queue-3 + - items: + - const: macirq + - const: eth_wake_irq + - const: eth_lpi + - const: rx-queue-0 + - const: rx-queue-1 + - const: rx-queue-2 + - const: rx-queue-3 + - const: rx-queue-4 + - const: rx-queue-5 + - const: rx-queue-6 + - const: rx-queue-7 + - const: tx-queue-0 + - const: tx-queue-1 + - const: tx-queue-2 + - const: tx-queue-3 + - const: tx-queue-4 + - const: tx-queue-5 + - const: tx-queue-6 + - const: tx-queue-7 =20 resets: - items: - - description: AXI power-on system reset + oneOf: + - items: + - description: AXI power-on system reset + - items: + - description: AXI power-on system reset + - description: AHB reset + + pcs-handle: + description: + phandle pointing to a PCS sub-node compatible with + Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml# + (Refer RZ/T2H portion in the DT-binding file) =20 required: - compatible @@ -87,6 +135,56 @@ required: allOf: - $ref: snps,dwmac.yaml# =20 + - if: + properties: + compatible: + contains: + const: renesas,r9a09g077-gbeth + then: + properties: + clocks: + maxItems: 3 + + clock-names: + maxItems: 3 + + interrupts: + minItems: 19 + + interrupt-names: + minItems: 19 + + resets: + minItems: 2 + + reset-names: + minItems: 2 + + required: + - reset-names + else: + properties: + clocks: + minItems: 7 + + clock-names: + minItems: 7 + + interrupts: + minItems: 11 + maxItems: 11 + + interrupt-names: + minItems: 11 + maxItems: 11 + + resets: + maxItems: 1 + + pcs-handle: false + + reset-names: false + unevaluatedProperties: false =20 examples: diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Docume= ntation/devicetree/bindings/net/snps,dwmac.yaml index 4e3cbaa06229..658c004e6a5c 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -75,6 +75,7 @@ properties: - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos - renesas,r9a06g032-gmac + - renesas,r9a09g077-gbeth - renesas,rzn1-gmac - renesas,rzv2h-gbeth - rockchip,px30-gmac @@ -118,11 +119,11 @@ properties: =20 interrupts: minItems: 1 - maxItems: 11 + maxItems: 19 =20 interrupt-names: minItems: 1 - maxItems: 11 + maxItems: 19 items: oneOf: - description: Combined signal for various interrupt events @@ -134,9 +135,9 @@ properties: - description: The interrupt that occurs when HW safety error trig= gered const: sfty - description: Per channel receive completion interrupt - pattern: '^rx-queue-[0-3]$' + pattern: '^rx-queue-[0-7]$' - description: Per channel transmit completion interrupt - pattern: '^tx-queue-[0-3]$' + pattern: '^tx-queue-[0-7]$' =20 clocks: minItems: 1 --=20 2.51.0 From nobody Fri Oct 3 05:29:23 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7A9B284686; Thu, 4 Sep 2025 20:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757018399; cv=none; b=frrWf8jduBKNixbTwUT8GYDePzCM36cR+/Z9Ri5yrhwle0cA5Dgx63WLtnZE7xzLhmZUiFEXwZoFPQ6/gGZjM0gsajGWLX9v+AC02aOpW5X9SXv2G1fjRV5N+s9l0B6h/u+bkGX03w+U266WnwjedqVncGJikZLzId+ZHKp2xAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757018399; c=relaxed/simple; bh=4bAKkh6BD6JmetgbkSB16uXZqYYxr163qG0AcTsPvNg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LzwBTRX+4l4+EJx+KSnmpWCu0XZkzgZ83RWlWg1+F+13+pAiEmFqqSXM7qqyKlvvahryITwwXI+6/t9d2qK5vREgGf9gu71RnK2I/z7ptJaCI7dX8w1WEBxGjRkqpHF/llrtrnPXLafdKvHami+SYpA06vHzuVvOXjTiNGAGNGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ui0V2EkC; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ui0V2EkC" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-45b7722ea37so8005065e9.1; Thu, 04 Sep 2025 13:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757018396; x=1757623196; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MdIf5gVpTwGEVzWTa0+48WrGpkdmS6Z3zAuyAh9kXOw=; b=Ui0V2EkCIMvsEmjTr2+wp2lOMnT0qvl/ROFwkGw2YOenTKrqCFJ0HFWimVvk3Jp35t 8p7yfVFRXjq6aHY8nd40k4xgs05skXg2/djTO7bx3mRutEvMuGPXlRrqluP/LAFOWDBU IbTPREmqgjCrmNqShbEwmSpoflt3k91gvxUterd+5QhSgiEKbf5OF0+j8DDB9HTWk0t+ v0HwrnDCVdzqF7b+pL5+iGYJ42N1Qo8rLgTT1o5aya905FLV+25CkEp3K51Ppb2hVVyq Jr3ylgYHetiJ+vWwtzwbah82+BxBpRRbk/BYVYJzOb0ppl9cQJgdjkNZ9UZc4tI2wE0O zfeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757018396; x=1757623196; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MdIf5gVpTwGEVzWTa0+48WrGpkdmS6Z3zAuyAh9kXOw=; b=Ji/DYzkRm6uaeXz3THPOFKoLSrEgJBPRjxItkCHqz8CSUYocu8MVdYDdhZyvgV5zUx n86sHua+qBkjMo4IHEoa4zU3TnJCYZX/Mey+671TvTp/isz/9/FjKtV4/OC2UjVdwaEZ TpXTVuSXzzAx6iN53EcT5AighRj/SgLbkYrP+uaI3RUvnsQ0g1b7kHunbGOqEL+k44Ep jgW6aSlkQ1kCRK/lYQWrsXca3CtsT0h86bWeOSwsBWs9/yRr2P1OipHtvxwDNs3o3pf6 oYPLA9PAA7KkIs5RkMkomE34sQfYh0/Z6xcWF71AQLfgVflhhnqCJiim2AHVHAdlRzph I89Q== X-Forwarded-Encrypted: i=1; AJvYcCUgL4AMwy07xSMavrCt4hYtMHidoo72qzKQJwLeSP+8dvVCiRaJCF8RD/wfwPRIYYDhpR1arXLZ2Lc+g6n1CDp6LT0=@vger.kernel.org, AJvYcCWeUZ1HmfzlutiYvRSWHRtXpdeW4zTR6l8I8BGYocjkjjP3V109E3jfQJwUxbT+1vp/oXR6eWIzjW+V@vger.kernel.org, AJvYcCXwPf4yWYDbqG7XKkQP/ytOQ9ucmESmkdfJ8CsukMHW79KG1uPTBRs43WzMQ/Cuka0HjvBSaQgH+urqwnrU@vger.kernel.org X-Gm-Message-State: AOJu0YwIyyBdA8z0OEziKB0GL8fN6tKse0faOzqvjVU2Yqq2Xi/cmaXS hK7fGokOtiXf9VFAOgcEW6RXwdLqbObLD9GjEWV8S2LqrL/Rs2DG0bAg X-Gm-Gg: ASbGncsK7tsJZAnm+cznhp97sszwFoMEvoyYKW7VWBqT9375wi6BhJRSCVAZCK2kfNB 6WmSoeaTq6zwe+MYGX+8MWbb1th/gtoeWzulGHzDdi5OJqcadJOxFkiCuJujWwLysLzyAJmRQPh O17UutEhW3TfquNKHOzrNnaC7I59hLrxSLokMe9Hx3p7JYsqYQaLkBSo8fuJQjx9jujswi+AESY YXdUg2pJvhwQuKbdkGDUQ8N7UX10SDy4RyRbxoj1RwNCSd4M26L5dRo3Pszte9hIp0PeSThoGcG sFq0TTJ6fe/vpJKLLRE4OqkVIQnDVVIDl1tgaMaTg5WyFlLZo6wKT8hTbGkih9ZZuJ9TmPEZU5T +A2kMBmo/9DwiuXvrzTAFmCdEpHvy+8dd/wDPxRy6t8XlpRZ9C4dfnjwuSw== X-Google-Smtp-Source: AGHT+IHRTq0c9/U3clgYS/p+MF96IzAw4NdSVmzLuPTx5EY7YzBTRKNNSm4tAMGAq21gTWaRf+ycWg== X-Received: by 2002:a05:600c:350e:b0:45b:47e1:ef7b with SMTP id 5b1f17b1804b1-45dd5b5f591mr9778465e9.17.1757018396031; Thu, 04 Sep 2025 13:39:56 -0700 (PDT) Received: from iku.Home ([2a06:5906:61b:2d00:904e:70c8:edf3:59a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f306c93sm385528165e9.14.2025.09.04.13.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 13:39:55 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm , Giuseppe Cavallaro , Jose Abreu Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next v2 2/3] net: stmmac: dwmac-renesas-gbeth: Use OF data for configuration Date: Thu, 4 Sep 2025 21:39:48 +0100 Message-ID: <20250904203949.292066-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250904203949.292066-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250904203949.292066-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Prepare for adding RZ/T2H SoC support by making the driver configuration selectable via OF match data. While the RZ/V2H(P) and RZ/T2H use the same version of the Synopsys DesignWare MAC (version 5.20), the hardware is synthesized with different options. To accommodate these differences, introduce a struct holding per-SoC configuration such as clock list, number of clocks, TX clock rate control, and STMMAC flags, and retrieve it from the device tree match entry during probe. Signed-off-by: Lad Prabhakar --- v1->v2: - No changes --- .../stmicro/stmmac/dwmac-renesas-gbeth.c | 57 +++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/dr= ivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c index df4ca897a60c..022e595a9e1b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c @@ -16,12 +16,34 @@ #include #include #include +#include #include #include +#include =20 #include "stmmac_platform.h" =20 +/** + * struct renesas_gbeth_of_data - OF data for Renesas GBETH + * + * @clks: Array of clock names + * @num_clks: Number of clocks + * @stmmac_flags: Flags for the stmmac driver + * @handle_reset: Flag to indicate if reset control is + * handled by the glue driver or core driver. + * @set_clk_tx_rate: Flag to indicate if Tx clock is fixed or + * set_clk_tx_rate is needed. + */ +struct renesas_gbeth_of_data { + const char * const *clks; + u8 num_clks; + u32 stmmac_flags; + bool handle_reset; + bool set_clk_tx_rate; +}; + struct renesas_gbeth { + const struct renesas_gbeth_of_data *of_data; struct plat_stmmacenet_data *plat_dat; struct reset_control *rstc; struct device *dev; @@ -70,6 +92,7 @@ static void renesas_gbeth_exit(struct platform_device *pd= ev, void *priv) =20 static int renesas_gbeth_probe(struct platform_device *pdev) { + const struct renesas_gbeth_of_data *of_data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; struct device *dev =3D &pdev->dev; @@ -91,14 +114,17 @@ static int renesas_gbeth_probe(struct platform_device = *pdev) if (!gbeth) return -ENOMEM; =20 - plat_dat->num_clks =3D ARRAY_SIZE(renesas_gbeth_clks); + of_data =3D of_device_get_match_data(&pdev->dev); + gbeth->of_data =3D of_data; + + plat_dat->num_clks =3D of_data->num_clks; plat_dat->clks =3D devm_kcalloc(dev, plat_dat->num_clks, sizeof(*plat_dat->clks), GFP_KERNEL); if (!plat_dat->clks) return -ENOMEM; =20 for (i =3D 0; i < plat_dat->num_clks; i++) - plat_dat->clks[i].id =3D renesas_gbeth_clks[i]; + plat_dat->clks[i].id =3D of_data->clks[i]; =20 err =3D devm_clk_bulk_get(dev, plat_dat->num_clks, plat_dat->clks); if (err < 0) @@ -109,25 +135,36 @@ static int renesas_gbeth_probe(struct platform_device= *pdev) return dev_err_probe(dev, -EINVAL, "error finding tx clock\n"); =20 - gbeth->rstc =3D devm_reset_control_get_exclusive(dev, NULL); - if (IS_ERR(gbeth->rstc)) - return PTR_ERR(gbeth->rstc); + if (of_data->handle_reset) { + gbeth->rstc =3D devm_reset_control_get_exclusive(dev, NULL); + if (IS_ERR(gbeth->rstc)) + return PTR_ERR(gbeth->rstc); + } =20 gbeth->dev =3D dev; gbeth->plat_dat =3D plat_dat; plat_dat->bsp_priv =3D gbeth; - plat_dat->set_clk_tx_rate =3D stmmac_set_clk_tx_rate; + if (of_data->set_clk_tx_rate) + plat_dat->set_clk_tx_rate =3D stmmac_set_clk_tx_rate; plat_dat->init =3D renesas_gbeth_init; plat_dat->exit =3D renesas_gbeth_exit; - plat_dat->flags |=3D STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY | - STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP | - STMMAC_FLAG_SPH_DISABLE; + plat_dat->flags |=3D gbeth->of_data->stmmac_flags; =20 return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); } =20 +static const struct renesas_gbeth_of_data renesas_gbeth_of_data =3D { + .clks =3D renesas_gbeth_clks, + .num_clks =3D ARRAY_SIZE(renesas_gbeth_clks), + .handle_reset =3D true, + .set_clk_tx_rate =3D true, + .stmmac_flags =3D STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY | + STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP | + STMMAC_FLAG_SPH_DISABLE, +}; + static const struct of_device_id renesas_gbeth_match[] =3D { - { .compatible =3D "renesas,rzv2h-gbeth", }, + { .compatible =3D "renesas,rzv2h-gbeth", .data =3D &renesas_gbeth_of_data= }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, renesas_gbeth_match); --=20 2.51.0 From nobody Fri Oct 3 05:29:23 2025 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 477CB2857E0; Thu, 4 Sep 2025 20:39:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757018401; cv=none; b=Qw54Q5JaahnNIvFI58RxpaSX8d66NbvFY3snvsi7FlI+Ivx2iafz8EFt8Qb2Svjp//dm91pnwCcyeGXnZdEQBOfN89/Fn8gVyFhIybu1TRP+ZJnYcqcBVUNRAXQVeVRnc/ouUOUM3OqVx8FlwXSflImeFpj/pyZdbKhv+3jHvqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757018401; c=relaxed/simple; bh=5rVAO1b+rFZd27BiDRBWI1x2fCIeQsIzD1TFaLcjjhI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ok/B4p3bZg/gKSrobLpJ7+nKn3QOCoJZQcz8fCPu3dv2eZZBtJfTGZXQ4WAGyRJa5k22wXQITcVUPXDm8J9R8k+DuDksDXApjZvmv4ffiYHuioSThAmkq4OLuYjbKpKKk5sS8yEogHXxOmPTi+nR77BYzvlzDKKUmP9j04ELi7Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ao5/uwlj; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ao5/uwlj" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-45b8b2712d8so13550415e9.3; Thu, 04 Sep 2025 13:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757018397; x=1757623197; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3HWs5BM/Zczfcib8xW5oddFZsmYZHDcxWDdtx5r08Kk=; b=Ao5/uwlj+wc5D44huPVey3MFyQkEiSXY+g1ywlN4JJtrTQg2jJWIOOncC4K6ATvR0e 5QDuTRovcnz1Jw7G+49rE4AV2tszNcItW3aL9x9dEUpyq2QiXn8J21q98ttIB9OiPvij ccAu4YxDO6nwqm0kcMfGlexns1Lix9liXUpbAq4hhNeo4hZVruHIVsAvXIXCIwM/rQ1C Uh2d0yEgJN0XzZIAmhBPISVncpK/r6V7on78PeRH1NojYztsVB5tFZPsakgb1rrBNDwU AbGOBQdQDfm71N7nigH4d1O/D09ydGio8ZIv0RWfpQbDBfMhQheg4SWizHW6ZvlrflYI SaOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757018397; x=1757623197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3HWs5BM/Zczfcib8xW5oddFZsmYZHDcxWDdtx5r08Kk=; b=QF+mnVXzanIygeiX1xRbarD246/0Aar7CsisazCyA49botu99WuIw3qxzSg6wZElC7 rhxvWB+WnXXix0yIRIsQi9tjfkvrjKlsuLbmQRvCnhbqPJ61WqAPfcMlf0fVE35m0gul FMmxZTjCUSu1/eaBga/C0WhpiZrkkwy3egr/FqlXpfwEBGevJxnaIzzfw6Bv8uTHAyFw l3XwOsbo5I6PpzTfOoVcak8BBJIF+PHsZP9KWgJA0vnBynjWuNRCvkx7aQaZSdoBxx17 sieApBXzirrlJpD3fPhWPTYilixTUB5Jz4bo9UJJv3gaZQgdZRqOf0qMqh2W2pKCkPgs BxLg== X-Forwarded-Encrypted: i=1; AJvYcCWrgNc6RXTczl8moJ5ji+uLlZVZelrOx5PN5IFlrrhxeRryb0cluuOhKjsc0zRtc9Nx/IsALIZfQtoUJ1Hh0EQ0VQQ=@vger.kernel.org, AJvYcCX66IXj2X/n+1grP9kj2klcN+gv7OeVdraByBGL1i0Cf94IvlVh5nbooaSAFucchbOnPU+F7nYLPllE@vger.kernel.org, AJvYcCXYWDKhByp9ZWJ271AEDujB8gmxuQ3Gxcdntv+0Pq7VsSwO5Nlk+pLC2A688GjVpssqadSpCgT1Zwuz/iS0@vger.kernel.org X-Gm-Message-State: AOJu0Ywjmut1wlUNZDaXapOcLfNFAAtE4UWX6GVAbL5eqh+577PTJFba l+klUvktVw6JVcQPVGyO04CaEArO4U7wIZrVt9M8Id1U+2MKq15ND8yc X-Gm-Gg: ASbGncvdW+q+lvQwgTqE6y9YXGSwX1cOaC2eQnkqKpHQP5w1zfC91NU02rk0jiobIzf z85QcfwYX3TnJidXFrlBXpM4gd8CBzHBOpvd9jl1Fgl5AVmtv33r9kHg4CvpIJdxfZAEVHVPyKF cAH2q/QA5soDewUudwoa9RdsDCd/PEmQhx+UioIhjso4R0wouxtwwtdxKI6lBLAL4oqGaM6X8Cs /z+Ky/dS958E3WOI2hrh2byowq5YzTl0gRfL4BYAO2hQaMy+unIrlZ+HCfj4CQLYTHPAmKaXryU v7KxulPXd0T0lgAQCyyT+vNBB5jqbArsakQQTZRKuCqD895+Me+YQ/v8gm+GOIwI/f6DDwrkpon EIoJKooVi0zbDEJMeUE46y1AD2hinHKSFJbWJT5DOrA7HlYmMktwSBfWcfg== X-Google-Smtp-Source: AGHT+IHL1oc02XZbGobYDQotXvvBze1vwYgK+kccWNcOGisk96waxJM71NYowbvY/REwkkmrpI/Nag== X-Received: by 2002:a05:600c:a04:b0:45b:7d24:beac with SMTP id 5b1f17b1804b1-45b8553335amr189504555e9.10.1757018397490; Thu, 04 Sep 2025 13:39:57 -0700 (PDT) Received: from iku.Home ([2a06:5906:61b:2d00:904e:70c8:edf3:59a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f306c93sm385528165e9.14.2025.09.04.13.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 13:39:56 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm , Giuseppe Cavallaro , Jose Abreu Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next v2 3/3] net: stmmac: dwmac-renesas-gbeth: Add support for RZ/T2H SoC Date: Thu, 4 Sep 2025 21:39:49 +0100 Message-ID: <20250904203949.292066-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250904203949.292066-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250904203949.292066-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Extend the Renesas GBETH stmmac glue driver to support the RZ/T2H SoC, where the GMAC is connected through a MIIC PCS. Introduce a new `has_pcs` flag in `struct renesas_gbeth_of_data` to indicate when PCS handling is required. When enabled, the driver parses the `pcs-handle` phandle, creates a PCS instance with `miic_create()`, and wires it into phylink. Proper cleanup is done with `miic_destroy()`. New init/exit/select hooks are added to `plat_stmmacenet_data` for PCS integration. Update Kconfig to select `PCS_RZN1_MIIC` when building the Renesas GBETH driver so the PCS support is always available. Signed-off-by: Lad Prabhakar --- v1->v2: - Switched using "renesas,r9a09g077-gbeth" compatible string for RZ/T2H instead of "renesas,rzt2h-gbeth". --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 1 + .../stmicro/stmmac/dwmac-renesas-gbeth.c | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethe= rnet/stmicro/stmmac/Kconfig index 67fa879b1e52..a01c83b109f9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -136,6 +136,7 @@ config DWMAC_RENESAS_GBETH tristate "Renesas RZ/V2H(P) GBETH support" default ARCH_RENESAS depends on OF && (ARCH_RENESAS || COMPILE_TEST) + select PCS_RZN1_MIIC help Support for Gigabit Ethernet Interface (GBETH) on Renesas RZ/V2H(P) SoCs. diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/dr= ivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c index 022e595a9e1b..129543c37a5e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ * handled by the glue driver or core driver. * @set_clk_tx_rate: Flag to indicate if Tx clock is fixed or * set_clk_tx_rate is needed. + * @has_pcs: Flag to indicate if the MAC has a PCS */ struct renesas_gbeth_of_data { const char * const *clks; @@ -40,6 +42,7 @@ struct renesas_gbeth_of_data { u32 stmmac_flags; bool handle_reset; bool set_clk_tx_rate; + bool has_pcs; }; =20 struct renesas_gbeth { @@ -53,6 +56,41 @@ static const char *const renesas_gbeth_clks[] =3D { "tx", "tx-180", "rx", "rx-180", }; =20 +static const char *const renesas_gmac_clks[] =3D { + "tx", +}; + +static int renesas_gmac_pcs_init(struct stmmac_priv *priv) +{ + struct device_node *np =3D priv->device->of_node; + struct device_node *pcs_node; + struct phylink_pcs *pcs; + + pcs_node =3D of_parse_phandle(np, "pcs-handle", 0); + if (pcs_node) { + pcs =3D miic_create(priv->device, pcs_node); + of_node_put(pcs_node); + if (IS_ERR(pcs)) + return PTR_ERR(pcs); + + priv->hw->phylink_pcs =3D pcs; + } + + return 0; +} + +static void renesas_gmac_pcs_exit(struct stmmac_priv *priv) +{ + if (priv->hw->phylink_pcs) + miic_destroy(priv->hw->phylink_pcs); +} + +static struct phylink_pcs *renesas_gmac_select_pcs(struct stmmac_priv *pri= v, + phy_interface_t interface) +{ + return priv->hw->phylink_pcs; +} + static int renesas_gbeth_init(struct platform_device *pdev, void *priv) { struct plat_stmmacenet_data *plat_dat; @@ -149,6 +187,11 @@ static int renesas_gbeth_probe(struct platform_device = *pdev) plat_dat->init =3D renesas_gbeth_init; plat_dat->exit =3D renesas_gbeth_exit; plat_dat->flags |=3D gbeth->of_data->stmmac_flags; + if (of_data->has_pcs) { + plat_dat->pcs_init =3D renesas_gmac_pcs_init; + plat_dat->pcs_exit =3D renesas_gmac_pcs_exit; + plat_dat->select_pcs =3D renesas_gmac_select_pcs; + } =20 return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); } @@ -163,7 +206,16 @@ static const struct renesas_gbeth_of_data renesas_gbet= h_of_data =3D { STMMAC_FLAG_SPH_DISABLE, }; =20 +static const struct renesas_gbeth_of_data renesas_gmac_of_data =3D { + .clks =3D renesas_gmac_clks, + .num_clks =3D ARRAY_SIZE(renesas_gmac_clks), + .stmmac_flags =3D STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY | + STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP, + .has_pcs =3D true, +}; + static const struct of_device_id renesas_gbeth_match[] =3D { + { .compatible =3D "renesas,r9a09g077-gbeth", .data =3D &renesas_gmac_of_d= ata }, { .compatible =3D "renesas,rzv2h-gbeth", .data =3D &renesas_gbeth_of_data= }, { /* Sentinel */ } }; --=20 2.51.0