summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml
blob: 384e15da27136c0bad39c4d9f6cc0456fb0d5b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/can/ti,tcan4x5x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments TCAN4x5x CAN Controller

maintainers:
  - Marc Kleine-Budde <mkl@pengutronix.de>

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - ti,tcan4552
              - ti,tcan4553
          - const: ti,tcan4x5x
      - const: ti,tcan4x5x

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: The GPIO parent interrupt.

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: cclk

  reset-gpios:
    description: Hardwired output GPIO. If not defined then software reset.
    maxItems: 1

  device-state-gpios:
    description:
      Input GPIO that indicates if the device is in a sleep state or if the
      device is active. Not available with tcan4552/4553.
    maxItems: 1

  device-wake-gpios:
    description:
      Wake up GPIO to wake up the TCAN device.
      Not available with tcan4552/4553.
    maxItems: 1

  bosch,mram-cfg:
    description: |
      Message RAM configuration data.
      Multiple M_CAN instances can share the same Message RAM
      and each element(e.g Rx FIFO or Tx Buffer and etc) number
      in Message RAM is also configurable, so this property is
      telling driver how the shared or private Message RAM are
      used by this M_CAN controller.

      The format should be as follows:
      <offset sidf_elems xidf_elems rxf0_elems rxf1_elems rxb_elems txe_elems txb_elems>
      The 'offset' is an address offset of the Message RAM where
      the following elements start from. This is usually set to
      0x0 if you're using a private Message RAM. The remain cells
      are used to specify how many elements are used for each FIFO/Buffer.

      M_CAN includes the following elements according to user manual:
      11-bit Filter	0-128 elements / 0-128 words
      29-bit Filter	0-64 elements / 0-128 words
      Rx FIFO 0		0-64 elements / 0-1152 words
      Rx FIFO 1		0-64 elements / 0-1152 words
      Rx Buffers	0-64 elements / 0-1152 words
      Tx Event FIFO	0-32 elements / 0-64 words
      Tx Buffers	0-32 elements / 0-576 words

      Please refer to 2.4.1 Message RAM Configuration in Bosch
      M_CAN user manual for details.
    $ref: /schemas/types.yaml#/definitions/int32-array
    items:
      - description: The 'offset' is an address offset of the Message RAM where
          the following elements start from. This is usually set to 0x0 if
          you're using a private Message RAM.
        default: 0
      - description: 11-bit Filter 0-128 elements / 0-128 words
        minimum: 0
        maximum: 128
      - description: 29-bit Filter 0-64 elements / 0-128 words
        minimum: 0
        maximum: 64
      - description: Rx FIFO 0 0-64 elements / 0-1152 words
        minimum: 0
        maximum: 64
      - description: Rx FIFO 1 0-64 elements / 0-1152 words
        minimum: 0
        maximum: 64
      - description: Rx Buffers 0-64 elements / 0-1152 words
        minimum: 0
        maximum: 64
      - description: Tx Event FIFO 0-32 elements / 0-64 words
        minimum: 0
        maximum: 32
      - description: Tx Buffers 0-32 elements / 0-576 words
        minimum: 0
        maximum: 32
    minItems: 1

  spi-max-frequency:
    description:
      Must be half or less of "clocks" frequency.
    maximum: 18000000

  ti,nwkrq-voltage-vio:
    type: boolean
    description:
      nWKRQ Pin GPO buffer voltage configuration.
      Set nWKRQ to use VIO voltage rail.
      When not set nWKRQ will use internal voltage rail.

  wakeup-source:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Enable CAN remote wakeup.

allOf:
  - $ref: can-controller.yaml#
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - ti,tcan4552
              - ti,tcan4553
    then:
      properties:
        device-state-gpios: false
        device-wake-gpios: false

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - bosch,mram-cfg

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        can@0 {
            compatible = "ti,tcan4x5x";
            reg = <0>;
            clocks = <&can0_osc>;
            clock-names = "cclk";
            pinctrl-names = "default";
            pinctrl-0 = <&can0_pins>;
            spi-max-frequency = <10000000>;
            bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
            interrupt-parent = <&gpio1>;
            interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
            device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
            device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
            reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
            ti,nwkrq-voltage-vio;
            wakeup-source;
        };
    };
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        can@0 {
            compatible = "ti,tcan4552", "ti,tcan4x5x";
            reg = <0>;
            clocks = <&can0_osc>;
            clock-names = "cclk";
            pinctrl-names = "default";
            pinctrl-0 = <&can0_pins>;
            spi-max-frequency = <10000000>;
            bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
            interrupt-parent = <&gpio1>;
            interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
            reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
            wakeup-source;
        };
    };