🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15642

[PATCH net-next 6/7] dt-bindings: net: can: convert grcan to DT schema

#15642
From: Marc Kleine-Budde
Date: Fri, 13 Nov 2026 07:08
168 lines
17141 bytes
From: Quchaosheng <quchaosheng000406@163.com>

grcan.txt is the only CAN controller binding whose device does not have a
compatible string.  There are no device tree source files for LEON SPARC,
and the nodes are built by the PROM from the AMBA plug&play information,
which carries a core name and a register window but no compatible.  The
driver matches on the node name instead.

It is the last of the five CAN controller bindings that were still written
as free-form text; the other four are posted separately.

A binding without a compatible string is not selected by dtbs_check,
because nodes are matched through their compatible values.  The schema
therefore needs an explicit select on the node name.  This is the same
mechanism ethernet-phy.yaml uses for optional-compatible nodes, and
without it the schema would never be applied to anything.

Two further details are worth pointing out, because the text binding got
them wrong or left them implicit:

  - "systemid" is not a property of the controller node.  The driver and
    arch/sparc/kernel/leon_kernel.c both read it from the "/ambapp0" node,
    so it is described in the description rather than in properties.  The
    binding is stricter than the text file here, and dtbs_check now
    rejects a controller node that carries it.

  - The node name format is "<core name>@<irq>,<address>", as built by
    ambapp_path_component() in arch/sparc/kernel/prom_32.c from the "name"
    and "reg" properties of the AMBA plug&play core.  The select pattern
    and the example follow that format.

The "name" property of the text binding is not described: dtc enforces
that it equals the base node name and then deletes it from the output, so
it never reaches a compiled devicetree.

This binding does not reference can-controller.yaml, unlike the other CAN
controller schemas.  That common schema constrains the node name to
"^can(@.*)?$", which these nodes cannot satisfy -- they are named after
the AMBA plug&play core.  Referencing it makes every valid node fail.

No functional change.  The driver comment is updated by a separate patch.

Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260929073703.2748220-2-quchaosheng000406@163.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---

Notes:
    FAQ:
    
    Q: What about the comment in drivers/net/can/grcan.c?
    A: It's changed in the next patch.

 .../net/can/aeroflexgaisler,grcan.yaml        | 65 +++++++++++++++++++
 .../devicetree/bindings/net/can/grcan.txt     | 28 --------
 2 files changed, 65 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/can/aeroflexgaisler,grcan.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/can/grcan.txt

diff --git a/Documentation/devicetree/bindings/net/can/aeroflexgaisler,grcan.yaml b/Documentation/devicetree/bindings/net/can/aeroflexgaisler,grcan.yaml
new file mode 100644
index 000000000000..d5cba5b1bac1
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/aeroflexgaisler,grcan.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/can/aeroflexgaisler,grcan.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aeroflex Gaisler GRCAN and GRHCAN CAN controllers
+
+maintainers:
+  - Marc Kleine-Budde <mkl@pengutronix.de>
+
+description: |
+  The GRCAN and GRHCAN CAN controllers are available in the GRLIB VHDL IP
+  core library.
+
+  On a LEON SPARC system there are no device tree source files. The nodes
+  are built by the PROM from the AMBA plug&play information, which does not
+  provide a compatible string. The driver therefore matches on the node
+  name, which is built as "<core name>@<irq>,<address>" from the "name" and
+  "reg" properties of the AMBA plug&play core.
+
+  The GRLIB build ID is not a property of the controller node either. It is
+  read from the "systemid" property of the "/ambapp0" node, and the TX bug
+  workaround is enabled when that property is absent or when its least
+  significant 16 bits are smaller than 4100.
+
+select:
+  properties:
+    $nodename:
+      pattern: '^(01_034|01_03d|GAISLER_GRCAN|GAISLER_GRHCAN)@'
+  required:
+    - $nodename
+
+properties:
+  reg:
+    maxItems: 1
+
+  freq:
+    description:
+      Frequency of the external oscillator clock in Hz, which is the
+      frequency of the AMBA bus in the ordinary case.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  interrupts:
+    maxItems: 1
+    description:
+      Interrupt number of the controller, as built from the AMBA plug&play
+      information.
+
+required:
+  - reg
+  - freq
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    /* AMBA plug&play children are named "<core name>@<irq>,<address>" */
+    GAISLER_GRCAN@c,80000000 {
+        reg = <0x80000000 0x1000>;
+        freq = <40000000>;
+        interrupts = <12>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/net/can/grcan.txt b/Documentation/devicetree/bindings/net/can/grcan.txt
deleted file mode 100644
index 34ef3498f887..000000000000
--- a/Documentation/devicetree/bindings/net/can/grcan.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Aeroflex Gaisler GRCAN and GRHCAN CAN controllers.
-
-The GRCAN and CRHCAN CAN controllers are available in the GRLIB VHDL IP core
-library.
-
-Note: These properties are built from the AMBA plug&play in a Leon SPARC system
-(the ordinary environment for GRCAN and GRHCAN). There are no dts files for
-sparc.
-
-Required properties:
-
-- name : Should be "GAISLER_GRCAN", "01_03d", "GAISLER_GRHCAN" or "01_034"
-
-- reg : Address and length of the register set for the device
-
-- freq : Frequency of the external oscillator clock in Hz (the frequency of
-	the amba bus in the ordinary case)
-
-- interrupts : Interrupt number for this device
-
-Optional properties:
-
-- systemid : If not present or if the value of the least significant 16 bits
-	of this 32-bit property is smaller than GRCAN_TXBUG_SAFE_GRLIB_VERSION
-	a bug workaround is activated.
-
-For further information look in the documentation for the GLIB IP core library:
-http://www.gaisler.com/products/grlib/grip.pdf
-- 
2.53.0
Technical Details
Message-ID: <20261113071325.4092169-7-mkl@pengutronix.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362476-linux-kernel-netdev=dewy.ru
References: <20261113071325.4092169-1-mkl@pengutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362476-linux-kernel-netdev=dewy.ru
From: mkl@pengutronix.de (Marc Kleine-Budde)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 6/7] dt-bindings: net: can: convert grcan to DT schema
Date: Fri, 13 Nov 2026 08:08:54 +0100
Organization: Usenet Network
Message-ID: <20261113071325.4092169-7-mkl@pengutronix.de>
References: <20261113071325.4092169-1-mkl@pengutronix.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1297390"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:514O2YL3SYAUFbxN7viXe+jcX8Q= sha256:kzJfaCDffSjHjGm1HyPvfKZDF5ULS7GOqfBZJNx4fuw=
	sha1:XXLp6ZWnfKJ9GSh6tManshQDMaw= sha256:QRyVBNLXoHHlpeUTOLZ93QmKRFK+3MEiFd2+v1AU4lw=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id F15C61144C7; Fri, 13 Nov 2026 11:30:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pengutronix.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id MbzQVrDoZAnD;
	Fri, 13 Nov 2026 11:30:19 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-362476-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 5DAD9114382; Fri, 13 Nov 2026 11:30:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id C1D16162F26; Fri, 13 Nov 2026 07:15:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794554014;
	b=QA5Qs//DeYeZi2/mJZz/Q4JAYqZRH5npCUwWlYb2oTR+4LyVNmzDq5d44FJCaeCmwNZO
	 YKhSe2MexIJ8bUxBq8EZLNjNeU4yB5zdaAjRganmQ6S8nZPBck/sLuTQp9t3bfseyRPWJ
	 VTawBUN8FWXK3xZsCydFQA9mN1GJoHAgsFuu6KWGMSMwIflXiBOkID89Au6hDjAeTPmFY
	 1yo8qiYejdUUweGHKi9TIEAlzNORurAw/qcTke1e3yelYFV6tQ7X9DXY1Sc5JOeCX7Yt7
	 sonjX3anNO2LBbMaw9vYDxqJn55di50oiuMVWOOjZoDucyPfx9EggAvhnqx4A6nM9rg==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794554014;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=TYdXS0Y1B/+aEpnsy30imFC+jIXI/coSdwBL0puYj30=;
	b=njiq5MmDOw5D9ZQtbhUTMTXhhGpRsxOHrjfXJgMLX/UN4tzwhhHxfn3gxM9bF1rn3y/7
	 dca7xg3qcJ8kE2pcWk50Hy4W/FyqwsnrJ2iEuzg8pP91LXo1fmOD7KP3atTDc0CUvlymV
	 2eqBS/SEPcoja8fi3yGOWcqBXrGCdYAymPZrqTClBxINbTWz6Mru4OhB37xM5s7FHT3+v
	 U+UBroyaz+RjVf2yEvltuHHnpP83AXrc9SxAPKsRZWP7Bu+M6CB6+avItRT+y1jsRQ0GP
	 3u4C+7PsQ+JzHyGlWlN6/L8ohuS72l3fA6JVyio0hPOTQcUTr1phOC7eBo3FzWRSJRg==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=ZBRSuLXF;
	dmarc=none header.from=pengutronix.de;
	spf=pass smtp.mailfrom=pengutronix.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C6A2660A6F50;
	Fri, 13 Nov 2026 07:13:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=ZBRSuLXF
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794554014;
	b=gEIISja3vn++V9F/1OJIOaMMi8MU1P/UpEL0vgCqjkDD1pcCJZRadQM2rDWzD5FO8jAc
	 G4J8rRSQaRXwWLI0x44L3lPn1sKxC8sbXjUE8X48itL+mtJJFmOT4MDBK1nZgo8MDQy0z
	 npCU2+d0ih/8nCq5Y4hV77hq3BgH3yPhFnjFlR+OvetL7PVKofKGNPKF5IfZHrZhA78mx
	 bcyKe7/clmYfPx6D4xhjuE2yvKEdqDvtpEf6sxkPWiQbv29fR4za5FF3XAKC9L3wM0Hgz
	 tJvgLQ3y8MuGfE6ICX7av0U/pIkREj/EdAY1xwpgMHkQk1XI7vXkvDZzbYZh8v0x+bQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794554014;
	h=DMARC-Filter:Received:DKIM-Signature:Received:Received:From:To:Cc:
	 Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=TYdXS0Y1B/+aEpnsy30imFC+jIXI/coSdwBL0puYj30=;
	b=BhxaWzF23+dRP6yb8i1Loj+3rScjaxDe4Qhf2cE1hus514HG5AUUns3OcxkiPq6FfwG1
	 M2Hs66gTu28JJlhkA4mRflU2ohDK0yX3fXSaNyPwnTlzsgqhVp4u/l+V5uUqsgg+pPldJ
	 4CVmBibGgYQ/eGOu107jkLRY2OuWVQ5eV3A6a1NYYg9Ann8KrtYrR/X49liSRTSdLvB7V
	 4VSU4Z+IOGo+0xu1E7x4F/ytI41UkC2BkIT5ueTe6X5nTcKCQsbH9pq/tMpt5CZaHoXTX
	 dw4bMVSELXaVibdRR/OouJVZcszT92TnvRmDnsrIHtCL5KnU6ixcc2qWcxbIuxstAQQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=pengutronix.de;
	spf=pass smtp.mailfrom=pengutronix.de;
	dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=ZBRSuLXF;
	arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13
X-Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13])
	(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 3D11160A5BCD;
	Fri, 13 Nov 2026 07:13:33 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D11160A5BCD
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de
X-Received: from drehscheibe.grey.stw.pengutronix.de (drehscheibe.grey.stw.pengutronix.de [IPv6:2a0a:edc0:0:c01:1d::a2])
	(Authenticated sender: relay-from-drehscheibe.grey.stw.pengutronix.de)
	by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 335A9205836;
	Fri, 13 Nov 2026 08:13:28 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1794554008;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=TYdXS0Y1B/+aEpnsy30imFC+jIXI/coSdwBL0puYj30=;
	b=ZBRSuLXF74IwWxHeUbSGt/vDSpgaZTLHsw79hltwZGQg63pjPvkKcddJZBrD0GBHvFszsv
	KXzuVniU4p5ztJBWUWukj4dLEkdps/3PfhrdBTLniYk8wuGD7sbs+7ZdCgiEUERCKGECPF
	DBBAo0XMGLg79zwLSdMu2QJpSXEr9S7h2IrL9dbFBSa8rwwYhEJnz4ZWy2pPCOFKSwI9Pt
	KozRwONSISkJ81dcwlQToXKvMiZIZoKBCm6CWTXgWTMp6EUYZYnABeQHLj8dTgjVtDMRpi
	rLmcrv48ETfR4/yB7GZLfT+bqA1I+URFfVwyk8apBCQrTbpxl/gUraVKnwdFpQ==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1794554008;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=TYdXS0Y1B/+aEpnsy30imFC+jIXI/coSdwBL0puYj30=;
	b=CIyBvkMzC/e2kI5lLUUhas3sm3lJ6lW+Z8RmuwUY/9oGlmd7K+4j/F17m6Rtrf9nIJ3XOU
	G8jIsxwTK1HzTfgORjdWaA1w3uTFYFlyFAj1m3IqnJYicDT5IeDELtfVIzfsSdqWuXpKUg
	TE02RkIdEFwD/VgTz5aLg0OrFJRw51Piz1pGU826pq4Y55MNgTbuCIEK+V6Y0reYYXR2uf
	NLxjIYfFOMTLBmfoiIzV5BPtzpkPs3B0dw8F51iq++QAPMKo1gNicf/HTXyyDw6EoSOvAk
	7JMiq4x8gQGQKW+m4NJRopGp4VCZom3TiDFkzw3BU0V7GpeH0TDSsLt6qoRPMA==
X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1794554008; a=rsa-sha256;
	cv=none;
	b=E5xIoyxE6Vqn25RmP2/O28mj28ng9q94Q+JVnlKOPbQQFXI1uhq5OhP6FBdb7Yky8X1DzO
	stO6yVTWIPZ0w948MPsOheDaQZGLD+vW2BayhoRpTgU0IdGaWI7PB8kDFQtzxJ9qVNzPP0
	t1qYXD73lZZf+G81oOkhOUc224ChweBOAt3Fyx9/soAqYtTQjfC+sCIUlAkVHVI2FkW8zS
	OAHSSSzKdqqyN7yK9+Kj6ZunTZMcl7TaApGnHyUqNltxosEkXfXCd7HagBdsHimEk5TlJv
	svtQ/cNjuHX1CilhwHBE6dfYtiT+sJWgpjGsBJ5hdlVwqDDagkpEq6ecNsUBsg==
X-ARC-Authentication-Results: i=1;
	ORIGINATING;
	auth=pass smtp.auth=relay-from-drehscheibe.grey.stw.pengutronix.de smtp.mailfrom=mkl@pengutronix.de
X-Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] helo=bjornoya.blackshift.org)
	by drehscheibe.grey.stw.pengutronix.de with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
	(Exim 4.96)
	(envelope-from <mkl@pengutronix.de>)
	id 1xRlTU-003xHv-0C;
	Fri, 13 Nov 2026 08:13:28 +0100
X-Received: from blackshift.org (p4ffb23c7.dip0.t-ipconnect.de [79.251.35.199])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	(Authenticated sender: mkl-all@blackshift.org)
	by smtp.blackshift.org (Postfix) with ESMTPSA id CEA425EA57B;
	Fri, 13 Nov 2026 07:13:27 +0000 (UTC)
X-Cc: davem@davemloft.net,
	kuba@kernel.org,
	linux-can@vger.kernel.org,
	kernel@pengutronix.de,
	Quchaosheng <quchaosheng000406@163.com>,
	"Rob Herring (Arm)" <robh@kernel.org>,
	Marc Kleine-Budde <mkl@pengutronix.de>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261113071325.4092169-1-mkl@pengutronix.de>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list