18a5e7d19SGeert Uytterhoeven# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28a5e7d19SGeert Uytterhoeven%YAML 1.2
38a5e7d19SGeert Uytterhoeven---
48a5e7d19SGeert Uytterhoeven$id: http://devicetree.org/schemas/net/can/renesas,rcar-canfd.yaml#
58a5e7d19SGeert Uytterhoeven$schema: http://devicetree.org/meta-schemas/core.yaml#
68a5e7d19SGeert Uytterhoeven
78a5e7d19SGeert Uytterhoeventitle: Renesas R-Car CAN FD Controller
88a5e7d19SGeert Uytterhoeven
98a5e7d19SGeert Uytterhoevenmaintainers:
108a5e7d19SGeert Uytterhoeven  - Fabrizio Castro <fabrizio.castro.jz@renesas.com>
118a5e7d19SGeert Uytterhoeven
128a5e7d19SGeert UytterhoevenallOf:
138a5e7d19SGeert Uytterhoeven  - $ref: can-controller.yaml#
148a5e7d19SGeert Uytterhoeven
158a5e7d19SGeert Uytterhoevenproperties:
168a5e7d19SGeert Uytterhoeven  compatible:
178a5e7d19SGeert Uytterhoeven    oneOf:
188a5e7d19SGeert Uytterhoeven      - items:
198a5e7d19SGeert Uytterhoeven          - enum:
208a5e7d19SGeert Uytterhoeven              - renesas,r8a774a1-canfd     # RZ/G2M
218a5e7d19SGeert Uytterhoeven              - renesas,r8a774b1-canfd     # RZ/G2N
228a5e7d19SGeert Uytterhoeven              - renesas,r8a774c0-canfd     # RZ/G2E
238a5e7d19SGeert Uytterhoeven              - renesas,r8a774e1-canfd     # RZ/G2H
248a5e7d19SGeert Uytterhoeven              - renesas,r8a7795-canfd      # R-Car H3
258a5e7d19SGeert Uytterhoeven              - renesas,r8a7796-canfd      # R-Car M3-W
2644b6b105SWolfram Sang              - renesas,r8a77961-canfd     # R-Car M3-W+
278a5e7d19SGeert Uytterhoeven              - renesas,r8a77965-canfd     # R-Car M3-N
288a5e7d19SGeert Uytterhoeven              - renesas,r8a77970-canfd     # R-Car V3M
298a5e7d19SGeert Uytterhoeven              - renesas,r8a77980-canfd     # R-Car V3H
308a5e7d19SGeert Uytterhoeven              - renesas,r8a77990-canfd     # R-Car E3
318a5e7d19SGeert Uytterhoeven              - renesas,r8a77995-canfd     # R-Car D3
328a5e7d19SGeert Uytterhoeven          - const: renesas,rcar-gen3-canfd # R-Car Gen3 and RZ/G2
338a5e7d19SGeert Uytterhoeven
341aa5a06cSLad Prabhakar      - items:
351aa5a06cSLad Prabhakar          - enum:
36*35a78bf2SBiju Das              - renesas,r9a07g043-canfd    # RZ/G2UL
371aa5a06cSLad Prabhakar              - renesas,r9a07g044-canfd    # RZ/G2{L,LC}
38c205cac4SLad Prabhakar              - renesas,r9a07g054-canfd    # RZ/V2L
391aa5a06cSLad Prabhakar          - const: renesas,rzg2l-canfd     # RZ/G2L family
401aa5a06cSLad Prabhakar
41d6254d52SUlrich Hecht      - const: renesas,r8a779a0-canfd      # R-Car V3U
42d6254d52SUlrich Hecht
438a5e7d19SGeert Uytterhoeven  reg:
448a5e7d19SGeert Uytterhoeven    maxItems: 1
458a5e7d19SGeert Uytterhoeven
461aa5a06cSLad Prabhakar  interrupts: true
478a5e7d19SGeert Uytterhoeven
488a5e7d19SGeert Uytterhoeven  clocks:
498a5e7d19SGeert Uytterhoeven    maxItems: 3
508a5e7d19SGeert Uytterhoeven
518a5e7d19SGeert Uytterhoeven  clock-names:
528a5e7d19SGeert Uytterhoeven    items:
538a5e7d19SGeert Uytterhoeven      - const: fck
548a5e7d19SGeert Uytterhoeven      - const: canfd
558a5e7d19SGeert Uytterhoeven      - const: can_clk
568a5e7d19SGeert Uytterhoeven
578a5e7d19SGeert Uytterhoeven  power-domains:
588a5e7d19SGeert Uytterhoeven    maxItems: 1
598a5e7d19SGeert Uytterhoeven
601aa5a06cSLad Prabhakar  resets: true
618a5e7d19SGeert Uytterhoeven
628a5e7d19SGeert Uytterhoeven  renesas,no-can-fd:
638a5e7d19SGeert Uytterhoeven    $ref: /schemas/types.yaml#/definitions/flag
648a5e7d19SGeert Uytterhoeven    description:
658a5e7d19SGeert Uytterhoeven      The controller can operate in either CAN FD only mode (default) or
668a5e7d19SGeert Uytterhoeven      Classical CAN only mode.  The mode is global to both the channels.
678a5e7d19SGeert Uytterhoeven      Specify this property to put the controller in Classical CAN only mode.
688a5e7d19SGeert Uytterhoeven
698a5e7d19SGeert Uytterhoeven  assigned-clocks:
708a5e7d19SGeert Uytterhoeven    description:
718a5e7d19SGeert Uytterhoeven      Reference to the CANFD clock.  The CANFD clock is a div6 clock and can be
728a5e7d19SGeert Uytterhoeven      used by both CAN (if present) and CAN FD controllers at the same time.
738a5e7d19SGeert Uytterhoeven      It needs to be scaled to maximum frequency if any of these controllers
748a5e7d19SGeert Uytterhoeven      use it.
758a5e7d19SGeert Uytterhoeven
768a5e7d19SGeert Uytterhoeven  assigned-clock-rates:
778a5e7d19SGeert Uytterhoeven    description: Maximum frequency of the CANFD clock.
788a5e7d19SGeert Uytterhoeven
798a5e7d19SGeert UytterhoevenpatternProperties:
808a5e7d19SGeert Uytterhoeven  "^channel[01]$":
818a5e7d19SGeert Uytterhoeven    type: object
828a5e7d19SGeert Uytterhoeven    description:
838a5e7d19SGeert Uytterhoeven      The controller supports two channels and each is represented as a child
848a5e7d19SGeert Uytterhoeven      node.  Each child node supports the "status" property only, which
858a5e7d19SGeert Uytterhoeven      is used to enable/disable the respective channel.
868a5e7d19SGeert Uytterhoeven
878a5e7d19SGeert Uytterhoevenrequired:
888a5e7d19SGeert Uytterhoeven  - compatible
898a5e7d19SGeert Uytterhoeven  - reg
908a5e7d19SGeert Uytterhoeven  - interrupts
918a5e7d19SGeert Uytterhoeven  - clocks
928a5e7d19SGeert Uytterhoeven  - clock-names
938a5e7d19SGeert Uytterhoeven  - power-domains
948a5e7d19SGeert Uytterhoeven  - resets
958a5e7d19SGeert Uytterhoeven  - assigned-clocks
968a5e7d19SGeert Uytterhoeven  - assigned-clock-rates
978a5e7d19SGeert Uytterhoeven  - channel0
988a5e7d19SGeert Uytterhoeven  - channel1
998a5e7d19SGeert Uytterhoeven
1001aa5a06cSLad Prabhakarif:
1011aa5a06cSLad Prabhakar  properties:
1021aa5a06cSLad Prabhakar    compatible:
1031aa5a06cSLad Prabhakar      contains:
1041aa5a06cSLad Prabhakar        enum:
1051aa5a06cSLad Prabhakar          - renesas,rzg2l-canfd
1061aa5a06cSLad Prabhakarthen:
1071aa5a06cSLad Prabhakar  properties:
1081aa5a06cSLad Prabhakar    interrupts:
1091aa5a06cSLad Prabhakar      items:
1101aa5a06cSLad Prabhakar        - description: CAN global error interrupt
1111aa5a06cSLad Prabhakar        - description: CAN receive FIFO interrupt
1121aa5a06cSLad Prabhakar        - description: CAN0 error interrupt
1131aa5a06cSLad Prabhakar        - description: CAN0 transmit interrupt
1141aa5a06cSLad Prabhakar        - description: CAN0 transmit/receive FIFO receive completion interrupt
1151aa5a06cSLad Prabhakar        - description: CAN1 error interrupt
1161aa5a06cSLad Prabhakar        - description: CAN1 transmit interrupt
1171aa5a06cSLad Prabhakar        - description: CAN1 transmit/receive FIFO receive completion interrupt
1181aa5a06cSLad Prabhakar
1191aa5a06cSLad Prabhakar    interrupt-names:
1201aa5a06cSLad Prabhakar      items:
1211aa5a06cSLad Prabhakar        - const: g_err
1221aa5a06cSLad Prabhakar        - const: g_recc
1231aa5a06cSLad Prabhakar        - const: ch0_err
1241aa5a06cSLad Prabhakar        - const: ch0_rec
1251aa5a06cSLad Prabhakar        - const: ch0_trx
1261aa5a06cSLad Prabhakar        - const: ch1_err
1271aa5a06cSLad Prabhakar        - const: ch1_rec
1281aa5a06cSLad Prabhakar        - const: ch1_trx
1291aa5a06cSLad Prabhakar
1301aa5a06cSLad Prabhakar    resets:
1311aa5a06cSLad Prabhakar      maxItems: 2
1321aa5a06cSLad Prabhakar
1331aa5a06cSLad Prabhakar    reset-names:
1341aa5a06cSLad Prabhakar      items:
1351aa5a06cSLad Prabhakar        - const: rstp_n
1361aa5a06cSLad Prabhakar        - const: rstc_n
1371aa5a06cSLad Prabhakar
1381aa5a06cSLad Prabhakar  required:
1391aa5a06cSLad Prabhakar    - interrupt-names
1401aa5a06cSLad Prabhakar    - reset-names
1411aa5a06cSLad Prabhakarelse:
1421aa5a06cSLad Prabhakar  properties:
1431aa5a06cSLad Prabhakar    interrupts:
1441aa5a06cSLad Prabhakar      items:
1451aa5a06cSLad Prabhakar        - description: Channel interrupt
1461aa5a06cSLad Prabhakar        - description: Global interrupt
1471aa5a06cSLad Prabhakar
1481aa5a06cSLad Prabhakar    interrupt-names:
1491aa5a06cSLad Prabhakar      items:
1501aa5a06cSLad Prabhakar        - const: ch_int
1511aa5a06cSLad Prabhakar        - const: g_int
1521aa5a06cSLad Prabhakar
1531aa5a06cSLad Prabhakar    resets:
1541aa5a06cSLad Prabhakar      maxItems: 1
1551aa5a06cSLad Prabhakar
1568a5e7d19SGeert UytterhoevenunevaluatedProperties: false
1578a5e7d19SGeert Uytterhoeven
1588a5e7d19SGeert Uytterhoevenexamples:
1598a5e7d19SGeert Uytterhoeven  - |
1608a5e7d19SGeert Uytterhoeven    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
1618a5e7d19SGeert Uytterhoeven    #include <dt-bindings/interrupt-controller/arm-gic.h>
1628a5e7d19SGeert Uytterhoeven    #include <dt-bindings/power/r8a7795-sysc.h>
1638a5e7d19SGeert Uytterhoeven
1648a5e7d19SGeert Uytterhoeven    canfd: can@e66c0000 {
1658a5e7d19SGeert Uytterhoeven            compatible = "renesas,r8a7795-canfd",
1668a5e7d19SGeert Uytterhoeven                         "renesas,rcar-gen3-canfd";
1678a5e7d19SGeert Uytterhoeven            reg = <0xe66c0000 0x8000>;
1688a5e7d19SGeert Uytterhoeven            interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
1698a5e7d19SGeert Uytterhoeven                         <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
1708a5e7d19SGeert Uytterhoeven            clocks = <&cpg CPG_MOD 914>,
1718a5e7d19SGeert Uytterhoeven                     <&cpg CPG_CORE R8A7795_CLK_CANFD>,
1728a5e7d19SGeert Uytterhoeven                     <&can_clk>;
1738a5e7d19SGeert Uytterhoeven            clock-names = "fck", "canfd", "can_clk";
1748a5e7d19SGeert Uytterhoeven            assigned-clocks = <&cpg CPG_CORE R8A7795_CLK_CANFD>;
1758a5e7d19SGeert Uytterhoeven            assigned-clock-rates = <40000000>;
1768a5e7d19SGeert Uytterhoeven            power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1778a5e7d19SGeert Uytterhoeven            resets = <&cpg 914>;
1788a5e7d19SGeert Uytterhoeven
1798a5e7d19SGeert Uytterhoeven            channel0 {
1808a5e7d19SGeert Uytterhoeven            };
1818a5e7d19SGeert Uytterhoeven
1828a5e7d19SGeert Uytterhoeven            channel1 {
1838a5e7d19SGeert Uytterhoeven            };
1848a5e7d19SGeert Uytterhoeven    };
185