xref: /freebsd/sys/contrib/device-tree/Bindings/net/can/bosch,m_can.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/net/can/bosch,m_can.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Bosch MCAN controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: Bosch MCAN controller for CAN bus
10c66ec88fSEmmanuel Vadot
11c66ec88fSEmmanuel Vadotmaintainers:
12c9ccf3a3SEmmanuel Vadot  - Chandrasekar Ramakrishnan <rcsekar@samsung.com>
13c9ccf3a3SEmmanuel Vadot
14c9ccf3a3SEmmanuel VadotallOf:
15c9ccf3a3SEmmanuel Vadot  - $ref: can-controller.yaml#
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadotproperties:
18c66ec88fSEmmanuel Vadot  compatible:
19c66ec88fSEmmanuel Vadot    const: bosch,m_can
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot  reg:
22c66ec88fSEmmanuel Vadot    items:
23c66ec88fSEmmanuel Vadot      - description: M_CAN registers map
24c66ec88fSEmmanuel Vadot      - description: message RAM
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  reg-names:
27c66ec88fSEmmanuel Vadot    items:
28c66ec88fSEmmanuel Vadot      - const: m_can
29c66ec88fSEmmanuel Vadot      - const: message_ram
30c66ec88fSEmmanuel Vadot
31c66ec88fSEmmanuel Vadot  interrupts:
32c66ec88fSEmmanuel Vadot    items:
33c66ec88fSEmmanuel Vadot      - description: interrupt line0
34c66ec88fSEmmanuel Vadot      - description: interrupt line1
35c66ec88fSEmmanuel Vadot    minItems: 1
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  interrupt-names:
38c66ec88fSEmmanuel Vadot    items:
39c66ec88fSEmmanuel Vadot      - const: int0
40c66ec88fSEmmanuel Vadot      - const: int1
41c66ec88fSEmmanuel Vadot    minItems: 1
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  clocks:
44c66ec88fSEmmanuel Vadot    items:
45c66ec88fSEmmanuel Vadot      - description: peripheral clock
46c66ec88fSEmmanuel Vadot      - description: bus clock
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadot  clock-names:
49c66ec88fSEmmanuel Vadot    items:
50c66ec88fSEmmanuel Vadot      - const: hclk
51c66ec88fSEmmanuel Vadot      - const: cclk
52c66ec88fSEmmanuel Vadot
53c66ec88fSEmmanuel Vadot  bosch,mram-cfg:
54c66ec88fSEmmanuel Vadot    description: |
55c66ec88fSEmmanuel Vadot      Message RAM configuration data.
56c66ec88fSEmmanuel Vadot      Multiple M_CAN instances can share the same Message RAM
57c66ec88fSEmmanuel Vadot      and each element(e.g Rx FIFO or Tx Buffer and etc) number
58c66ec88fSEmmanuel Vadot      in Message RAM is also configurable, so this property is
59c66ec88fSEmmanuel Vadot      telling driver how the shared or private Message RAM are
60c66ec88fSEmmanuel Vadot      used by this M_CAN controller.
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot      The format should be as follows:
63c66ec88fSEmmanuel Vadot      <offset sidf_elems xidf_elems rxf0_elems rxf1_elems rxb_elems txe_elems txb_elems>
64c66ec88fSEmmanuel Vadot      The 'offset' is an address offset of the Message RAM where
65c66ec88fSEmmanuel Vadot      the following elements start from. This is usually set to
66c66ec88fSEmmanuel Vadot      0x0 if you're using a private Message RAM. The remain cells
67c66ec88fSEmmanuel Vadot      are used to specify how many elements are used for each FIFO/Buffer.
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel Vadot      M_CAN includes the following elements according to user manual:
70c66ec88fSEmmanuel Vadot      11-bit Filter	0-128 elements / 0-128 words
71c66ec88fSEmmanuel Vadot      29-bit Filter	0-64 elements / 0-128 words
72c66ec88fSEmmanuel Vadot      Rx FIFO 0		0-64 elements / 0-1152 words
73c66ec88fSEmmanuel Vadot      Rx FIFO 1		0-64 elements / 0-1152 words
74c66ec88fSEmmanuel Vadot      Rx Buffers	0-64 elements / 0-1152 words
75c66ec88fSEmmanuel Vadot      Tx Event FIFO	0-32 elements / 0-64 words
76c66ec88fSEmmanuel Vadot      Tx Buffers	0-32 elements / 0-576 words
77c66ec88fSEmmanuel Vadot
78c66ec88fSEmmanuel Vadot      Please refer to 2.4.1 Message RAM Configuration in Bosch
79c66ec88fSEmmanuel Vadot      M_CAN user manual for details.
80c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/int32-array
81c66ec88fSEmmanuel Vadot    items:
82c66ec88fSEmmanuel Vadot      - description: The 'offset' is an address offset of the Message RAM where
83c66ec88fSEmmanuel Vadot          the following elements start from. This is usually set to 0x0 if
84c66ec88fSEmmanuel Vadot          you're using a private Message RAM.
85c66ec88fSEmmanuel Vadot        default: 0
86c66ec88fSEmmanuel Vadot      - description: 11-bit Filter 0-128 elements / 0-128 words
87c66ec88fSEmmanuel Vadot        minimum: 0
88c66ec88fSEmmanuel Vadot        maximum: 128
89c66ec88fSEmmanuel Vadot      - description: 29-bit Filter 0-64 elements / 0-128 words
90c66ec88fSEmmanuel Vadot        minimum: 0
91c66ec88fSEmmanuel Vadot        maximum: 64
92c66ec88fSEmmanuel Vadot      - description: Rx FIFO 0 0-64 elements / 0-1152 words
93c66ec88fSEmmanuel Vadot        minimum: 0
94c66ec88fSEmmanuel Vadot        maximum: 64
95c66ec88fSEmmanuel Vadot      - description: Rx FIFO 1 0-64 elements / 0-1152 words
96c66ec88fSEmmanuel Vadot        minimum: 0
97c66ec88fSEmmanuel Vadot        maximum: 64
98c66ec88fSEmmanuel Vadot      - description: Rx Buffers 0-64 elements / 0-1152 words
99c66ec88fSEmmanuel Vadot        minimum: 0
100c66ec88fSEmmanuel Vadot        maximum: 64
101c66ec88fSEmmanuel Vadot      - description: Tx Event FIFO 0-32 elements / 0-64 words
102c66ec88fSEmmanuel Vadot        minimum: 0
103c66ec88fSEmmanuel Vadot        maximum: 32
104c66ec88fSEmmanuel Vadot      - description: Tx Buffers 0-32 elements / 0-576 words
105c66ec88fSEmmanuel Vadot        minimum: 0
106c66ec88fSEmmanuel Vadot        maximum: 32
107c9ccf3a3SEmmanuel Vadot    minItems: 1
108c66ec88fSEmmanuel Vadot
109354d7675SEmmanuel Vadot  power-domains:
110354d7675SEmmanuel Vadot    description:
111354d7675SEmmanuel Vadot      Power domain provider node and an args specifier containing
112354d7675SEmmanuel Vadot      the can device id value.
113354d7675SEmmanuel Vadot    maxItems: 1
114354d7675SEmmanuel Vadot
115c66ec88fSEmmanuel Vadot  can-transceiver:
116c66ec88fSEmmanuel Vadot    $ref: can-transceiver.yaml#
117c66ec88fSEmmanuel Vadot
118354d7675SEmmanuel Vadot  phys:
119354d7675SEmmanuel Vadot    maxItems: 1
120354d7675SEmmanuel Vadot
121c66ec88fSEmmanuel Vadotrequired:
122c66ec88fSEmmanuel Vadot  - compatible
123c66ec88fSEmmanuel Vadot  - reg
124c66ec88fSEmmanuel Vadot  - reg-names
125c66ec88fSEmmanuel Vadot  - clocks
126c66ec88fSEmmanuel Vadot  - clock-names
127c66ec88fSEmmanuel Vadot  - bosch,mram-cfg
128c66ec88fSEmmanuel Vadot
129*aa1a8ff2SEmmanuel VadotunevaluatedProperties: false
130c66ec88fSEmmanuel Vadot
131c66ec88fSEmmanuel Vadotexamples:
132c66ec88fSEmmanuel Vadot  - |
133*aa1a8ff2SEmmanuel Vadot    // Example with interrupts
134c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/imx6sx-clock.h>
135c66ec88fSEmmanuel Vadot    can@20e8000 {
136c66ec88fSEmmanuel Vadot      compatible = "bosch,m_can";
137c66ec88fSEmmanuel Vadot      reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
138c66ec88fSEmmanuel Vadot      reg-names = "m_can", "message_ram";
139c66ec88fSEmmanuel Vadot      interrupts = <0 114 0x04>, <0 114 0x04>;
140c66ec88fSEmmanuel Vadot      interrupt-names = "int0", "int1";
141c66ec88fSEmmanuel Vadot      clocks = <&clks IMX6SX_CLK_CANFD>,
142c66ec88fSEmmanuel Vadot               <&clks IMX6SX_CLK_CANFD>;
143c66ec88fSEmmanuel Vadot      clock-names = "hclk", "cclk";
144c66ec88fSEmmanuel Vadot      bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;
145c66ec88fSEmmanuel Vadot
146c66ec88fSEmmanuel Vadot      can-transceiver {
147c66ec88fSEmmanuel Vadot        max-bitrate = <5000000>;
148c66ec88fSEmmanuel Vadot      };
149c66ec88fSEmmanuel Vadot    };
150c66ec88fSEmmanuel Vadot
151*aa1a8ff2SEmmanuel Vadot  - |
152*aa1a8ff2SEmmanuel Vadot    // Example with timer polling
153*aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/clock/imx6sx-clock.h>
154*aa1a8ff2SEmmanuel Vadot    can@20e8000 {
155*aa1a8ff2SEmmanuel Vadot      compatible = "bosch,m_can";
156*aa1a8ff2SEmmanuel Vadot      reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
157*aa1a8ff2SEmmanuel Vadot      reg-names = "m_can", "message_ram";
158*aa1a8ff2SEmmanuel Vadot      clocks = <&clks IMX6SX_CLK_CANFD>,
159*aa1a8ff2SEmmanuel Vadot               <&clks IMX6SX_CLK_CANFD>;
160*aa1a8ff2SEmmanuel Vadot      clock-names = "hclk", "cclk";
161*aa1a8ff2SEmmanuel Vadot      bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;
162*aa1a8ff2SEmmanuel Vadot
163*aa1a8ff2SEmmanuel Vadot      can-transceiver {
164*aa1a8ff2SEmmanuel Vadot        max-bitrate = <5000000>;
165*aa1a8ff2SEmmanuel Vadot      };
166*aa1a8ff2SEmmanuel Vadot    };
167*aa1a8ff2SEmmanuel Vadot
168c66ec88fSEmmanuel Vadot...
169