548 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2%YAML 1.23---4$id: http://devicetree.org/schemas/sound/renesas,rsnd.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Renesas R-Car Sound Driver8 9maintainers:10 - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>11 12properties:13 14 compatible:15 oneOf:16 # for Gen1 SoC17 - items:18 - enum:19 - renesas,rcar_sound-r8a7778 # R-Car M1A20 - renesas,rcar_sound-r8a7779 # R-Car H121 - const: renesas,rcar_sound-gen122 # for Gen2 SoC23 - items:24 - enum:25 - renesas,rcar_sound-r8a7742 # RZ/G1H26 - renesas,rcar_sound-r8a7743 # RZ/G1M27 - renesas,rcar_sound-r8a7744 # RZ/G1N28 - renesas,rcar_sound-r8a7745 # RZ/G1E29 - renesas,rcar_sound-r8a77470 # RZ/G1C30 - renesas,rcar_sound-r8a7790 # R-Car H231 - renesas,rcar_sound-r8a7791 # R-Car M2-W32 - renesas,rcar_sound-r8a7793 # R-Car M2-N33 - renesas,rcar_sound-r8a7794 # R-Car E234 - const: renesas,rcar_sound-gen235 # for Gen3 SoC36 - items:37 - enum:38 - renesas,rcar_sound-r8a774a1 # RZ/G2M39 - renesas,rcar_sound-r8a774b1 # RZ/G2N40 - renesas,rcar_sound-r8a774c0 # RZ/G2E41 - renesas,rcar_sound-r8a774e1 # RZ/G2H42 - renesas,rcar_sound-r8a7795 # R-Car H343 - renesas,rcar_sound-r8a7796 # R-Car M3-W44 - renesas,rcar_sound-r8a77961 # R-Car M3-W+45 - renesas,rcar_sound-r8a77965 # R-Car M3-N46 - renesas,rcar_sound-r8a77990 # R-Car E347 - renesas,rcar_sound-r8a77995 # R-Car D348 - const: renesas,rcar_sound-gen349 # for Gen4 SoC50 - items:51 - enum:52 - renesas,rcar_sound-r8a779g0 # R-Car V4H53 - renesas,rcar_sound-r8a779h0 # R-Car V4M54 - const: renesas,rcar_sound-gen455 # for Generic56 - enum:57 - renesas,rcar_sound-gen158 - renesas,rcar_sound-gen259 - renesas,rcar_sound-gen360 - renesas,rcar_sound-gen461 62 reg:63 minItems: 164 maxItems: 565 66 reg-names:67 minItems: 168 maxItems: 569 70 "#sound-dai-cells":71 description: |72 it must be 0 if your system is using single DAI73 it must be 1 if your system is using multi DAIs74 This is used on simple-audio-card75 enum: [0, 1]76 77 "#clock-cells":78 description: |79 it must be 0 if your system has audio_clkout80 it must be 1 if your system has audio_clkout0/1/2/381 enum: [0, 1]82 83 "#address-cells":84 const: 185 86 "#size-cells":87 const: 088 89 clock-frequency:90 description: for audio_clkout0/1/2/391 92 clkout-lr-asynchronous:93 description: audio_clkoutn is asynchronizes with lr-clock.94 $ref: /schemas/types.yaml#/definitions/flag95 96 power-domains: true97 98 resets:99 minItems: 1100 maxItems: 11101 102 reset-names:103 minItems: 1104 maxItems: 11105 106 clocks:107 description: References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks.108 minItems: 1109 maxItems: 31110 111 clock-names:112 description: List of necessary clock names.113 # details are defined below114 115 post-init-providers:116 description: At least if rsnd is using DPCM connection on Audio-Graph-Card2,117 fw_devlink might doesn't have enough information to break the cycle. rsnd118 driver will not be probed in such case. Same problem might occur with119 Multi-CPU/Codec or Codec2Codec.120 121 # ports is below122 port:123 $ref: audio-graph-port.yaml#/definitions/port-base124 unevaluatedProperties: false125 patternProperties:126 "^endpoint(@[0-9a-f]+)?":127 $ref: audio-graph-port.yaml#/definitions/endpoint-base128 properties:129 playback:130 $ref: /schemas/types.yaml#/definitions/phandle-array131 capture:132 $ref: /schemas/types.yaml#/definitions/phandle-array133 unevaluatedProperties: false134 135 rcar_sound,dvc:136 description: DVC subnode.137 type: object138 patternProperties:139 "^dvc-[0-1]$":140 type: object141 additionalProperties: false142 143 properties:144 dmas:145 maxItems: 1146 dma-names:147 const: tx148 required:149 - dmas150 - dma-names151 additionalProperties: false152 153 rcar_sound,mix:154 description: MIX subnode.155 type: object156 patternProperties:157 "^mix-[0-1]$":158 type: object159 additionalProperties: false160 additionalProperties: false161 162 rcar_sound,ctu:163 description: CTU subnode.164 type: object165 patternProperties:166 "^ctu-[0-7]$":167 type: object168 additionalProperties: false169 additionalProperties: false170 171 rcar_sound,src:172 description: SRC subnode.173 type: object174 patternProperties:175 "^src-[0-9]$":176 type: object177 additionalProperties: false178 179 properties:180 interrupts:181 maxItems: 1182 dmas:183 maxItems: 2184 dma-names:185 allOf:186 - items:187 enum:188 - tx189 - rx190 additionalProperties: false191 192 rcar_sound,ssiu:193 description: SSIU subnode.194 type: object195 patternProperties:196 "^ssiu-[0-9]+$":197 type: object198 additionalProperties: false199 200 properties:201 dmas:202 maxItems: 2203 dma-names:204 allOf:205 - items:206 enum:207 - tx208 - rx209 required:210 - dmas211 - dma-names212 additionalProperties: false213 214 rcar_sound,ssi:215 description: SSI subnode.216 type: object217 patternProperties:218 "^ssi-[0-9]$":219 type: object220 additionalProperties: false221 222 properties:223 interrupts:224 maxItems: 1225 dmas:226 minItems: 2227 maxItems: 4228 dma-names:229 allOf:230 - items:231 enum:232 - tx233 - rx234 - txu # if no ssiu node235 - rxu # if no ssiu node236 237 shared-pin:238 description: shared clock pin239 $ref: /schemas/types.yaml#/definitions/flag240 pio-transfer:241 description: PIO transfer mode242 $ref: /schemas/types.yaml#/definitions/flag243 no-busif:244 description: BUSIF is not used when [mem -> SSI] via DMA case245 $ref: /schemas/types.yaml#/definitions/flag246 required:247 - interrupts248 additionalProperties: false249 250patternProperties:251 # For DAI base252 'rcar_sound,dai(@[0-9a-f]+)?$':253 description: DAI subnode.254 type: object255 patternProperties:256 "^dai([0-9]+)?$":257 type: object258 additionalProperties: false259 260 properties:261 playback:262 $ref: /schemas/types.yaml#/definitions/phandle-array263 capture:264 $ref: /schemas/types.yaml#/definitions/phandle-array265 anyOf:266 - required:267 - playback268 - required:269 - capture270 additionalProperties: false271 272 'ports(@[0-9a-f]+)?$':273 $ref: audio-graph-port.yaml#/definitions/port-base274 unevaluatedProperties: false275 patternProperties:276 '^port(@[0-9a-f]+)?$':277 $ref: "#/properties/port"278 279required:280 - compatible281 - reg282 - reg-names283 - clocks284 - clock-names285 286allOf:287 - $ref: dai-common.yaml#288 289 # --------------------290 # reg/reg-names291 # --------------------292 # for Gen1293 - if:294 properties:295 compatible:296 contains:297 const: renesas,rcar_sound-gen1298 then:299 properties:300 reg:301 maxItems: 3302 reg-names:303 items:304 enum:305 - sru306 - ssi307 - adg308 # for Gen2/Gen3309 - if:310 properties:311 compatible:312 contains:313 enum:314 - renesas,rcar_sound-gen2315 - renesas,rcar_sound-gen3316 then:317 properties:318 reg:319 minItems: 5320 reg-names:321 items:322 enum:323 - scu324 - adg325 - ssiu326 - ssi327 - audmapp328 # for Gen4329 - if:330 properties:331 compatible:332 contains:333 const: renesas,rcar_sound-gen4334 then:335 properties:336 reg:337 maxItems: 4338 reg-names:339 items:340 enum:341 - adg342 - ssiu343 - ssi344 - sdmc345 346 # --------------------347 # clock-names348 # --------------------349 - if:350 properties:351 compatible:352 contains:353 const: renesas,rcar_sound-gen4354 then:355 properties:356 clock-names:357 maxItems: 3358 items:359 enum:360 - ssi.0361 - ssiu.0362 - clkin363 else:364 properties:365 clock-names:366 minItems: 1367 maxItems: 31368 items:369 oneOf:370 - const: ssi-all371 - pattern: '^ssi\.[0-9]$'372 - pattern: '^src\.[0-9]$'373 - pattern: '^mix\.[0-1]$'374 - pattern: '^ctu\.[0-1]$'375 - pattern: '^dvc\.[0-1]$'376 - pattern: '^clk_(a|b|c|i)$'377 378unevaluatedProperties: false379 380examples:381 - |382 #include <dt-bindings/clock/r8a7790-cpg-mssr.h>383 #include <dt-bindings/interrupt-controller/arm-gic.h>384 #include <dt-bindings/power/r8a7790-sysc.h>385 rcar_sound: sound@ec500000 {386 #sound-dai-cells = <1>;387 compatible = "renesas,rcar_sound-r8a7790", "renesas,rcar_sound-gen2";388 reg = <0xec500000 0x1000>, /* SCU */389 <0xec5a0000 0x100>, /* ADG */390 <0xec540000 0x1000>, /* SSIU */391 <0xec541000 0x280>, /* SSI */392 <0xec740000 0x200>; /* Audio DMAC peri peri*/393 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";394 395 clocks = <&cpg CPG_MOD 1005>, /* SSI-ALL */396 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>, /* SSI9, SSI8 */397 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>, /* SSI7, SSI6 */398 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>, /* SSI5, SSI4 */399 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>, /* SSI3, SSI2 */400 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>, /* SSI1, SSI0 */401 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>, /* SRC9, SRC8 */402 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>, /* SRC7, SRC6 */403 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>, /* SRC5, SRC4 */404 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>, /* SRC3, SRC2 */405 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>, /* SRC1, SRC0 */406 <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>, /* MIX1, MIX0 */407 <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>, /* CTU1, CTU0 */408 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>, /* DVC0, DVC1 */409 <&audio_clk_a>, <&audio_clk_b>, /* CLKA, CLKB */410 <&audio_clk_c>, <&audio_clk_i>; /* CLKC, CLKI */411 412 clock-names = "ssi-all",413 "ssi.9", "ssi.8",414 "ssi.7", "ssi.6",415 "ssi.5", "ssi.4",416 "ssi.3", "ssi.2",417 "ssi.1", "ssi.0",418 "src.9", "src.8",419 "src.7", "src.6",420 "src.5", "src.4",421 "src.3", "src.2",422 "src.1", "src.0",423 "mix.1", "mix.0",424 "ctu.1", "ctu.0",425 "dvc.0", "dvc.1",426 "clk_a", "clk_b",427 "clk_c", "clk_i";428 429 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;430 431 resets = <&cpg 1005>,432 <&cpg 1006>, <&cpg 1007>, <&cpg 1008>, <&cpg 1009>,433 <&cpg 1010>, <&cpg 1011>, <&cpg 1012>, <&cpg 1013>,434 <&cpg 1014>, <&cpg 1015>;435 reset-names = "ssi-all",436 "ssi.9", "ssi.8", "ssi.7", "ssi.6",437 "ssi.5", "ssi.4", "ssi.3", "ssi.2",438 "ssi.1", "ssi.0";439 440 rcar_sound,dvc {441 dvc0: dvc-0 {442 dmas = <&audma0 0xbc>;443 dma-names = "tx";444 };445 dvc1: dvc-1 {446 dmas = <&audma0 0xbe>;447 dma-names = "tx";448 };449 };450 451 rcar_sound,mix {452 mix0: mix-0 { };453 mix1: mix-1 { };454 };455 456 rcar_sound,ctu {457 ctu00: ctu-0 { };458 ctu01: ctu-1 { };459 ctu02: ctu-2 { };460 ctu03: ctu-3 { };461 ctu10: ctu-4 { };462 ctu11: ctu-5 { };463 ctu12: ctu-6 { };464 ctu13: ctu-7 { };465 };466 467 rcar_sound,src {468 src0: src-0 {469 status = "disabled";470 };471 src1: src-1 {472 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;473 dmas = <&audma0 0x87>, <&audma1 0x9c>;474 dma-names = "rx", "tx";475 };476 /* skip after src-2 */477 };478 479 rcar_sound,ssiu {480 ssiu00: ssiu-0 {481 dmas = <&audma0 0x15>, <&audma1 0x16>;482 dma-names = "rx", "tx";483 };484 ssiu01: ssiu-1 {485 dmas = <&audma0 0x35>, <&audma1 0x36>;486 dma-names = "rx", "tx";487 };488 /* skip after ssiu-2 */489 };490 491 rcar_sound,ssi {492 ssi0: ssi-0 {493 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;494 dmas = <&audma0 0x01>, <&audma1 0x02>;495 dma-names = "rx", "tx";496 };497 ssi1: ssi-1 {498 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;499 dmas = <&audma0 0x03>, <&audma1 0x04>;500 dma-names = "rx", "tx";501 };502 /* skip other ssi-2 */503 };504 505 /* DAI base */506 rcar_sound,dai {507 dai0 {508 playback = <&ssi5>, <&src5>;509 capture = <&ssi6>;510 };511 dai1 {512 playback = <&ssi3>;513 };514 dai2 {515 capture = <&ssi4>;516 };517 dai3 {518 playback = <&ssi7>;519 };520 dai4 {521 capture = <&ssi8>;522 };523 };524 525 /* assume audio-graph */526 port {527 rsnd_endpoint: endpoint {528 remote-endpoint = <&codec_endpoint>;529 530 dai-format = "left_j";531 bitclock-master = <&rsnd_endpoint0>;532 frame-master = <&rsnd_endpoint0>;533 534 playback = <&ssi0>, <&src0>, <&dvc0>;535 capture = <&ssi1>, <&src1>, <&dvc1>;536 };537 };538 };539 540 /* assume audio-graph */541 codec {542 port {543 codec_endpoint: endpoint {544 remote-endpoint = <&rsnd_endpoint>;545 };546 };547 };548