Skip to content

Commit 7919575

Browse files
sknseanmarckleinebudde
authored andcommitted
dt-bindings: can: convert tcan4x5x.txt to DT schema
Convert binding doc tcan4x5x.txt to yaml. Added during conversion, required clock-names cclk. Signed-off-by: Sean Nyekjaer <[email protected]> Acked-by: Conor Dooley <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 130727c commit 7919575

File tree

2 files changed

+191
-48
lines changed

2 files changed

+191
-48
lines changed

Documentation/devicetree/bindings/net/can/tcan4x5x.txt

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/can/ti,tcan4x5x.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Texas Instruments TCAN4x5x CAN Controller
8+
9+
maintainers:
10+
- Marc Kleine-Budde <[email protected]>
11+
12+
properties:
13+
compatible:
14+
oneOf:
15+
- items:
16+
- enum:
17+
- ti,tcan4552
18+
- ti,tcan4553
19+
- const: ti,tcan4x5x
20+
- const: ti,tcan4x5x
21+
22+
reg:
23+
maxItems: 1
24+
25+
interrupts:
26+
maxItems: 1
27+
description: The GPIO parent interrupt.
28+
29+
clocks:
30+
maxItems: 1
31+
32+
clock-names:
33+
items:
34+
- const: cclk
35+
36+
reset-gpios:
37+
description: Hardwired output GPIO. If not defined then software reset.
38+
maxItems: 1
39+
40+
device-state-gpios:
41+
description:
42+
Input GPIO that indicates if the device is in a sleep state or if the
43+
device is active. Not available with tcan4552/4553.
44+
maxItems: 1
45+
46+
device-wake-gpios:
47+
description:
48+
Wake up GPIO to wake up the TCAN device.
49+
Not available with tcan4552/4553.
50+
maxItems: 1
51+
52+
bosch,mram-cfg:
53+
description: |
54+
Message RAM configuration data.
55+
Multiple M_CAN instances can share the same Message RAM
56+
and each element(e.g Rx FIFO or Tx Buffer and etc) number
57+
in Message RAM is also configurable, so this property is
58+
telling driver how the shared or private Message RAM are
59+
used by this M_CAN controller.
60+
61+
The format should be as follows:
62+
<offset sidf_elems xidf_elems rxf0_elems rxf1_elems rxb_elems txe_elems txb_elems>
63+
The 'offset' is an address offset of the Message RAM where
64+
the following elements start from. This is usually set to
65+
0x0 if you're using a private Message RAM. The remain cells
66+
are used to specify how many elements are used for each FIFO/Buffer.
67+
68+
M_CAN includes the following elements according to user manual:
69+
11-bit Filter 0-128 elements / 0-128 words
70+
29-bit Filter 0-64 elements / 0-128 words
71+
Rx FIFO 0 0-64 elements / 0-1152 words
72+
Rx FIFO 1 0-64 elements / 0-1152 words
73+
Rx Buffers 0-64 elements / 0-1152 words
74+
Tx Event FIFO 0-32 elements / 0-64 words
75+
Tx Buffers 0-32 elements / 0-576 words
76+
77+
Please refer to 2.4.1 Message RAM Configuration in Bosch
78+
M_CAN user manual for details.
79+
$ref: /schemas/types.yaml#/definitions/int32-array
80+
items:
81+
- description: The 'offset' is an address offset of the Message RAM where
82+
the following elements start from. This is usually set to 0x0 if
83+
you're using a private Message RAM.
84+
default: 0
85+
- description: 11-bit Filter 0-128 elements / 0-128 words
86+
minimum: 0
87+
maximum: 128
88+
- description: 29-bit Filter 0-64 elements / 0-128 words
89+
minimum: 0
90+
maximum: 64
91+
- description: Rx FIFO 0 0-64 elements / 0-1152 words
92+
minimum: 0
93+
maximum: 64
94+
- description: Rx FIFO 1 0-64 elements / 0-1152 words
95+
minimum: 0
96+
maximum: 64
97+
- description: Rx Buffers 0-64 elements / 0-1152 words
98+
minimum: 0
99+
maximum: 64
100+
- description: Tx Event FIFO 0-32 elements / 0-64 words
101+
minimum: 0
102+
maximum: 32
103+
- description: Tx Buffers 0-32 elements / 0-576 words
104+
minimum: 0
105+
maximum: 32
106+
minItems: 1
107+
108+
spi-max-frequency:
109+
description:
110+
Must be half or less of "clocks" frequency.
111+
maximum: 18000000
112+
113+
wakeup-source:
114+
$ref: /schemas/types.yaml#/definitions/flag
115+
description:
116+
Enable CAN remote wakeup.
117+
118+
allOf:
119+
- $ref: can-controller.yaml#
120+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
121+
- if:
122+
properties:
123+
compatible:
124+
contains:
125+
enum:
126+
- ti,tcan4552
127+
- ti,tcan4553
128+
then:
129+
properties:
130+
device-state-gpios: false
131+
device-wake-gpios: false
132+
133+
required:
134+
- compatible
135+
- reg
136+
- interrupts
137+
- clocks
138+
- clock-names
139+
- bosch,mram-cfg
140+
141+
unevaluatedProperties: false
142+
143+
examples:
144+
- |
145+
#include <dt-bindings/gpio/gpio.h>
146+
#include <dt-bindings/interrupt-controller/irq.h>
147+
148+
spi {
149+
#address-cells = <1>;
150+
#size-cells = <0>;
151+
152+
can@0 {
153+
compatible = "ti,tcan4x5x";
154+
reg = <0>;
155+
clocks = <&can0_osc>;
156+
clock-names = "cclk";
157+
pinctrl-names = "default";
158+
pinctrl-0 = <&can0_pins>;
159+
spi-max-frequency = <10000000>;
160+
bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
161+
interrupt-parent = <&gpio1>;
162+
interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
163+
device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
164+
device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
165+
reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
166+
wakeup-source;
167+
};
168+
};
169+
- |
170+
#include <dt-bindings/gpio/gpio.h>
171+
#include <dt-bindings/interrupt-controller/irq.h>
172+
173+
spi {
174+
#address-cells = <1>;
175+
#size-cells = <0>;
176+
177+
can@0 {
178+
compatible = "ti,tcan4552", "ti,tcan4x5x";
179+
reg = <0>;
180+
clocks = <&can0_osc>;
181+
clock-names = "cclk";
182+
pinctrl-names = "default";
183+
pinctrl-0 = <&can0_pins>;
184+
spi-max-frequency = <10000000>;
185+
bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
186+
interrupt-parent = <&gpio1>;
187+
interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
188+
reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
189+
wakeup-source;
190+
};
191+
};

0 commit comments

Comments
 (0)