| 1 |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 |
%YAML 1.2 |
| 3 |
--- |
| 4 |
$id: http://devicetree.org/schemas/net/can/renesas,rcar-canfd.yaml# |
| 5 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 |
|
| 7 |
title: Renesas R-Car CAN FD Controller |
| 8 |
|
| 9 |
maintainers: |
| 10 |
- Fabrizio Castro <[email protected]> |
| 11 |
|
| 12 |
properties: |
| 13 |
compatible: |
| 14 |
oneOf: |
| 15 |
- enum: |
| 16 |
- renesas,r9a09g047-canfd # RZ/G3E |
| 17 |
- renesas,r9a09g077-canfd # RZ/T2H |
| 18 |
|
| 19 |
- items: |
| 20 |
- enum: |
| 21 |
- renesas,r8a774a1-canfd # RZ/G2M |
| 22 |
- renesas,r8a774b1-canfd # RZ/G2N |
| 23 |
- renesas,r8a774c0-canfd # RZ/G2E |
| 24 |
- renesas,r8a774e1-canfd # RZ/G2H |
| 25 |
- renesas,r8a7795-canfd # R-Car H3 |
| 26 |
- renesas,r8a7796-canfd # R-Car M3-W |
| 27 |
- renesas,r8a77961-canfd # R-Car M3-W+ |
| 28 |
- renesas,r8a77965-canfd # R-Car M3-N |
| 29 |
- renesas,r8a77970-canfd # R-Car V3M |
| 30 |
- renesas,r8a77980-canfd # R-Car V3H |
| 31 |
- renesas,r8a77990-canfd # R-Car E3 |
| 32 |
- renesas,r8a77995-canfd # R-Car D3 |
| 33 |
- const: renesas,rcar-gen3-canfd # R-Car Gen3 and RZ/G2 |
| 34 |
|
| 35 |
- items: |
| 36 |
- enum: |
| 37 |
- renesas,r8a779a0-canfd # R-Car V3U |
| 38 |
- renesas,r8a779g0-canfd # R-Car V4H |
| 39 |
- renesas,r8a779h0-canfd # R-Car V4M |
| 40 |
- const: renesas,rcar-gen4-canfd # R-Car Gen4 |
| 41 |
|
| 42 |
- items: |
| 43 |
- enum: |
| 44 |
- renesas,r9a07g043-canfd # RZ/G2UL and RZ/Five |
| 45 |
- renesas,r9a07g044-canfd # RZ/G2{L,LC} |
| 46 |
- renesas,r9a07g054-canfd # RZ/V2L |
| 47 |
- const: renesas,rzg2l-canfd # RZ/G2L family |
| 48 |
|
| 49 |
- items: |
| 50 |
- enum: |
| 51 |
- renesas,r9a09g056-canfd # RZ/V2N |
| 52 |
- renesas,r9a09g057-canfd # RZ/V2H(P) |
| 53 |
- const: renesas,r9a09g047-canfd |
| 54 |
|
| 55 |
- items: |
| 56 |
- const: renesas,r9a09g087-canfd # RZ/N2H |
| 57 |
- const: renesas,r9a09g077-canfd |
| 58 |
|
| 59 |
reg: |
| 60 |
maxItems: 1 |
| 61 |
|
| 62 |
interrupts: |
| 63 |
oneOf: |
| 64 |
- items: |
| 65 |
- description: Channel interrupt |
| 66 |
- description: Global interrupt |
| 67 |
- items: |
| 68 |
- description: CAN global error interrupt |
| 69 |
- description: CAN receive FIFO interrupt |
| 70 |
- description: CAN0 error interrupt |
| 71 |
- description: CAN0 transmit interrupt |
| 72 |
- description: CAN0 transmit/receive FIFO receive completion interrupt |
| 73 |
- description: CAN1 error interrupt |
| 74 |
- description: CAN1 transmit interrupt |
| 75 |
- description: CAN1 transmit/receive FIFO receive completion interrupt |
| 76 |
- description: CAN2 error interrupt |
| 77 |
- description: CAN2 transmit interrupt |
| 78 |
- description: CAN2 transmit/receive FIFO receive completion interrupt |
| 79 |
- description: CAN3 error interrupt |
| 80 |
- description: CAN3 transmit interrupt |
| 81 |
- description: CAN3 transmit/receive FIFO receive completion interrupt |
| 82 |
- description: CAN4 error interrupt |
| 83 |
- description: CAN4 transmit interrupt |
| 84 |
- description: CAN4 transmit/receive FIFO receive completion interrupt |
| 85 |
- description: CAN5 error interrupt |
| 86 |
- description: CAN5 transmit interrupt |
| 87 |
- description: CAN5 transmit/receive FIFO receive completion interrupt |
| 88 |
minItems: 8 |
| 89 |
|
| 90 |
interrupt-names: |
| 91 |
oneOf: |
| 92 |
- items: |
| 93 |
- const: ch_int |
| 94 |
- const: g_int |
| 95 |
- items: |
| 96 |
- const: g_err |
| 97 |
- const: g_recc |
| 98 |
- const: ch0_err |
| 99 |
- const: ch0_rec |
| 100 |
- const: ch0_trx |
| 101 |
- const: ch1_err |
| 102 |
- const: ch1_rec |
| 103 |
- const: ch1_trx |
| 104 |
- const: ch2_err |
| 105 |
- const: ch2_rec |
| 106 |
- const: ch2_trx |
| 107 |
- const: ch3_err |
| 108 |
- const: ch3_rec |
| 109 |
- const: ch3_trx |
| 110 |
- const: ch4_err |
| 111 |
- const: ch4_rec |
| 112 |
- const: ch4_trx |
| 113 |
- const: ch5_err |
| 114 |
- const: ch5_rec |
| 115 |
- const: ch5_trx |
| 116 |
minItems: 8 |
| 117 |
|
| 118 |
clocks: |
| 119 |
maxItems: 3 |
| 120 |
|
| 121 |
clock-names: |
| 122 |
oneOf: |
| 123 |
- items: |
| 124 |
- const: fck |
| 125 |
- const: canfd |
| 126 |
- const: can_clk |
| 127 |
- items: |
| 128 |
- const: fck |
| 129 |
- const: ram_clk |
| 130 |
- const: can_clk |
| 131 |
|
| 132 |
power-domains: |
| 133 |
maxItems: 1 |
| 134 |
|
| 135 |
resets: true |
| 136 |
|
| 137 |
reset-names: |
| 138 |
items: |
| 139 |
- const: rstp_n |
| 140 |
- const: rstc_n |
| 141 |
|
| 142 |
renesas,no-can-fd: |
| 143 |
$ref: /schemas/types.yaml#/definitions/flag |
| 144 |
description: |
| 145 |
The controller can operate in either CAN-FD mode (default) or FD-Only |
| 146 |
mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this |
| 147 |
property to put the controller in Classical CAN mode. |
| 148 |
|
| 149 |
renesas,fd-only: |
| 150 |
$ref: /schemas/types.yaml#/definitions/flag |
| 151 |
description: |
| 152 |
The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only |
| 153 |
mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode, |
| 154 |
communication in Classical CAN frame format is disabled. Specify this |
| 155 |
property to put the controller in FD-Only mode. |
| 156 |
|
| 157 |
assigned-clocks: |
| 158 |
description: |
| 159 |
Reference to the CANFD clock. The CANFD clock is a div6 clock and can be |
| 160 |
used by both CAN (if present) and CAN FD controllers at the same time. |
| 161 |
It needs to be scaled to maximum frequency if any of these controllers |
| 162 |
use it. |
| 163 |
|
| 164 |
assigned-clock-rates: |
| 165 |
description: Maximum frequency of the CANFD clock. |
| 166 |
|
| 167 |
patternProperties: |
| 168 |
"^channel[0-7]$": |
| 169 |
type: object |
| 170 |
description: |
| 171 |
The controller supports multiple channels and each is represented as a |
| 172 |
child node. Each channel can be enabled/disabled individually. |
| 173 |
|
| 174 |
properties: |
| 175 |
phys: |
| 176 |
maxItems: 1 |
| 177 |
|
| 178 |
additionalProperties: false |
| 179 |
|
| 180 |
required: |
| 181 |
- compatible |
| 182 |
- reg |
| 183 |
- interrupts |
| 184 |
- interrupt-names |
| 185 |
- clocks |
| 186 |
- clock-names |
| 187 |
- power-domains |
| 188 |
- assigned-clocks |
| 189 |
- assigned-clock-rates |
| 190 |
- channel0 |
| 191 |
- channel1 |
| 192 |
|
| 193 |
allOf: |
| 194 |
- $ref: can-controller.yaml# |
| 195 |
|
| 196 |
- if: |
| 197 |
properties: |
| 198 |
compatible: |
| 199 |
contains: |
| 200 |
enum: |
| 201 |
- renesas,rzg2l-canfd |
| 202 |
then: |
| 203 |
properties: |
| 204 |
interrupts: |
| 205 |
maxItems: 8 |
| 206 |
|
| 207 |
interrupt-names: |
| 208 |
maxItems: 8 |
| 209 |
|
| 210 |
resets: |
| 211 |
minItems: 2 |
| 212 |
maxItems: 2 |
| 213 |
|
| 214 |
- if: |
| 215 |
properties: |
| 216 |
compatible: |
| 217 |
contains: |
| 218 |
enum: |
| 219 |
- renesas,rcar-gen3-canfd |
| 220 |
- renesas,rcar-gen4-canfd |
| 221 |
then: |
| 222 |
properties: |
| 223 |
interrupts: |
| 224 |
minItems: 2 |
| 225 |
maxItems: 2 |
| 226 |
|
| 227 |
interrupt-names: |
| 228 |
minItems: 2 |
| 229 |
maxItems: 2 |
| 230 |
|
| 231 |
resets: |
| 232 |
maxItems: 1 |
| 233 |
|
| 234 |
- if: |
| 235 |
properties: |
| 236 |
compatible: |
| 237 |
contains: |
| 238 |
const: renesas,r9a09g047-canfd |
| 239 |
then: |
| 240 |
properties: |
| 241 |
interrupts: |
| 242 |
minItems: 20 |
| 243 |
|
| 244 |
interrupt-names: |
| 245 |
minItems: 20 |
| 246 |
|
| 247 |
resets: |
| 248 |
minItems: 2 |
| 249 |
maxItems: 2 |
| 250 |
|
| 251 |
- if: |
| 252 |
properties: |
| 253 |
compatible: |
| 254 |
contains: |
| 255 |
const: renesas,r9a09g077-canfd |
| 256 |
then: |
| 257 |
properties: |
| 258 |
interrupts: |
| 259 |
maxItems: 8 |
| 260 |
|
| 261 |
interrupt-names: |
| 262 |
maxItems: 8 |
| 263 |
|
| 264 |
- if: |
| 265 |
properties: |
| 266 |
compatible: |
| 267 |
contains: |
| 268 |
enum: |
| 269 |
- renesas,r9a09g077-canfd |
| 270 |
- renesas,rcar-gen3-canfd |
| 271 |
- renesas,rzg2l-canfd |
| 272 |
then: |
| 273 |
patternProperties: |
| 274 |
"^channel[2-7]$": false |
| 275 |
|
| 276 |
- if: |
| 277 |
properties: |
| 278 |
compatible: |
| 279 |
contains: |
| 280 |
const: renesas,r8a779h0-canfd |
| 281 |
then: |
| 282 |
patternProperties: |
| 283 |
"^channel[4-7]$": false |
| 284 |
|
| 285 |
- if: |
| 286 |
properties: |
| 287 |
compatible: |
| 288 |
contains: |
| 289 |
const: renesas,r9a09g047-canfd |
| 290 |
then: |
| 291 |
patternProperties: |
| 292 |
"^channel[6-7]$": false |
| 293 |
|
| 294 |
- if: |
| 295 |
properties: |
| 296 |
compatible: |
| 297 |
contains: |
| 298 |
enum: |
| 299 |
- renesas,rcar-gen3-canfd |
| 300 |
then: |
| 301 |
properties: |
| 302 |
renesas,fd-only: false |
| 303 |
|
| 304 |
- if: |
| 305 |
required: |
| 306 |
- renesas,no-can-fd |
| 307 |
then: |
| 308 |
properties: |
| 309 |
renesas,fd-only: false |
| 310 |
|
| 311 |
- if: |
| 312 |
required: |
| 313 |
- renesas,fd-only |
| 314 |
then: |
| 315 |
properties: |
| 316 |
renesas,no-can-fd: false |
| 317 |
|
| 318 |
- if: |
| 319 |
properties: |
| 320 |
compatible: |
| 321 |
contains: |
| 322 |
const: renesas,r9a09g077-canfd |
| 323 |
then: |
| 324 |
properties: |
| 325 |
resets: false |
| 326 |
reset-names: false |
| 327 |
|
| 328 |
- if: |
| 329 |
properties: |
| 330 |
compatible: |
| 331 |
contains: |
| 332 |
enum: |
| 333 |
- renesas,r9a09g047-canfd |
| 334 |
- renesas,rzg2l-canfd |
| 335 |
then: |
| 336 |
required: |
| 337 |
- resets |
| 338 |
- reset-names |
| 339 |
|
| 340 |
- if: |
| 341 |
properties: |
| 342 |
compatible: |
| 343 |
contains: |
| 344 |
enum: |
| 345 |
- renesas,rcar-gen3-canfd |
| 346 |
- renesas,rcar-gen4-canfd |
| 347 |
then: |
| 348 |
required: |
| 349 |
- resets |
| 350 |
properties: |
| 351 |
reset-names: false |
| 352 |
|
| 353 |
unevaluatedProperties: false |
| 354 |
|
| 355 |
examples: |
| 356 |
- | |
| 357 |
#include <dt-bindings/clock/r8a7795-cpg-mssr.h> |
| 358 |
#include <dt-bindings/interrupt-controller/arm-gic.h> |
| 359 |
#include <dt-bindings/power/r8a7795-sysc.h> |
| 360 |
|
| 361 |
canfd: can@e66c0000 { |
| 362 |
compatible = "renesas,r8a7795-canfd", |
| 363 |
"renesas,rcar-gen3-canfd"; |
| 364 |
reg = <0xe66c0000 0x8000>; |
| 365 |
interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, |
| 366 |
<GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; |
| 367 |
interrupt-names = "ch_int", "g_int"; |
| 368 |
clocks = <&cpg CPG_MOD 914>, |
| 369 |
<&cpg CPG_CORE R8A7795_CLK_CANFD>, |
| 370 |
<&can_clk>; |
| 371 |
clock-names = "fck", "canfd", "can_clk"; |
| 372 |
assigned-clocks = <&cpg CPG_CORE R8A7795_CLK_CANFD>; |
| 373 |
assigned-clock-rates = <40000000>; |
| 374 |
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; |
| 375 |
resets = <&cpg 914>; |
| 376 |
|
| 377 |
channel0 { |
| 378 |
}; |
| 379 |
|
| 380 |
channel1 { |
| 381 |
}; |
| 382 |
}; |