Merge branch 'elan-i2c' into next
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / net / can / bosch,m_can.yaml
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/net/can/bosch,m_can.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Bosch MCAN controller Bindings
8
9 description: Bosch MCAN controller for CAN bus
10
11 maintainers:
12   -  Sriram Dash <sriram.dash@samsung.com>
13
14 properties:
15   compatible:
16     const: bosch,m_can
17
18   reg:
19     items:
20       - description: M_CAN registers map
21       - description: message RAM
22
23   reg-names:
24     items:
25       - const: m_can
26       - const: message_ram
27
28   interrupts:
29     items:
30       - description: interrupt line0
31       - description: interrupt line1
32     minItems: 1
33     maxItems: 2
34
35   interrupt-names:
36     items:
37       - const: int0
38       - const: int1
39     minItems: 1
40     maxItems: 2
41
42   clocks:
43     items:
44       - description: peripheral clock
45       - description: bus clock
46
47   clock-names:
48     items:
49       - const: hclk
50       - const: cclk
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     allOf:
80       - $ref: /schemas/types.yaml#/definitions/int32-array
81       - items:
82          items:
83            - description: The 'offset' is an address offset of the Message RAM
84                           where the following elements start from. This is usually
85                           set to 0x0 if you're using a private Message RAM.
86              default: 0
87            - description: 11-bit Filter 0-128 elements / 0-128 words
88              minimum: 0
89              maximum: 128
90            - description: 29-bit Filter 0-64 elements / 0-128 words
91              minimum: 0
92              maximum: 64
93            - description: Rx FIFO 0 0-64 elements / 0-1152 words
94              minimum: 0
95              maximum: 64
96            - description: Rx FIFO 1 0-64 elements / 0-1152 words
97              minimum: 0
98              maximum: 64
99            - description: Rx Buffers 0-64 elements / 0-1152 words
100              minimum: 0
101              maximum: 64
102            - description: Tx Event FIFO 0-32 elements / 0-64 words
103              minimum: 0
104              maximum: 32
105            - description: Tx Buffers 0-32 elements / 0-576 words
106              minimum: 0
107              maximum: 32
108         maxItems: 1
109
110   can-transceiver:
111     $ref: can-transceiver.yaml#
112
113 required:
114   - compatible
115   - reg
116   - reg-names
117   - interrupts
118   - interrupt-names
119   - clocks
120   - clock-names
121   - bosch,mram-cfg
122
123 additionalProperties: false
124
125 examples:
126   - |
127     #include <dt-bindings/clock/imx6sx-clock.h>
128     can@20e8000 {
129       compatible = "bosch,m_can";
130       reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
131       reg-names = "m_can", "message_ram";
132       interrupts = <0 114 0x04>, <0 114 0x04>;
133       interrupt-names = "int0", "int1";
134       clocks = <&clks IMX6SX_CLK_CANFD>,
135                <&clks IMX6SX_CLK_CANFD>;
136       clock-names = "hclk", "cclk";
137       bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;
138
139       can-transceiver {
140         max-bitrate = <5000000>;
141       };
142     };
143
144 ...