xref: /freebsd/sys/contrib/device-tree/Bindings/net/can/renesas,rcar-canfd.yaml (revision c9ccf3a32da427475985b85d7df023ccfb138c27)
15956d97fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/net/can/renesas,rcar-canfd.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: Renesas R-Car CAN FD Controller
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotmaintainers:
105956d97fSEmmanuel Vadot  - Fabrizio Castro <fabrizio.castro.jz@renesas.com>
115956d97fSEmmanuel Vadot
125956d97fSEmmanuel VadotallOf:
135956d97fSEmmanuel Vadot  - $ref: can-controller.yaml#
145956d97fSEmmanuel Vadot
155956d97fSEmmanuel Vadotproperties:
165956d97fSEmmanuel Vadot  compatible:
175956d97fSEmmanuel Vadot    oneOf:
185956d97fSEmmanuel Vadot      - items:
195956d97fSEmmanuel Vadot          - enum:
205956d97fSEmmanuel Vadot              - renesas,r8a774a1-canfd     # RZ/G2M
215956d97fSEmmanuel Vadot              - renesas,r8a774b1-canfd     # RZ/G2N
225956d97fSEmmanuel Vadot              - renesas,r8a774c0-canfd     # RZ/G2E
235956d97fSEmmanuel Vadot              - renesas,r8a774e1-canfd     # RZ/G2H
245956d97fSEmmanuel Vadot              - renesas,r8a7795-canfd      # R-Car H3
255956d97fSEmmanuel Vadot              - renesas,r8a7796-canfd      # R-Car M3-W
265956d97fSEmmanuel Vadot              - renesas,r8a77965-canfd     # R-Car M3-N
275956d97fSEmmanuel Vadot              - renesas,r8a77970-canfd     # R-Car V3M
285956d97fSEmmanuel Vadot              - renesas,r8a77980-canfd     # R-Car V3H
295956d97fSEmmanuel Vadot              - renesas,r8a77990-canfd     # R-Car E3
305956d97fSEmmanuel Vadot              - renesas,r8a77995-canfd     # R-Car D3
315956d97fSEmmanuel Vadot          - const: renesas,rcar-gen3-canfd # R-Car Gen3 and RZ/G2
325956d97fSEmmanuel Vadot
33354d7675SEmmanuel Vadot      - items:
34354d7675SEmmanuel Vadot          - enum:
35354d7675SEmmanuel Vadot              - renesas,r9a07g044-canfd    # RZ/G2{L,LC}
36*c9ccf3a3SEmmanuel Vadot              - renesas,r9a07g054-canfd    # RZ/V2L
37354d7675SEmmanuel Vadot          - const: renesas,rzg2l-canfd     # RZ/G2L family
38354d7675SEmmanuel Vadot
39*c9ccf3a3SEmmanuel Vadot      - const: renesas,r8a779a0-canfd      # R-Car V3U
40*c9ccf3a3SEmmanuel Vadot
415956d97fSEmmanuel Vadot  reg:
425956d97fSEmmanuel Vadot    maxItems: 1
435956d97fSEmmanuel Vadot
44354d7675SEmmanuel Vadot  interrupts: true
455956d97fSEmmanuel Vadot
465956d97fSEmmanuel Vadot  clocks:
475956d97fSEmmanuel Vadot    maxItems: 3
485956d97fSEmmanuel Vadot
495956d97fSEmmanuel Vadot  clock-names:
505956d97fSEmmanuel Vadot    items:
515956d97fSEmmanuel Vadot      - const: fck
525956d97fSEmmanuel Vadot      - const: canfd
535956d97fSEmmanuel Vadot      - const: can_clk
545956d97fSEmmanuel Vadot
555956d97fSEmmanuel Vadot  power-domains:
565956d97fSEmmanuel Vadot    maxItems: 1
575956d97fSEmmanuel Vadot
58354d7675SEmmanuel Vadot  resets: true
595956d97fSEmmanuel Vadot
605956d97fSEmmanuel Vadot  renesas,no-can-fd:
615956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
625956d97fSEmmanuel Vadot    description:
635956d97fSEmmanuel Vadot      The controller can operate in either CAN FD only mode (default) or
645956d97fSEmmanuel Vadot      Classical CAN only mode.  The mode is global to both the channels.
655956d97fSEmmanuel Vadot      Specify this property to put the controller in Classical CAN only mode.
665956d97fSEmmanuel Vadot
675956d97fSEmmanuel Vadot  assigned-clocks:
685956d97fSEmmanuel Vadot    description:
695956d97fSEmmanuel Vadot      Reference to the CANFD clock.  The CANFD clock is a div6 clock and can be
705956d97fSEmmanuel Vadot      used by both CAN (if present) and CAN FD controllers at the same time.
715956d97fSEmmanuel Vadot      It needs to be scaled to maximum frequency if any of these controllers
725956d97fSEmmanuel Vadot      use it.
735956d97fSEmmanuel Vadot
745956d97fSEmmanuel Vadot  assigned-clock-rates:
755956d97fSEmmanuel Vadot    description: Maximum frequency of the CANFD clock.
765956d97fSEmmanuel Vadot
775956d97fSEmmanuel VadotpatternProperties:
785956d97fSEmmanuel Vadot  "^channel[01]$":
795956d97fSEmmanuel Vadot    type: object
805956d97fSEmmanuel Vadot    description:
815956d97fSEmmanuel Vadot      The controller supports two channels and each is represented as a child
825956d97fSEmmanuel Vadot      node.  Each child node supports the "status" property only, which
835956d97fSEmmanuel Vadot      is used to enable/disable the respective channel.
845956d97fSEmmanuel Vadot
855956d97fSEmmanuel Vadotrequired:
865956d97fSEmmanuel Vadot  - compatible
875956d97fSEmmanuel Vadot  - reg
885956d97fSEmmanuel Vadot  - interrupts
895956d97fSEmmanuel Vadot  - clocks
905956d97fSEmmanuel Vadot  - clock-names
915956d97fSEmmanuel Vadot  - power-domains
925956d97fSEmmanuel Vadot  - resets
935956d97fSEmmanuel Vadot  - assigned-clocks
945956d97fSEmmanuel Vadot  - assigned-clock-rates
955956d97fSEmmanuel Vadot  - channel0
965956d97fSEmmanuel Vadot  - channel1
975956d97fSEmmanuel Vadot
98354d7675SEmmanuel Vadotif:
99354d7675SEmmanuel Vadot  properties:
100354d7675SEmmanuel Vadot    compatible:
101354d7675SEmmanuel Vadot      contains:
102354d7675SEmmanuel Vadot        enum:
103354d7675SEmmanuel Vadot          - renesas,rzg2l-canfd
104354d7675SEmmanuel Vadotthen:
105354d7675SEmmanuel Vadot  properties:
106354d7675SEmmanuel Vadot    interrupts:
107354d7675SEmmanuel Vadot      items:
108354d7675SEmmanuel Vadot        - description: CAN global error interrupt
109354d7675SEmmanuel Vadot        - description: CAN receive FIFO interrupt
110354d7675SEmmanuel Vadot        - description: CAN0 error interrupt
111354d7675SEmmanuel Vadot        - description: CAN0 transmit interrupt
112354d7675SEmmanuel Vadot        - description: CAN0 transmit/receive FIFO receive completion interrupt
113354d7675SEmmanuel Vadot        - description: CAN1 error interrupt
114354d7675SEmmanuel Vadot        - description: CAN1 transmit interrupt
115354d7675SEmmanuel Vadot        - description: CAN1 transmit/receive FIFO receive completion interrupt
116354d7675SEmmanuel Vadot
117354d7675SEmmanuel Vadot    interrupt-names:
118354d7675SEmmanuel Vadot      items:
119354d7675SEmmanuel Vadot        - const: g_err
120354d7675SEmmanuel Vadot        - const: g_recc
121354d7675SEmmanuel Vadot        - const: ch0_err
122354d7675SEmmanuel Vadot        - const: ch0_rec
123354d7675SEmmanuel Vadot        - const: ch0_trx
124354d7675SEmmanuel Vadot        - const: ch1_err
125354d7675SEmmanuel Vadot        - const: ch1_rec
126354d7675SEmmanuel Vadot        - const: ch1_trx
127354d7675SEmmanuel Vadot
128354d7675SEmmanuel Vadot    resets:
129354d7675SEmmanuel Vadot      maxItems: 2
130354d7675SEmmanuel Vadot
131354d7675SEmmanuel Vadot    reset-names:
132354d7675SEmmanuel Vadot      items:
133354d7675SEmmanuel Vadot        - const: rstp_n
134354d7675SEmmanuel Vadot        - const: rstc_n
135354d7675SEmmanuel Vadot
136354d7675SEmmanuel Vadot  required:
137354d7675SEmmanuel Vadot    - interrupt-names
138354d7675SEmmanuel Vadot    - reset-names
139354d7675SEmmanuel Vadotelse:
140354d7675SEmmanuel Vadot  properties:
141354d7675SEmmanuel Vadot    interrupts:
142354d7675SEmmanuel Vadot      items:
143354d7675SEmmanuel Vadot        - description: Channel interrupt
144354d7675SEmmanuel Vadot        - description: Global interrupt
145354d7675SEmmanuel Vadot
146354d7675SEmmanuel Vadot    interrupt-names:
147354d7675SEmmanuel Vadot      items:
148354d7675SEmmanuel Vadot        - const: ch_int
149354d7675SEmmanuel Vadot        - const: g_int
150354d7675SEmmanuel Vadot
151354d7675SEmmanuel Vadot    resets:
152354d7675SEmmanuel Vadot      maxItems: 1
153354d7675SEmmanuel Vadot
1545956d97fSEmmanuel VadotunevaluatedProperties: false
1555956d97fSEmmanuel Vadot
1565956d97fSEmmanuel Vadotexamples:
1575956d97fSEmmanuel Vadot  - |
1585956d97fSEmmanuel Vadot    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
1595956d97fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1605956d97fSEmmanuel Vadot    #include <dt-bindings/power/r8a7795-sysc.h>
1615956d97fSEmmanuel Vadot
1625956d97fSEmmanuel Vadot    canfd: can@e66c0000 {
1635956d97fSEmmanuel Vadot            compatible = "renesas,r8a7795-canfd",
1645956d97fSEmmanuel Vadot                         "renesas,rcar-gen3-canfd";
1655956d97fSEmmanuel Vadot            reg = <0xe66c0000 0x8000>;
1665956d97fSEmmanuel Vadot            interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
1675956d97fSEmmanuel Vadot                         <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
1685956d97fSEmmanuel Vadot            clocks = <&cpg CPG_MOD 914>,
1695956d97fSEmmanuel Vadot                     <&cpg CPG_CORE R8A7795_CLK_CANFD>,
1705956d97fSEmmanuel Vadot                     <&can_clk>;
1715956d97fSEmmanuel Vadot            clock-names = "fck", "canfd", "can_clk";
1725956d97fSEmmanuel Vadot            assigned-clocks = <&cpg CPG_CORE R8A7795_CLK_CANFD>;
1735956d97fSEmmanuel Vadot            assigned-clock-rates = <40000000>;
1745956d97fSEmmanuel Vadot            power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1755956d97fSEmmanuel Vadot            resets = <&cpg 914>;
1765956d97fSEmmanuel Vadot
1775956d97fSEmmanuel Vadot            channel0 {
1785956d97fSEmmanuel Vadot            };
1795956d97fSEmmanuel Vadot
1805956d97fSEmmanuel Vadot            channel1 {
1815956d97fSEmmanuel Vadot            };
1825956d97fSEmmanuel Vadot    };
183