From patchwork Mon Apr 7 12:03:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 14040330 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 D697122FAF4; Mon, 7 Apr 2025 12:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744027410; cv=none; b=Qcb+w17+RQUhjDi3ubFVezH6fweRs2dsyYpz2htcn/iB3bhutANSinwP2XbIVRv53/x/Xa/b9Bvc1kw5EWefidynFVKX0tkqVqi6wVMCi2nKHLtkA2Eq5E3aYdil9PQfd+/mlk5MJmtRAIqRMo7EfK/mkZym5cU0MRvmHZXcT3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744027410; c=relaxed/simple; bh=ZyN/AKbobE4O5TsQyMKbKesPAa3qDUgNOgMjj/0s2To=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R0ymAZ5IHhRoM/FZmSOgBwkumIEtfBB0tDnGaifWj4vcDrfucnRC3cEXekOOKpRzP9u/U2Tn02qGvYX90fyVNa1jNH7RF2fLbPkIlJi0C/gQ0bnXUhOfSA2XQY4wQu65bpfkM2oDWnLczGmIPtYSU0DgOLSWJKBBbwDfLmogJh8= 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=Vo6iqFwR; arc=none smtp.client-ip=209.85.221.46 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="Vo6iqFwR" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-391342fc1f6so3815769f8f.1; Mon, 07 Apr 2025 05:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744027407; x=1744632207; 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=fG6cklCkHNYJxMIIK0GDMVqFSaYHTVH2UbG4fjsK7gc=; b=Vo6iqFwRIUl80baYHy6/eN38aT0rCSfTa7r0waSkAOmTAwk20tL/shvuMKWlDE2Tfs o7Wmj1cYbxfv+8cufX/D2EMT1VMBYAdmC5knE9xctRxEzMqYWNc4ec7vtCPIJyOgPCIc npfe9/lvUPHldJgACaFvX2KUsuho/XDFOMIGwXvwDT9zZZcvB+Rwh3yCGfhjvRKFTsOv 6Lp+E49QgVgj13EmthLbdTpuotLylgu/SszfEuN6Yb9P3B/t93sg9TfYi7mHNiU0Cxzi y6OkYVm+rj9jhZLheMQ83zwFkIMp8umS9LyJ8/Sp+pv2dIHRskR6ZYl886Xe4qEbAEIo z9+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744027407; x=1744632207; 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=fG6cklCkHNYJxMIIK0GDMVqFSaYHTVH2UbG4fjsK7gc=; b=C93J1dSEnjDG1/Ck+St1EhoxGsaqlADHLkdV8X90XTYqAUmdJlUTdwVifwhETN7d4z chZi4HXGnUl42BcW5G8iB08pGTpmdy5fcFDzpki3oM3eY6gbCJvJTvvyEdB711NUTk99 X8Xs9wyoPukxRisgjxdUTWS0gWY9VENwTbOWA6qv12pHyi+6xu6hj5RwkA1nu0dqsVVN k6ZnghEKyOWzU+i19fbbSP9T7I767dua/RpZYTuCatWNrD1lLw7XY29kZPdqAe4WV9dy JhO6eeoQ7FBH/BcqaCUHT2Danttz8GYcLHCiphfcvNIfuglVpWMA5NGorPuWGt7JgskP bHpw== X-Forwarded-Encrypted: i=1; AJvYcCV9xkK1xT92u0vTDrvRraIXHgH6Ogs1KuFfQvAsBnRlu30410IWEFnWjsSxLUhRbd1kefFZ1UPDtcxSdbp1KBYZe94=@vger.kernel.org, AJvYcCXEFNi9bUciLYDk2b3QvVRAQ+ELYV8Rln5KL9JoNTz/Extr6oz1+Z9sdv3LPoxiuMtVTyrc/xdGkGS7@vger.kernel.org, AJvYcCXLtl6zML3DCexGBt2ZN0qi3ioqGek/T5ze7+km5l0rQIVLHsC4CuEOZfi8spMr7w9FrPGhNtzeFKkx3yLw@vger.kernel.org X-Gm-Message-State: AOJu0Yye/U/DIW0W1FPuk89JWeiHK/CTvj2C1IQNuGqjEgD3EM+bu3+n roobf9BeHQmIxvowAUCbMl7DLgGxp3PqfEoWIKyVUM9u2D4yYwVX X-Gm-Gg: ASbGncucsEhY9R1MMVI5RqiCpAaC44fC4AKZe5PYKVLI+PK+A8y2kAq3pSrUFPHzk5v oNtxbp7NOF0Uo5G67i11IRSn3XDaY0oYbpwJZv6R32/WtkO3VWI2VkMF6VblvXUFvm+9xlvdDwp c3QZYQDw9EBbl9F5Am0FM20zfZAyWX0DezfPkIUF1pP5yxwDM4Ita7X2XOd10+PVi7F3yRu5/7d ucw5Wsfu/M2o9tHpQtDbABMOVdKRenSw5tN1smsiiKCYdNCWpHF3m7At/Qg6l6cJHFMefx8NKne 2EbmUW1Iwxol/ERdwHl0nsh8Dg4jex1EjdWgeR/AHjnKp8/HNesB7pKWL02obz5mXNoiyQ== X-Google-Smtp-Source: AGHT+IEbZIVKSwKGcZGaZkVGFNqeu45TBBjhVhTZoMPStlgPwCbQmNhtEp6XGXu00ZWclskzPkReog== X-Received: by 2002:a05:6000:2407:b0:39c:1efb:ee8a with SMTP id ffacd0b85a97d-39d0de67a97mr9832691f8f.38.1744027406917; Mon, 07 Apr 2025 05:03:26 -0700 (PDT) Received: from iku.Home ([2a06:5906:61b:2d00:78b9:80c2:5373:1b49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3020d943sm11986976f8f.74.2025.04.07.05.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 05:03:26 -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 , Geert Uytterhoeven , Magnus Damm , "Russell King (Oracle)" , Giuseppe Cavallaro , Jose Abreu Cc: netdev@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, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next v5 1/3] dt-bindings: net: dwmac: Increase 'maxItems' for 'interrupts' and 'interrupt-names' Date: Mon, 7 Apr 2025 13:03:15 +0100 Message-ID: <20250407120317.127056-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250407120317.127056-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250407120317.127056-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Increase the `maxItems` value for the `interrupts` and `interrupt-names` properties to 11 to support additional per-channel Tx/Rx completion interrupts on the Renesas RZ/V2H(P) SoC, which features the `snps,dwmac-5.20` IP. Refactor the `interrupt-names` property by replacing repeated `enum` entries with a `oneOf` list. Add support for per-channel receive and transmit completion interrupts using regex patterns. Signed-off-by: Lad Prabhakar Reviewed-by: Rob Herring (Arm) --- v4->v5 - No change v3->v4 - Fixed maxItems for interrupt-names property - Added RB tag from Rob v2->v3 - Dropped adding `additionalItems` - Moved interrupts description into interrupt-names - Replaced enum with a oneOf and added Rx/Tx regex patterns v1->v2 - No change --- .../devicetree/bindings/net/snps,dwmac.yaml | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 78b3030dc56d..4d4fcaeca8a8 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -114,19 +114,25 @@ properties: interrupts: minItems: 1 - items: - - description: Combined signal for various interrupt events - - description: The interrupt to manage the remote wake-up packet detection - - description: The interrupt that occurs when Rx exits the LPI state - - description: The interrupt that occurs when HW safety error triggered + maxItems: 11 interrupt-names: minItems: 1 + maxItems: 11 items: - - const: macirq - - enum: [eth_wake_irq, eth_lpi, sfty] - - enum: [eth_wake_irq, eth_lpi, sfty] - - enum: [eth_wake_irq, eth_lpi, sfty] + oneOf: + - description: Combined signal for various interrupt events + const: macirq + - description: The interrupt to manage the remote wake-up packet detection + const: eth_wake_irq + - description: The interrupt that occurs when Rx exits the LPI state + const: eth_lpi + - description: The interrupt that occurs when HW safety error triggered + const: sfty + - description: Per channel receive completion interrupt + pattern: '^rx-queue-[0-3]$' + - description: Per channel transmit completion interrupt + pattern: '^tx-queue-[0-3]$' clocks: minItems: 1 From patchwork Mon Apr 7 12:03:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 14040331 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 7A0792459DF; Mon, 7 Apr 2025 12:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744027412; cv=none; b=m9StND5vucBGyYBzm0NUkb9cLEynfucK4NZm+nYTRdux2i2ckP7SKYny3d9Bpnk94Bamce0BzZwkmd2Fa4HPLPCQz7wwA2kNk+7bSopZtRe8by3UemAF12LvelVRLradh0b1XJAYohtBd1lPYlVuU5BOxwjxSuI9n80B3oguTc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744027412; c=relaxed/simple; bh=mpPm/YXyFVhuw2LsswcQDRpQksNhChNOzdeViYkM+U4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CewgPd2N5iyeRqTlmIUeW2yO0l/X/9A0NhVEphAx67zilhxwnhujKMEMdVsSleiREU+G9h/8WjdwXMtSrARCt7vRPWdVyRaGhlsGMJuNyrHIuylsBmtl1Z7fhvEMEurnuPUp9CkqPs8/q7lbMctlsySLwx8stTfKWAXsG/2iqFc= 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=a7lRpqw6; arc=none smtp.client-ip=209.85.128.53 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="a7lRpqw6" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43cf0d787eeso47002465e9.3; Mon, 07 Apr 2025 05:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744027409; x=1744632209; 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=P5Ix48oRIT+HGTyPb9AccXXigQ/v++2JPi/QLW8EM4M=; b=a7lRpqw6/+vV4ix+cBzXstWX04B8xl7sczrlUnPWHH73RZWwaiSVhGwdmS1+sGl1R2 qO4NrVEgYIF//M6aFdpr+8pWOhSainK3qOr1OHgPDyyN48Oo5kd/heF4pyp9XzlVj73z qKwMzeRR9ucAgB7vHzn4inIrBfDZBoR8PpkVQcfIke9Ph6Au4gP2ADnLn8Uy/+eiRcC/ /fgNl++1/o/DIvmPcltSrUAc9Tiv7rx0ispWsPdbxxUK7YGKTxdjb0Einyt+vIHz868j aR31D8AfFv1IirRZBzHmQOiPWJ0JZ6rhQ6h18HyOGgrP2zKw+QrgBk6rMRkEl1LgAPOQ K3BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744027409; x=1744632209; 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=P5Ix48oRIT+HGTyPb9AccXXigQ/v++2JPi/QLW8EM4M=; b=tMSCqb4eQ1BpZlZIEvYH+8H9EMksJ8qEnUBAwtRfhrXgxs6E6WFKDetlhA8qD9mjjb 3CjxSJoTRUCJg8ai9gdUOy8ggZYTIf2RkK8Rt0u0LK0N8qHMU+yfQE/AO3PBflePJHYc m8oKgHZXVZWlThLwI8gqXZBtBCmtwurj3Da5G9DqHnBqzpCFMLJtA9mQRE7k+RIHxHcF VjKedYOJwyaXNAxeTCBz/QUT0Oj08H2DvHB4zK8GhMQ9W5ILjLLNDxdvA2vvPEMMG3sN BpBrnl4TLmtfkI/3khndULyFSNd8kmJrh7D1nVQmC9YjYHbSdWpIVYmUhdbMzwx7+96T yhig== X-Forwarded-Encrypted: i=1; AJvYcCUln6BmzSmyp7bnveYm/Pxot1Xk3btnws+Nu5BbqIyH/FBIfL5Bi4rvkEriJV+p2Cfk3BtaxQvsQ976O64p@vger.kernel.org, AJvYcCXkRQhxnnX9rCvF04KT09j664Uy89uVfT5MEfOXCc0TyCkLHowXMCf3twEcrI+KIvglwUYuq4kzCrF6qAD+1jGcjSE=@vger.kernel.org, AJvYcCXqtAaTiRYWeixOaCgFpu/VpZa6WgJ9y5MsxzJniJu00i99sUWkR3n7BvBxrCw8e0l44RvQjtR/wcmb@vger.kernel.org X-Gm-Message-State: AOJu0YzCfuM7ESEH+MGsPfGv6SkjzfhYYVXTmGlRqYx/QTDRrvgxRyAq QrBsOiWiI3/WCRGur8t9vsP7wyvmbWE0wPK6hi1SrcC1nvGgR6xv X-Gm-Gg: ASbGncuXO6xCpn/+U7P0ySIQ2V4/jnAwSoBTEpg+wIFdmRppvePi5pHmMztY/2jy6To 5JfYuQ/5ctKgR+a17z4Ti1ZXSK1oWw2lFf9yy6edcIP1pbZ6p+IWkciVyqt6myWaT5sUjefyiRM OI6FI/Nu8u0nYI2Dxll5w0gKkLTxUanAGRUNmDEboctCZYD/+8EbuBcoGscLdx5H20o9+Iurh2m rNOZcb1nXR7fNo9z0unlRAFA8AasrjDDCHic6XyzQGOoXEzvpKEEoSlMzJPIndQ9iR1MwtzxQ4x YhY1OxzfQH/tiKvaT7ILw3JV9ZFDM25uIH5zGZdWQnm0Oi2brMksrvBAOAxaButQZq042w== X-Google-Smtp-Source: AGHT+IGv0WPEhaxZ3KFf2ynxyZh1pTzIGfLq7WSPwZd1xfiZPI9qiPF8P8FlBP+2g6f4DtbJ3H397w== X-Received: by 2002:a05:600c:3d05:b0:43c:fdbe:439b with SMTP id 5b1f17b1804b1-43ed0b76649mr112092695e9.4.1744027408323; Mon, 07 Apr 2025 05:03:28 -0700 (PDT) Received: from iku.Home ([2a06:5906:61b:2d00:78b9:80c2:5373:1b49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3020d943sm11986976f8f.74.2025.04.07.05.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 05:03:27 -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 , Geert Uytterhoeven , Magnus Damm , "Russell King (Oracle)" , Giuseppe Cavallaro , Jose Abreu Cc: netdev@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, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next v5 2/3] dt-bindings: net: Document support for Renesas RZ/V2H(P) GBETH Date: Mon, 7 Apr 2025 13:03:16 +0100 Message-ID: <20250407120317.127056-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250407120317.127056-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250407120317.127056-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar GBETH IP on the Renesas RZ/V2H(P) SoC is integrated with Synopsys DesignWare MAC (version 5.20). Document the device tree bindings for the GBETH glue layer. Generic compatible string 'renesas,rzv2h-gbeth' is added since this module is identical on both the RZ/V2H(P) and RZ/G3E SoCs. The Rx/Tx clocks supplied for GBETH on the RZ/V2H(P) SoC is depicted below: Rx / Tx -------+------------- on / off ------- | | Rx-180 / Tx-180 +---- not ---- on / off ------- Signed-off-by: Lad Prabhakar Reviewed-by: Rob Herring (Arm) --- v4->v5 - No change v3->v4 - No change v2->v3 - Dropped interrupts description from interrupts property as snps,dwmac.yaml already describes it. - Dropped snps,en-tx-lpi-clockgating as this is being marked as deprecated. - Updated Rx/Tx interrupt names to match the regex from patch 1/3 - Listed Rx interrupts before Tx interrupts in example node for consistency. v1->v2 - Updated commit description - Updated interrupts description for clarity - Updated interrupt-names for clarity - Updated example node --- .../bindings/net/renesas,r9a09g057-gbeth.yaml | 201 ++++++++++++++++++ .../devicetree/bindings/net/snps,dwmac.yaml | 1 + 2 files changed, 202 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/renesas,r9a09g057-gbeth.yaml diff --git a/Documentation/devicetree/bindings/net/renesas,r9a09g057-gbeth.yaml b/Documentation/devicetree/bindings/net/renesas,r9a09g057-gbeth.yaml new file mode 100644 index 000000000000..02a6793c26f5 --- /dev/null +++ b/Documentation/devicetree/bindings/net/renesas,r9a09g057-gbeth.yaml @@ -0,0 +1,201 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/renesas,r9a09g057-gbeth.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GBETH glue layer for Renesas RZ/V2H(P) (and similar SoCs) + +maintainers: + - Lad Prabhakar + +select: + properties: + compatible: + contains: + enum: + - renesas,r9a09g057-gbeth + - renesas,rzv2h-gbeth + required: + - compatible + +properties: + compatible: + items: + - enum: + - renesas,r9a09g057-gbeth # RZ/V2H(P) + - const: renesas,rzv2h-gbeth + - const: snps,dwmac-5.20 + + reg: + maxItems: 1 + + 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 + + clock-names: + items: + - const: stmmaceth + - const: pclk + - const: ptp_ref + - const: tx + - const: rx + - const: tx-180 + - const: rx-180 + + interrupts: + minItems: 11 + + 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 + + resets: + items: + - description: AXI power-on system reset + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + - resets + +allOf: + - $ref: snps,dwmac.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + + ethernet@15c30000 { + compatible = "renesas,r9a09g057-gbeth", "renesas,rzv2h-gbeth", "snps,dwmac-5.20"; + reg = <0x15c30000 0x10000>; + clocks = <&cpg CPG_MOD 0xbd>, <&cpg CPG_MOD 0xbc>, + <&ptp_clock>, <&cpg CPG_MOD 0xb8>, + <&cpg CPG_MOD 0xb9>, <&cpg CPG_MOD 0xba>, + <&cpg CPG_MOD 0xbb>; + clock-names = "stmmaceth", "pclk", "ptp_ref", + "tx", "rx", "tx-180", "rx-180"; + resets = <&cpg 0xb0>; + interrupts = , + , + , + , + , + , + , + , + , + , + ; + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi", + "rx-queue-0", "rx-queue-1", "rx-queue-2", + "rx-queue-3", "tx-queue-0", "tx-queue-1", + "tx-queue-2", "tx-queue-3"; + phy-mode = "rgmii-id"; + snps,multicast-filter-bins = <256>; + snps,perfect-filter-entries = <128>; + rx-fifo-depth = <8192>; + tx-fifo-depth = <8192>; + snps,fixed-burst; + snps,force_thresh_dma_mode; + snps,axi-config = <&stmmac_axi_setup>; + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,txpbl = <32>; + snps,rxpbl = <32>; + phy-handle = <&phy0>; + + stmmac_axi_setup: stmmac-axi-config { + snps,lpi_en; + snps,wr_osr_lmt = <0xf>; + snps,rd_osr_lmt = <0xf>; + snps,blen = <16 8 4 0 0 0 0>; + }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <4>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + snps,map-to-dma-channel = <0>; + }; + + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + snps,map-to-dma-channel = <1>; + }; + + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + snps,map-to-dma-channel = <2>; + }; + + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + snps,map-to-dma-channel = <3>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <4>; + + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + }; + + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + }; + + queue3 { + snps,dcb-algorithm; + snps,priority = <0x1>; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 4d4fcaeca8a8..b525eca53850 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -75,6 +75,7 @@ properties: - qcom,sm8150-ethqos - renesas,r9a06g032-gmac - renesas,rzn1-gmac + - renesas,rzv2h-gbeth - rockchip,px30-gmac - rockchip,rk3128-gmac - rockchip,rk3228-gmac From patchwork Mon Apr 7 12:03:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 14040332 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 DEA7524A041; Mon, 7 Apr 2025 12:03:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744027414; cv=none; b=EWplwRSjtpGOFoAv6vt5sE4zu7r6LZ9C0QIRbfpRNW2EXjFE6yG/0hTTFxFeweGv7zPfZKRj1HOA40hyzrCoR5wYPc/6ikX25ufF5Nr5NxEa4TDbjzf4hD7Snvwxds8kLTopK4b5llMTgMzy7XSIsrjlkU2GfMsGrbDr1YieGvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744027414; c=relaxed/simple; bh=XDIKwYmYHGQ2b/el+QvziXPsq3LTw/P1t5tMGx3sEro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m37+BJV9S53K7T+wGO20PweyVvrjXPVkzodBVGOhemADLQMfsSi+f38qYAiX8Qst7IZ/voLQyhRX8Vrcuuc7A6epB6k/UCgh5Krdtckd18/AW/2aEekvcdK+ckwlPLWqNoROjgzX2ezJY/Nm1G9TX0ve9P9LSQ2lLGnng0XD0yw= 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=NS3nrsPW; arc=none smtp.client-ip=209.85.128.44 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="NS3nrsPW" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-43cf58eea0fso21812695e9.0; Mon, 07 Apr 2025 05:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744027410; x=1744632210; 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=0jlNLcnvNhGWozOP5TrJtnP4GKF2MIUGeUULPGVlJT8=; b=NS3nrsPW33/JEJLYTISARNPbtcLJMUOpLMl77pDPz9AOoSrOdBW2Vop25oLEd4NYbO T8N85PY+DHm24aBbwHfZGTsidGcXIKCZXkGa3WnoYj4qHVJfTphC2XAByRtL5UbTUvgK xnIbQloAooV/r/E9rnkrsbcsPBJo18Smg1aHcD5ci1uPdRRWlE1zXTIMq93e+SUNmdrJ W2JhMG0lLMI7xrs/bPxtUbUykxAqJ3uGghD0FOaD3iT5D88RjRn56SIqzi4+BV77C6O4 BsbjDoJZ8mX6WQTjqsrCnaRdRJkS1cL7aNuHzy2mYWQsU5mIpUn0/95HqYTrytcFoVkv +pZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744027410; x=1744632210; 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=0jlNLcnvNhGWozOP5TrJtnP4GKF2MIUGeUULPGVlJT8=; b=alFlWkiUvcN0cbdqIHO/62t9goC6gj04exVD0R4utqyFL4VZTyTRTgqOlEqzJ6x9b5 pUVmDMD3EEmyikE/BQGosnU0fkB0bXhEsHPpll48aXssiNLqg9vdvlbqj3zdODS+/lhY gJhS0g7r+2lykGxGAaSLI04eBKc2xEe60MNPdQx2V4t40dToz0P9Q1ajFGdH6ah7Jkz8 aUbxW3pfFzU45h6Bkqd+p00kCzpujzotAOuZS1Uyt/hfT9CimWBq2V4zqENIPB9FN3ja TUSrrqUEWB424hl2IBH3YWxFRbgIpPYcPJ+fuhJZf4z2+e1v+Fy2nr01UXCKPa6p1b86 ucyw== X-Forwarded-Encrypted: i=1; AJvYcCUtSRqsYHejpluG/lgbocsmONajRzb0PIGC24xRxKtiBMyTXhVndKDGcQ4aEAf0DONZAx8/hf6AUpqKFEKF@vger.kernel.org, AJvYcCV5JcHLOw/W/tQbd7gA3Ez27nUscjHDlU3mQj0RQOd9LovV5h/459l1tlW3ScZ8cf7pJv0jGl2M2tDZs9OIFkYZD8A=@vger.kernel.org, AJvYcCWxZA3PsjaPyPn5RfCu0d7/36O6TTX5EAXcqyX6TU8ukmQpGK1cBC9TA05IYX13ydM+QxSY8Zzxxq3p@vger.kernel.org X-Gm-Message-State: AOJu0YyRwEafQ++GNTQE6U9RbJ4ryh5ftvAj/pHZVMai2qnT94TE+7tB 9tXaBLDkqHF8WKG+kpsJ6hQJ4ocelGY52SPbNp81MRCQL6YyD0hS X-Gm-Gg: ASbGnctzfsCoUxnk2aoq5kdckAke+rfdVhKL16stPlYw5JT9Lh0FS3Ms/m1NoKyxcgl z8UCmkZpS473QXjNpyhkWvphHUeC8iWIbnnPd+fyiRULIvlY+sYb2edzJFWrYcjwXMH9lSHgHEp Cv4Q+1af9I7wGTtnSpn7O8RyaLGTgdtkUsPjKX07gjeAodcVM9KB+LHcO6Kvfa1/TJyzY+OycSc Zp5d6h3Sg/qGzynye7HVX+KSOE1LccG3Mn5amczhEV4sLlfhqf7Sw5RMUC/Qbb0geBjek6fdwWm U84j8blBe3vsFF8FiofkP0+iFadn3ZMI7QOYUlqw4NiGgtJY7LT1i42FmtgsvntK6h0dzg== X-Google-Smtp-Source: AGHT+IGjyUFck3wj/SREofHb8DcLu2Hm+aJoMFoZTMjKyCtTdhHd82E1VavPVf6TKGM9uUY5c0MBiw== X-Received: by 2002:a05:600c:1e13:b0:439:8c80:6af4 with SMTP id 5b1f17b1804b1-43ecf8d0b48mr110786015e9.19.1744027409649; Mon, 07 Apr 2025 05:03:29 -0700 (PDT) Received: from iku.Home ([2a06:5906:61b:2d00:78b9:80c2:5373:1b49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3020d943sm11986976f8f.74.2025.04.07.05.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 05:03:28 -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 , Geert Uytterhoeven , Magnus Damm , "Russell King (Oracle)" , Giuseppe Cavallaro , Jose Abreu Cc: netdev@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, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next v5 3/3] net: stmmac: Add DWMAC glue layer for Renesas GBETH Date: Mon, 7 Apr 2025 13:03:17 +0100 Message-ID: <20250407120317.127056-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250407120317.127056-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250407120317.127056-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Add the DWMAC glue layer for the GBETH IP found in the Renesas RZ/V2H(P) SoC. Signed-off-by: Lad Prabhakar --- v4->v5 - No change v3->v4 - Maintained reverse christmas tree order in renesas_gbeth_clks_config - Returned err in case of success in renesas_gbeth_probe() v2->v3 - Handle clks from plat_dat - Replaced STMMAC_FLAG_EN_TX_LPI_CLOCKGATING flag with STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP. v1->v2 - Dropped __initconst for renesas_gbeth_clks array - Added clks_config callback - Dropped STMMAC_FLAG_RX_CLK_RUNS_IN_LPI flag as this needs investigation. --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + .../stmicro/stmmac/dwmac-renesas-gbeth.c | 165 ++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 3c820ef56775..2c99b23f0faa 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -131,6 +131,17 @@ config DWMAC_QCOM_ETHQOS This selects the Qualcomm ETHQOS glue layer support for the stmmac device driver. +config DWMAC_RENESAS_GBETH + tristate "Renesas RZ/V2H(P) GBETH support" + default ARCH_RENESAS + depends on OF && (ARCH_RENESAS || COMPILE_TEST) + help + Support for Gigabit Ethernet Interface (GBETH) on Renesas + RZ/V2H(P) SoCs. + + This selects the Renesas RZ/V2H(P) Soc specific glue layer support + for the stmmac device driver. + config DWMAC_ROCKCHIP tristate "Rockchip dwmac support" default ARCH_ROCKCHIP diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index 594883fb4164..91050215511b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_DWMAC_LPC18XX) += dwmac-lpc18xx.o obj-$(CONFIG_DWMAC_MEDIATEK) += dwmac-mediatek.o obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o +obj-$(CONFIG_DWMAC_RENESAS_GBETH) += dwmac-renesas-gbeth.o obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o obj-$(CONFIG_DWMAC_S32) += dwmac-s32.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c new file mode 100644 index 000000000000..a0f7cacea810 --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * dwmac-renesas-gbeth.c - DWMAC Specific Glue layer for Renesas GBETH + * + * The Rx and Tx clocks are supplied as follows for the GBETH IP. + * + * Rx / Tx + * -------+------------- on / off ------- + * | + * | Rx-180 / Tx-180 + * +---- not ---- on / off ------- + * + * Copyright (C) 2025 Renesas Electronics Corporation + */ + +#include +#include +#include +#include +#include + +#include "dwmac4.h" +#include "stmmac_platform.h" + +struct renesas_gbeth { + struct plat_stmmacenet_data *plat_dat; + struct reset_control *rstc; + struct device *dev; + void __iomem *regs; +}; + +static const char *const renesas_gbeth_clks[] = { + "tx", "tx-180", "rx", "rx-180", +}; + +static struct clk *renesas_gbeth_find_clk(struct plat_stmmacenet_data *plat_dat, + const char *name) +{ + for (unsigned int i = 0; i < plat_dat->num_clks; i++) + if (!strcmp(plat_dat->clks[i].id, name)) + return plat_dat->clks[i].clk; + + return NULL; +} + +static int renesas_gbeth_clks_config(void *priv, bool enabled) +{ + struct plat_stmmacenet_data *plat_dat; + struct renesas_gbeth *gbeth = priv; + int ret; + + plat_dat = gbeth->plat_dat; + if (enabled) { + ret = reset_control_deassert(gbeth->rstc); + if (ret) { + dev_err(gbeth->dev, "Reset deassert failed\n"); + return ret; + } + + ret = clk_bulk_prepare_enable(plat_dat->num_clks, plat_dat->clks); + if (ret) + reset_control_assert(gbeth->rstc); + } else { + clk_bulk_disable_unprepare(plat_dat->num_clks, plat_dat->clks); + ret = reset_control_assert(gbeth->rstc); + if (ret) + dev_err(gbeth->dev, "Reset assert failed\n"); + } + + return ret; +} + +static int renesas_gbeth_probe(struct platform_device *pdev) +{ + struct plat_stmmacenet_data *plat_dat; + struct stmmac_resources stmmac_res; + struct device *dev = &pdev->dev; + struct renesas_gbeth *gbeth; + unsigned int i; + int err; + + err = stmmac_get_platform_resources(pdev, &stmmac_res); + if (err) + return dev_err_probe(dev, err, + "failed to get resources\n"); + + plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); + if (IS_ERR(plat_dat)) + return dev_err_probe(dev, PTR_ERR(plat_dat), + "dt configuration failed\n"); + + gbeth = devm_kzalloc(dev, sizeof(*gbeth), GFP_KERNEL); + if (!gbeth) + return -ENOMEM; + + plat_dat->num_clks = ARRAY_SIZE(renesas_gbeth_clks); + plat_dat->clks = devm_kcalloc(dev, plat_dat->num_clks, + sizeof(*plat_dat->clks), GFP_KERNEL); + if (!plat_dat->clks) + return -ENOMEM; + + for (i = 0; i < plat_dat->num_clks; i++) + plat_dat->clks[i].id = renesas_gbeth_clks[i]; + + err = devm_clk_bulk_get(dev, plat_dat->num_clks, plat_dat->clks); + if (err < 0) + return err; + + plat_dat->clk_tx_i = renesas_gbeth_find_clk(plat_dat, "tx"); + if (!plat_dat->clk_tx_i) + return dev_err_probe(dev, -EINVAL, + "error finding tx clock\n"); + + gbeth->rstc = devm_reset_control_get_exclusive(dev, NULL); + if (IS_ERR(gbeth->rstc)) + return PTR_ERR(gbeth->rstc); + + gbeth->dev = dev; + gbeth->regs = stmmac_res.addr; + gbeth->plat_dat = plat_dat; + plat_dat->bsp_priv = gbeth; + plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate; + plat_dat->clks_config = renesas_gbeth_clks_config; + plat_dat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY | + STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP | + STMMAC_FLAG_SPH_DISABLE; + + err = renesas_gbeth_clks_config(gbeth, true); + if (err) + return err; + + err = stmmac_dvr_probe(dev, plat_dat, &stmmac_res); + if (err) + renesas_gbeth_clks_config(gbeth, false); + + return err; +} + +static void renesas_gbeth_remove(struct platform_device *pdev) +{ + stmmac_dvr_remove(&pdev->dev); + + renesas_gbeth_clks_config(get_stmmac_bsp_priv(&pdev->dev), false); +} + +static const struct of_device_id renesas_gbeth_match[] = { + { .compatible = "renesas,rzv2h-gbeth", }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, renesas_gbeth_match); + +static struct platform_driver renesas_gbeth_driver = { + .probe = renesas_gbeth_probe, + .remove = renesas_gbeth_remove, + .driver = { + .name = "renesas-gbeth", + .pm = &stmmac_pltfr_pm_ops, + .of_match_table = renesas_gbeth_match, + }, +}; +module_platform_driver(renesas_gbeth_driver); + +MODULE_AUTHOR("Lad Prabhakar "); +MODULE_DESCRIPTION("Renesas GBETH DWMAC Specific Glue layer"); +MODULE_LICENSE("GPL");