| 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 |
| 8 |
|
| 9 |
description: Bosch MCAN controller for CAN bus |
| 10 |
|
| 11 |
maintainers: |
| 12 |
- Chandrasekar Ramakrishnan <[email protected]> |
| 13 |
|
| 14 |
allOf: |
| 15 |
- $ref: can-controller.yaml# |
| 16 |
|
| 17 |
properties: |
| 18 |
compatible: |
| 19 |
const: bosch,m_can |
| 20 |
|
| 21 |
reg: |
| 22 |
items: |
| 23 |
- description: M_CAN registers map |
| 24 |
- description: message RAM |
| 25 |
|
| 26 |
reg-names: |
| 27 |
items: |
| 28 |
- const: m_can |
| 29 |
- const: message_ram |
| 30 |
|
| 31 |
interrupts: |
| 32 |
items: |
| 33 |
- description: interrupt line0 |
| 34 |
- description: interrupt line1 |
| 35 |
minItems: 1 |
| 36 |
|
| 37 |
interrupt-names: |
| 38 |
items: |
| 39 |
- const: int0 |
| 40 |
- const: int1 |
| 41 |
minItems: 1 |
| 42 |
|
| 43 |
clocks: |
| 44 |
items: |
| 45 |
- description: peripheral clock |
| 46 |
- description: bus clock |
| 47 |
|
| 48 |
clock-names: |
| 49 |
items: |
| 50 |
- const: hclk |
| 51 |
- const: cclk |
| 52 |
|
| 53 |
resets: |
| 54 |
maxItems: 1 |
| 55 |
|
| 56 |
bosch,mram-cfg: |
| 57 |
description: | |
| 58 |
Message RAM configuration data. |
| 59 |
Multiple M_CAN instances can share the same Message RAM |
| 60 |
and each element(e.g Rx FIFO or Tx Buffer and etc) number |
| 61 |
in Message RAM is also configurable, so this property is |
| 62 |
telling driver how the shared or private Message RAM are |
| 63 |
used by this M_CAN controller. |
| 64 |
|
| 65 |
The format should be as follows: |
| 66 |
<offset sidf_elems xidf_elems rxf0_elems rxf1_elems rxb_elems txe_elems txb_elems> |
| 67 |
The 'offset' is an address offset of the Message RAM where |
| 68 |
the following elements start from. This is usually set to |
| 69 |
0x0 if you're using a private Message RAM. The remain cells |
| 70 |
are used to specify how many elements are used for each FIFO/Buffer. |
| 71 |
|
| 72 |
M_CAN includes the following elements according to user manual: |
| 73 |
11-bit Filter 0-128 elements / 0-128 words |
| 74 |
29-bit Filter 0-64 elements / 0-128 words |
| 75 |
Rx FIFO 0 0-64 elements / 0-1152 words |
| 76 |
Rx FIFO 1 0-64 elements / 0-1152 words |
| 77 |
Rx Buffers 0-64 elements / 0-1152 words |
| 78 |
Tx Event FIFO 0-32 elements / 0-64 words |
| 79 |
Tx Buffers 0-32 elements / 0-576 words |
| 80 |
|
| 81 |
Please refer to 2.4.1 Message RAM Configuration in Bosch |
| 82 |
M_CAN user manual for details. |
| 83 |
$ref: /schemas/types.yaml#/definitions/int32-array |
| 84 |
items: |
| 85 |
- description: The 'offset' is an address offset of the Message RAM where |
| 86 |
the following elements start from. This is usually set to 0x0 if |
| 87 |
you're using a private Message RAM. |
| 88 |
default: 0 |
| 89 |
- description: 11-bit Filter 0-128 elements / 0-128 words |
| 90 |
minimum: 0 |
| 91 |
maximum: 128 |
| 92 |
- description: 29-bit Filter 0-64 elements / 0-128 words |
| 93 |
minimum: 0 |
| 94 |
maximum: 64 |
| 95 |
- description: Rx FIFO 0 0-64 elements / 0-1152 words |
| 96 |
minimum: 0 |
| 97 |
maximum: 64 |
| 98 |
- description: Rx FIFO 1 0-64 elements / 0-1152 words |
| 99 |
minimum: 0 |
| 100 |
maximum: 64 |
| 101 |
- description: Rx Buffers 0-64 elements / 0-1152 words |
| 102 |
minimum: 0 |
| 103 |
maximum: 64 |
| 104 |
- description: Tx Event FIFO 0-32 elements / 0-64 words |
| 105 |
minimum: 0 |
| 106 |
maximum: 32 |
| 107 |
- description: Tx Buffers 0-32 elements / 0-576 words |
| 108 |
minimum: 0 |
| 109 |
maximum: 32 |
| 110 |
minItems: 1 |
| 111 |
|
| 112 |
pinctrl-0: |
| 113 |
description: Default pinctrl state |
| 114 |
|
| 115 |
pinctrl-1: |
| 116 |
description: Can be "sleep" or "wakeup" pinctrl state |
| 117 |
|
| 118 |
pinctrl-2: |
| 119 |
description: Can be "sleep" or "wakeup" pinctrl state |
| 120 |
|
| 121 |
pinctrl-names: |
| 122 |
description: |
| 123 |
When present should contain at least "default" describing the default pin |
| 124 |
states. Other states are "sleep" which describes the pinstate when |
| 125 |
sleeping and "wakeup" describing the pins if wakeup is enabled. |
| 126 |
minItems: 1 |
| 127 |
items: |
| 128 |
- const: default |
| 129 |
- enum: [ sleep, wakeup ] |
| 130 |
- const: wakeup |
| 131 |
|
| 132 |
power-domains: |
| 133 |
description: |
| 134 |
Power domain provider node and an args specifier containing |
| 135 |
the can device id value. |
| 136 |
maxItems: 1 |
| 137 |
|
| 138 |
can-transceiver: |
| 139 |
$ref: can-transceiver.yaml# |
| 140 |
|
| 141 |
phys: |
| 142 |
maxItems: 1 |
| 143 |
|
| 144 |
access-controllers: |
| 145 |
minItems: 1 |
| 146 |
maxItems: 2 |
| 147 |
|
| 148 |
wakeup-source: |
| 149 |
$ref: /schemas/types.yaml#/definitions/phandle-array |
| 150 |
description: |
| 151 |
List of phandles to system idle states in which mcan can wakeup the system. |
| 152 |
|
| 153 |
required: |
| 154 |
- compatible |
| 155 |
- reg |
| 156 |
- reg-names |
| 157 |
- clocks |
| 158 |
- clock-names |
| 159 |
- bosch,mram-cfg |
| 160 |
|
| 161 |
unevaluatedProperties: false |
| 162 |
|
| 163 |
examples: |
| 164 |
- | |
| 165 |
// Example with interrupts |
| 166 |
#include <dt-bindings/clock/imx6sx-clock.h> |
| 167 |
can@20e8000 { |
| 168 |
compatible = "bosch,m_can"; |
| 169 |
reg = <0x020e8000 0x4000>, <0x02298000 0x4000>; |
| 170 |
reg-names = "m_can", "message_ram"; |
| 171 |
interrupts = <0 114 0x04>, <0 114 0x04>; |
| 172 |
interrupt-names = "int0", "int1"; |
| 173 |
clocks = <&clks IMX6SX_CLK_CANFD>, |
| 174 |
<&clks IMX6SX_CLK_CANFD>; |
| 175 |
clock-names = "hclk", "cclk"; |
| 176 |
bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>; |
| 177 |
|
| 178 |
can-transceiver { |
| 179 |
max-bitrate = <5000000>; |
| 180 |
}; |
| 181 |
}; |
| 182 |
|
| 183 |
- | |
| 184 |
// Example with timer polling |
| 185 |
#include <dt-bindings/clock/imx6sx-clock.h> |
| 186 |
can@20e8000 { |
| 187 |
compatible = "bosch,m_can"; |
| 188 |
reg = <0x020e8000 0x4000>, <0x02298000 0x4000>; |
| 189 |
reg-names = "m_can", "message_ram"; |
| 190 |
clocks = <&clks IMX6SX_CLK_CANFD>, |
| 191 |
<&clks IMX6SX_CLK_CANFD>; |
| 192 |
clock-names = "hclk", "cclk"; |
| 193 |
bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>; |
| 194 |
|
| 195 |
can-transceiver { |
| 196 |
max-bitrate = <5000000>; |
| 197 |
}; |
| 198 |
}; |
| 199 |
|
| 200 |
... |