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