* [PATCH v2 0/2] dt-bindings: net: can: grcan: convert to DT schema @ 2026-09-29 7:37 Quchaosheng 2026-09-29 7:37 ` [PATCH v2 1/2] dt-bindings: net: can: convert grcan " Quchaosheng 2026-09-29 7:37 ` [PATCH v2 2/2] net: can: grcan: update the binding file reference in the driver comment Quchaosheng 0 siblings, 2 replies; 4+ messages in thread From: Quchaosheng @ 2026-09-29 7:37 UTC (permalink / raw) To: Marc Kleine-Budde, Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: Quchaosheng, linux-can, devicetree, linux-kernel, Oliver Hartkopp Marc asked for the two grcan patches to go out as a series. Contents are unchanged from the standalone postings. Quchaosheng (2): dt-bindings: net: can: convert grcan to DT schema net: can: grcan: update the binding file reference in the driver comment Documentation/devicetree/bindings/net/can/aeroflexgaisler,grcan.yaml | 65 ++++++++++++++++++++++ Documentation/devicetree/bindings/net/can/grcan.txt | 28 ---------- drivers/net/can/grcan.c | 4 +-- 3 files changed, 67 insertions(+), 30 deletions(-) -- 2.43.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] dt-bindings: net: can: convert grcan to DT schema 2026-09-29 7:37 [PATCH v2 0/2] dt-bindings: net: can: grcan: convert to DT schema Quchaosheng @ 2026-09-29 7:37 ` Quchaosheng 2026-10-01 19:48 ` Rob Herring (Arm) 2026-09-29 7:37 ` [PATCH v2 2/2] net: can: grcan: update the binding file reference in the driver comment Quchaosheng 1 sibling, 1 reply; 4+ messages in thread From: Quchaosheng @ 2026-09-29 7:37 UTC (permalink / raw) To: Marc Kleine-Budde, Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: Quchaosheng, linux-can, devicetree, linux-kernel, Oliver Hartkopp 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. Assisted-by: LLM Signed-off-by: Quchaosheng <quchaosheng000406@163.com> --- .../bindings/net/can/aeroflexgaisler,grcan.yaml | 65 ++++++++++++++++++++++ .../devicetree/bindings/net/can/grcan.txt | 28 ---------- 2 files changed, 65 insertions(+), 28 deletions(-) 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 000000000..d5cba5b1b --- /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 34ef3498f..000000000 --- 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: net: can: convert grcan to DT schema 2026-09-29 7:37 ` [PATCH v2 1/2] dt-bindings: net: can: convert grcan " Quchaosheng @ 2026-10-01 19:48 ` Rob Herring (Arm) 0 siblings, 0 replies; 4+ messages in thread From: Rob Herring (Arm) @ 2026-10-01 19:48 UTC (permalink / raw) To: Quchaosheng Cc: Vincent Mailhol, linux-kernel, Oliver Hartkopp, linux-can, Krzysztof Kozlowski, Marc Kleine-Budde, devicetree, Conor Dooley On Tue, 29 Sep 2026 15:37:02 +0800, Quchaosheng wrote: > 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. > > Assisted-by: LLM > Signed-off-by: Quchaosheng <quchaosheng000406@163.com> > > --- > .../bindings/net/can/aeroflexgaisler,grcan.yaml | 65 ++++++++++++++++++++++ > .../devicetree/bindings/net/can/grcan.txt | 28 ---------- > 2 files changed, 65 insertions(+), 28 deletions(-) > Reviewed-by: Rob Herring (Arm) <robh@kernel.org> However, is this a platform you actually care about? Sparc is not something anyone runs dtschema validation on, so not all that important to worry about. Only someone with access to a system can actually run the validation anyways. The priority is fixing the remaining warnings on arm64 (about 200 left), arm32, mips, powerpc, arc in that order of priority. I don't know that anyone cares about mips, powerpc, or arc warnings either. Rob ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] net: can: grcan: update the binding file reference in the driver comment 2026-09-29 7:37 [PATCH v2 0/2] dt-bindings: net: can: grcan: convert to DT schema Quchaosheng 2026-09-29 7:37 ` [PATCH v2 1/2] dt-bindings: net: can: convert grcan " Quchaosheng @ 2026-09-29 7:37 ` Quchaosheng 1 sibling, 0 replies; 4+ messages in thread From: Quchaosheng @ 2026-09-29 7:37 UTC (permalink / raw) To: Marc Kleine-Budde, Vincent Mailhol; +Cc: Quchaosheng, linux-can, linux-kernel grcan.txt is replaced by aeroflexgaisler,grcan.yaml. Point the comment at the new file. No functional change. Assisted-by: LLM Signed-off-by: Quchaosheng <quchaosheng000406@163.com> --- drivers/net/can/grcan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c index ce12fa6df..1b4944d1d 100644 --- a/drivers/net/can/grcan.c +++ b/drivers/net/can/grcan.c @@ -10,8 +10,8 @@ * Full documentation of the GRCAN core can be found here: * http://www.gaisler.com/products/grlib/grip.pdf * - * See "Documentation/devicetree/bindings/net/can/grcan.txt" for information on - * open firmware properties. + * See "Documentation/devicetree/bindings/net/can/aeroflexgaisler,grcan.yaml" + * for information on open firmware properties. * * See "Documentation/ABI/testing/sysfs-class-net-grcan" for information on the * sysfs interface. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-01 19:48 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-09-29 7:37 [PATCH v2 0/2] dt-bindings: net: can: grcan: convert to DT schema Quchaosheng 2026-09-29 7:37 ` [PATCH v2 1/2] dt-bindings: net: can: convert grcan " Quchaosheng 2026-10-01 19:48 ` Rob Herring (Arm) 2026-09-29 7:37 ` [PATCH v2 2/2] net: can: grcan: update the binding file reference in the driver comment Quchaosheng
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®