1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/spi/allwinner,sun6i-a31-spi.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Allwinner A31 SPI Controller Device Tree Bindings
8
9allOf:
10  - $ref: "spi-controller.yaml"
11
12maintainers:
13  - Chen-Yu Tsai <wens@csie.org>
14  - Maxime Ripard <mripard@kernel.org>
15
16properties:
17  "#address-cells": true
18  "#size-cells": true
19
20  compatible:
21    oneOf:
22      - const: allwinner,sun6i-a31-spi
23      - const: allwinner,sun8i-h3-spi
24      - items:
25          - enum:
26              - allwinner,sun8i-r40-spi
27              - allwinner,sun50i-h6-spi
28          - const: allwinner,sun8i-h3-spi
29
30  reg:
31    maxItems: 1
32
33  interrupts:
34    maxItems: 1
35
36  clocks:
37    items:
38      - description: Bus Clock
39      - description: Module Clock
40
41  clock-names:
42    items:
43      - const: ahb
44      - const: mod
45
46  resets:
47    maxItems: 1
48
49  dmas:
50    items:
51      - description: RX DMA Channel
52      - description: TX DMA Channel
53
54  dma-names:
55    items:
56      - const: rx
57      - const: tx
58
59  num-cs: true
60
61patternProperties:
62  "^.*@[0-9a-f]+":
63    type: object
64    properties:
65      reg:
66        items:
67          minimum: 0
68          maximum: 4
69
70      spi-rx-bus-width:
71        const: 1
72
73      spi-tx-bus-width:
74        const: 1
75
76required:
77  - compatible
78  - reg
79  - interrupts
80  - clocks
81  - clock-names
82
83additionalProperties: false
84
85examples:
86  - |
87    spi1: spi@1c69000 {
88        compatible = "allwinner,sun6i-a31-spi";
89        reg = <0x01c69000 0x1000>;
90        interrupts = <0 66 4>;
91        clocks = <&ahb1_gates 21>, <&spi1_clk>;
92        clock-names = "ahb", "mod";
93        resets = <&ahb1_rst 21>;
94        #address-cells = <1>;
95        #size-cells = <0>;
96    };
97
98  - |
99    spi0: spi@1c68000 {
100        compatible = "allwinner,sun8i-h3-spi";
101        reg = <0x01c68000 0x1000>;
102        interrupts = <0 65 4>;
103        clocks = <&ccu 30>, <&ccu 82>;
104        clock-names = "ahb", "mod";
105        dmas = <&dma 23>, <&dma 23>;
106        dma-names = "rx", "tx";
107        resets = <&ccu 15>;
108        #address-cells = <1>;
109        #size-cells = <0>;
110    };
111
112...
113