18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 28c2ecf20Sopenharmony_ci%YAML 1.2 38c2ecf20Sopenharmony_ci--- 48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/timer/renesas,cmt.yaml# 58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml# 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_cititle: Renesas Compare Match Timer (CMT) 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cimaintainers: 108c2ecf20Sopenharmony_ci - Geert Uytterhoeven <geert+renesas@glider.be> 118c2ecf20Sopenharmony_ci - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cidescription: 148c2ecf20Sopenharmony_ci The CMT is a multi-channel 16/32/48-bit timer/counter with configurable clock 158c2ecf20Sopenharmony_ci inputs and programmable compare match. 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci Channels share hardware resources but their counter and compare match values 188c2ecf20Sopenharmony_ci are independent. A particular CMT instance can implement only a subset of the 198c2ecf20Sopenharmony_ci channels supported by the CMT model. Channel indices represent the hardware 208c2ecf20Sopenharmony_ci position of the channel in the CMT and don't match the channel numbers in the 218c2ecf20Sopenharmony_ci datasheets. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciproperties: 248c2ecf20Sopenharmony_ci compatible: 258c2ecf20Sopenharmony_ci oneOf: 268c2ecf20Sopenharmony_ci - items: 278c2ecf20Sopenharmony_ci - enum: 288c2ecf20Sopenharmony_ci - renesas,r8a7740-cmt0 # 32-bit CMT0 on R-Mobile A1 298c2ecf20Sopenharmony_ci - renesas,r8a7740-cmt1 # 48-bit CMT1 on R-Mobile A1 308c2ecf20Sopenharmony_ci - renesas,r8a7740-cmt2 # 32-bit CMT2 on R-Mobile A1 318c2ecf20Sopenharmony_ci - renesas,r8a7740-cmt3 # 32-bit CMT3 on R-Mobile A1 328c2ecf20Sopenharmony_ci - renesas,r8a7740-cmt4 # 32-bit CMT4 on R-Mobile A1 338c2ecf20Sopenharmony_ci - renesas,sh73a0-cmt0 # 32-bit CMT0 on SH-Mobile AG5 348c2ecf20Sopenharmony_ci - renesas,sh73a0-cmt1 # 48-bit CMT1 on SH-Mobile AG5 358c2ecf20Sopenharmony_ci - renesas,sh73a0-cmt2 # 32-bit CMT2 on SH-Mobile AG5 368c2ecf20Sopenharmony_ci - renesas,sh73a0-cmt3 # 32-bit CMT3 on SH-Mobile AG5 378c2ecf20Sopenharmony_ci - renesas,sh73a0-cmt4 # 32-bit CMT4 on SH-Mobile AG5 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci - items: 408c2ecf20Sopenharmony_ci - enum: 418c2ecf20Sopenharmony_ci - renesas,r8a73a4-cmt0 # 32-bit CMT0 on R-Mobile APE6 428c2ecf20Sopenharmony_ci - renesas,r8a7742-cmt0 # 32-bit CMT0 on RZ/G1H 438c2ecf20Sopenharmony_ci - renesas,r8a7743-cmt0 # 32-bit CMT0 on RZ/G1M 448c2ecf20Sopenharmony_ci - renesas,r8a7744-cmt0 # 32-bit CMT0 on RZ/G1N 458c2ecf20Sopenharmony_ci - renesas,r8a7745-cmt0 # 32-bit CMT0 on RZ/G1E 468c2ecf20Sopenharmony_ci - renesas,r8a77470-cmt0 # 32-bit CMT0 on RZ/G1C 478c2ecf20Sopenharmony_ci - renesas,r8a7790-cmt0 # 32-bit CMT0 on R-Car H2 488c2ecf20Sopenharmony_ci - renesas,r8a7791-cmt0 # 32-bit CMT0 on R-Car M2-W 498c2ecf20Sopenharmony_ci - renesas,r8a7792-cmt0 # 32-bit CMT0 on R-Car V2H 508c2ecf20Sopenharmony_ci - renesas,r8a7793-cmt0 # 32-bit CMT0 on R-Car M2-N 518c2ecf20Sopenharmony_ci - renesas,r8a7794-cmt0 # 32-bit CMT0 on R-Car E2 528c2ecf20Sopenharmony_ci - const: renesas,rcar-gen2-cmt0 # 32-bit CMT0 on R-Mobile APE6, R-Car Gen2 and RZ/G1 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci - items: 558c2ecf20Sopenharmony_ci - enum: 568c2ecf20Sopenharmony_ci - renesas,r8a73a4-cmt1 # 48-bit CMT1 on R-Mobile APE6 578c2ecf20Sopenharmony_ci - renesas,r8a7742-cmt1 # 48-bit CMT1 on RZ/G1H 588c2ecf20Sopenharmony_ci - renesas,r8a7743-cmt1 # 48-bit CMT1 on RZ/G1M 598c2ecf20Sopenharmony_ci - renesas,r8a7744-cmt1 # 48-bit CMT1 on RZ/G1N 608c2ecf20Sopenharmony_ci - renesas,r8a7745-cmt1 # 48-bit CMT1 on RZ/G1E 618c2ecf20Sopenharmony_ci - renesas,r8a77470-cmt1 # 48-bit CMT1 on RZ/G1C 628c2ecf20Sopenharmony_ci - renesas,r8a7790-cmt1 # 48-bit CMT1 on R-Car H2 638c2ecf20Sopenharmony_ci - renesas,r8a7791-cmt1 # 48-bit CMT1 on R-Car M2-W 648c2ecf20Sopenharmony_ci - renesas,r8a7792-cmt1 # 48-bit CMT1 on R-Car V2H 658c2ecf20Sopenharmony_ci - renesas,r8a7793-cmt1 # 48-bit CMT1 on R-Car M2-N 668c2ecf20Sopenharmony_ci - renesas,r8a7794-cmt1 # 48-bit CMT1 on R-Car E2 678c2ecf20Sopenharmony_ci - const: renesas,rcar-gen2-cmt1 # 48-bit CMT1 on R-Mobile APE6, R-Car Gen2 and RZ/G1 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci - items: 708c2ecf20Sopenharmony_ci - enum: 718c2ecf20Sopenharmony_ci - renesas,r8a774a1-cmt0 # 32-bit CMT0 on RZ/G2M 728c2ecf20Sopenharmony_ci - renesas,r8a774b1-cmt0 # 32-bit CMT0 on RZ/G2N 738c2ecf20Sopenharmony_ci - renesas,r8a774c0-cmt0 # 32-bit CMT0 on RZ/G2E 748c2ecf20Sopenharmony_ci - renesas,r8a774e1-cmt0 # 32-bit CMT0 on RZ/G2H 758c2ecf20Sopenharmony_ci - renesas,r8a7795-cmt0 # 32-bit CMT0 on R-Car H3 768c2ecf20Sopenharmony_ci - renesas,r8a7796-cmt0 # 32-bit CMT0 on R-Car M3-W 778c2ecf20Sopenharmony_ci - renesas,r8a77965-cmt0 # 32-bit CMT0 on R-Car M3-N 788c2ecf20Sopenharmony_ci - renesas,r8a77970-cmt0 # 32-bit CMT0 on R-Car V3M 798c2ecf20Sopenharmony_ci - renesas,r8a77980-cmt0 # 32-bit CMT0 on R-Car V3H 808c2ecf20Sopenharmony_ci - renesas,r8a77990-cmt0 # 32-bit CMT0 on R-Car E3 818c2ecf20Sopenharmony_ci - renesas,r8a77995-cmt0 # 32-bit CMT0 on R-Car D3 828c2ecf20Sopenharmony_ci - const: renesas,rcar-gen3-cmt0 # 32-bit CMT0 on R-Car Gen3 and RZ/G2 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci - items: 858c2ecf20Sopenharmony_ci - enum: 868c2ecf20Sopenharmony_ci - renesas,r8a774a1-cmt1 # 48-bit CMT on RZ/G2M 878c2ecf20Sopenharmony_ci - renesas,r8a774b1-cmt1 # 48-bit CMT on RZ/G2N 888c2ecf20Sopenharmony_ci - renesas,r8a774c0-cmt1 # 48-bit CMT on RZ/G2E 898c2ecf20Sopenharmony_ci - renesas,r8a774e1-cmt1 # 48-bit CMT on RZ/G2H 908c2ecf20Sopenharmony_ci - renesas,r8a7795-cmt1 # 48-bit CMT on R-Car H3 918c2ecf20Sopenharmony_ci - renesas,r8a7796-cmt1 # 48-bit CMT on R-Car M3-W 928c2ecf20Sopenharmony_ci - renesas,r8a77965-cmt1 # 48-bit CMT on R-Car M3-N 938c2ecf20Sopenharmony_ci - renesas,r8a77970-cmt1 # 48-bit CMT on R-Car V3M 948c2ecf20Sopenharmony_ci - renesas,r8a77980-cmt1 # 48-bit CMT on R-Car V3H 958c2ecf20Sopenharmony_ci - renesas,r8a77990-cmt1 # 48-bit CMT on R-Car E3 968c2ecf20Sopenharmony_ci - renesas,r8a77995-cmt1 # 48-bit CMT on R-Car D3 978c2ecf20Sopenharmony_ci - const: renesas,rcar-gen3-cmt1 # 48-bit CMT on R-Car Gen3 and RZ/G2 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci reg: 1008c2ecf20Sopenharmony_ci maxItems: 1 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci interrupts: 1038c2ecf20Sopenharmony_ci minItems: 1 1048c2ecf20Sopenharmony_ci maxItems: 8 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci clocks: 1078c2ecf20Sopenharmony_ci maxItems: 1 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci clock-names: 1108c2ecf20Sopenharmony_ci const: fck 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci power-domains: 1138c2ecf20Sopenharmony_ci maxItems: 1 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci resets: 1168c2ecf20Sopenharmony_ci maxItems: 1 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_cirequired: 1198c2ecf20Sopenharmony_ci - compatible 1208c2ecf20Sopenharmony_ci - reg 1218c2ecf20Sopenharmony_ci - interrupts 1228c2ecf20Sopenharmony_ci - clocks 1238c2ecf20Sopenharmony_ci - clock-names 1248c2ecf20Sopenharmony_ci - power-domains 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ciallOf: 1278c2ecf20Sopenharmony_ci - if: 1288c2ecf20Sopenharmony_ci properties: 1298c2ecf20Sopenharmony_ci compatible: 1308c2ecf20Sopenharmony_ci contains: 1318c2ecf20Sopenharmony_ci enum: 1328c2ecf20Sopenharmony_ci - renesas,rcar-gen2-cmt0 1338c2ecf20Sopenharmony_ci - renesas,rcar-gen3-cmt0 1348c2ecf20Sopenharmony_ci then: 1358c2ecf20Sopenharmony_ci properties: 1368c2ecf20Sopenharmony_ci interrupts: 1378c2ecf20Sopenharmony_ci minItems: 2 1388c2ecf20Sopenharmony_ci maxItems: 2 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci - if: 1418c2ecf20Sopenharmony_ci properties: 1428c2ecf20Sopenharmony_ci compatible: 1438c2ecf20Sopenharmony_ci contains: 1448c2ecf20Sopenharmony_ci enum: 1458c2ecf20Sopenharmony_ci - renesas,rcar-gen2-cmt1 1468c2ecf20Sopenharmony_ci - renesas,rcar-gen3-cmt1 1478c2ecf20Sopenharmony_ci then: 1488c2ecf20Sopenharmony_ci properties: 1498c2ecf20Sopenharmony_ci interrupts: 1508c2ecf20Sopenharmony_ci minItems: 8 1518c2ecf20Sopenharmony_ci maxItems: 8 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ciadditionalProperties: false 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ciexamples: 1568c2ecf20Sopenharmony_ci - | 1578c2ecf20Sopenharmony_ci #include <dt-bindings/clock/r8a7790-cpg-mssr.h> 1588c2ecf20Sopenharmony_ci #include <dt-bindings/interrupt-controller/arm-gic.h> 1598c2ecf20Sopenharmony_ci #include <dt-bindings/power/r8a7790-sysc.h> 1608c2ecf20Sopenharmony_ci cmt0: timer@ffca0000 { 1618c2ecf20Sopenharmony_ci compatible = "renesas,r8a7790-cmt0", "renesas,rcar-gen2-cmt0"; 1628c2ecf20Sopenharmony_ci reg = <0xffca0000 0x1004>; 1638c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 1648c2ecf20Sopenharmony_ci <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 1658c2ecf20Sopenharmony_ci clocks = <&cpg CPG_MOD 124>; 1668c2ecf20Sopenharmony_ci clock-names = "fck"; 1678c2ecf20Sopenharmony_ci power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1688c2ecf20Sopenharmony_ci resets = <&cpg 124>; 1698c2ecf20Sopenharmony_ci }; 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci cmt1: timer@e6130000 { 1728c2ecf20Sopenharmony_ci compatible = "renesas,r8a7790-cmt1", "renesas,rcar-gen2-cmt1"; 1738c2ecf20Sopenharmony_ci reg = <0xe6130000 0x1004>; 1748c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 1758c2ecf20Sopenharmony_ci <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 1768c2ecf20Sopenharmony_ci <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 1778c2ecf20Sopenharmony_ci <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 1788c2ecf20Sopenharmony_ci <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, 1798c2ecf20Sopenharmony_ci <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, 1808c2ecf20Sopenharmony_ci <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, 1818c2ecf20Sopenharmony_ci <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; 1828c2ecf20Sopenharmony_ci clocks = <&cpg CPG_MOD 329>; 1838c2ecf20Sopenharmony_ci clock-names = "fck"; 1848c2ecf20Sopenharmony_ci power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1858c2ecf20Sopenharmony_ci resets = <&cpg 329>; 1868c2ecf20Sopenharmony_ci }; 187