xref: /openbmc/linux/Documentation/devicetree/bindings/spi/spi-pl022.yaml (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
1cc0f6e96SRob Herring# SPDX-License-Identifier: GPL-2.0
2cc0f6e96SRob Herring%YAML 1.2
3cc0f6e96SRob Herring---
4cc0f6e96SRob Herring$id: http://devicetree.org/schemas/spi/spi-pl022.yaml#
5cc0f6e96SRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6cc0f6e96SRob Herring
7cc0f6e96SRob Herringtitle: ARM PL022 SPI controller
8cc0f6e96SRob Herring
9cc0f6e96SRob Herringmaintainers:
10cc0f6e96SRob Herring  - Linus Walleij <linus.walleij@linaro.org>
11cc0f6e96SRob Herring
12cc0f6e96SRob HerringallOf:
1399a7fa0eSKrzysztof Kozlowski  - $ref: spi-controller.yaml#
14*8858babfSWilliam Qiu  - $ref: /schemas/arm/primecell.yaml#
15cc0f6e96SRob Herring
16cc0f6e96SRob Herring# We need a select here so we don't match all nodes with 'arm,primecell'
17cc0f6e96SRob Herringselect:
18cc0f6e96SRob Herring  properties:
19cc0f6e96SRob Herring    compatible:
20cc0f6e96SRob Herring      contains:
21cc0f6e96SRob Herring        const: arm,pl022
22cc0f6e96SRob Herring  required:
23cc0f6e96SRob Herring    - compatible
24cc0f6e96SRob Herring
25cc0f6e96SRob Herringproperties:
26cc0f6e96SRob Herring  compatible:
27cc0f6e96SRob Herring    items:
28cc0f6e96SRob Herring      - const: arm,pl022
29cc0f6e96SRob Herring      - const: arm,primecell
30cc0f6e96SRob Herring
31cc0f6e96SRob Herring  reg:
32cc0f6e96SRob Herring    maxItems: 1
33cc0f6e96SRob Herring
34cc0f6e96SRob Herring  interrupts:
35cc0f6e96SRob Herring    maxItems: 1
36cc0f6e96SRob Herring
37cc0f6e96SRob Herring  clocks:
38cc0f6e96SRob Herring    maxItems: 2
39cc0f6e96SRob Herring
40cc0f6e96SRob Herring  clock-names:
41cc0f6e96SRob Herring    items:
421889421aSKuldeep Singh      - const: sspclk
43cc0f6e96SRob Herring      - const: apb_pclk
44cc0f6e96SRob Herring
45cc0f6e96SRob Herring  pl022,autosuspend-delay:
46cc0f6e96SRob Herring    description: delay in ms following transfer completion before the
47cc0f6e96SRob Herring      runtime power management system suspends the device. A setting of 0
48cc0f6e96SRob Herring      indicates no delay and the device will be suspended immediately.
4999a7fa0eSKrzysztof Kozlowski    $ref: /schemas/types.yaml#/definitions/uint32
50cc0f6e96SRob Herring
51cc0f6e96SRob Herring  pl022,rt:
52cc0f6e96SRob Herring    description: indicates the controller should run the message pump with realtime
53cc0f6e96SRob Herring      priority to minimise the transfer latency on the bus (boolean)
54cc0f6e96SRob Herring    type: boolean
55cc0f6e96SRob Herring
56cc0f6e96SRob Herring  dmas:
57cc0f6e96SRob Herring    description:
58cc0f6e96SRob Herring      Two or more DMA channel specifiers following the convention outlined
59cc0f6e96SRob Herring      in bindings/dma/dma.txt
60cc0f6e96SRob Herring    minItems: 2
61cc0f6e96SRob Herring    maxItems: 32
62cc0f6e96SRob Herring
63cc0f6e96SRob Herring  dma-names:
64cc0f6e96SRob Herring    description:
65cc0f6e96SRob Herring      There must be at least one channel named "tx" for transmit and named "rx"
66cc0f6e96SRob Herring      for receive.
67cc0f6e96SRob Herring    minItems: 2
68cc0f6e96SRob Herring    maxItems: 32
69cc0f6e96SRob Herring    additionalItems: true
70cc0f6e96SRob Herring    items:
71cc0f6e96SRob Herring      - const: rx
72cc0f6e96SRob Herring      - const: tx
73cc0f6e96SRob Herring
74d94758b3SLinus Walleij  resets:
75d94758b3SLinus Walleij    maxItems: 1
76d94758b3SLinus Walleij
77cc0f6e96SRob HerringpatternProperties:
78cc0f6e96SRob Herring  "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-f]+$":
79cc0f6e96SRob Herring    type: object
80cc0f6e96SRob Herring    # SPI slave nodes must be children of the SPI master node and can
81cc0f6e96SRob Herring    # contain the following properties.
82cc0f6e96SRob Herring    properties:
83cc0f6e96SRob Herring      pl022,interface:
84cc0f6e96SRob Herring        description: SPI interface type
8599a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
863d21a460SRob Herring        enum:
87cc0f6e96SRob Herring          - 0      # SPI
88cc0f6e96SRob Herring          - 1      # Texas Instruments Synchronous Serial Frame Format
89cc0f6e96SRob Herring          - 2      # Microwire (Half Duplex)
90cc0f6e96SRob Herring
91cc0f6e96SRob Herring      pl022,com-mode:
92cc0f6e96SRob Herring        description: Specifies the transfer mode
9399a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
943d21a460SRob Herring        enum:
95cc0f6e96SRob Herring          - 0      # interrupt mode
96cc0f6e96SRob Herring          - 1      # polling mode
97cc0f6e96SRob Herring          - 2      # DMA mode
98cc0f6e96SRob Herring        default: 1
99cc0f6e96SRob Herring
100cc0f6e96SRob Herring      pl022,rx-level-trig:
101cc0f6e96SRob Herring        description: Rx FIFO watermark level
10299a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
1033d21a460SRob Herring        minimum: 0
104cc0f6e96SRob Herring        maximum: 4
105cc0f6e96SRob Herring
106cc0f6e96SRob Herring      pl022,tx-level-trig:
107cc0f6e96SRob Herring        description: Tx FIFO watermark level
10899a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
1093d21a460SRob Herring        minimum: 0
110cc0f6e96SRob Herring        maximum: 4
111cc0f6e96SRob Herring
112cc0f6e96SRob Herring      pl022,ctrl-len:
113cc0f6e96SRob Herring        description: Microwire interface - Control length
11499a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
1153d21a460SRob Herring        minimum: 0x03
116cc0f6e96SRob Herring        maximum: 0x1f
117cc0f6e96SRob Herring
118cc0f6e96SRob Herring      pl022,wait-state:
119cc0f6e96SRob Herring        description: Microwire interface - Wait state
12099a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
1213d21a460SRob Herring        enum: [0, 1]
122cc0f6e96SRob Herring
123cc0f6e96SRob Herring      pl022,duplex:
124cc0f6e96SRob Herring        description: Microwire interface - Full/Half duplex
12599a7fa0eSKrzysztof Kozlowski        $ref: /schemas/types.yaml#/definitions/uint32
1263d21a460SRob Herring        enum: [0, 1]
127cc0f6e96SRob Herring
128cc0f6e96SRob Herringrequired:
129cc0f6e96SRob Herring  - compatible
130cc0f6e96SRob Herring  - reg
131cc0f6e96SRob Herring  - interrupts
132cc0f6e96SRob Herring
1336fdc6e23SRob HerringunevaluatedProperties: false
1346fdc6e23SRob Herring
135cc0f6e96SRob Herringexamples:
136cc0f6e96SRob Herring  - |
137cc0f6e96SRob Herring    spi@e0100000 {
138cc0f6e96SRob Herring      compatible = "arm,pl022", "arm,primecell";
139cc0f6e96SRob Herring      reg = <0xe0100000 0x1000>;
140cc0f6e96SRob Herring      #address-cells = <1>;
141cc0f6e96SRob Herring      #size-cells = <0>;
142cc0f6e96SRob Herring      interrupts = <0 31 0x4>;
143cc0f6e96SRob Herring      dmas = <&dma_controller 23 1>,
144cc0f6e96SRob Herring        <&dma_controller 24 0>;
145cc0f6e96SRob Herring      dma-names = "rx", "tx";
146cc0f6e96SRob Herring
147673283a3SKrzysztof Kozlowski      flash@1 {
148cc0f6e96SRob Herring        compatible = "st,m25p80";
149cc0f6e96SRob Herring        reg = <1>;
150cc0f6e96SRob Herring        spi-max-frequency = <12000000>;
151cc0f6e96SRob Herring        spi-cpol;
152cc0f6e96SRob Herring        spi-cpha;
153cc0f6e96SRob Herring        pl022,interface = <0>;
154cc0f6e96SRob Herring        pl022,com-mode = <0x2>;
155cc0f6e96SRob Herring        pl022,rx-level-trig = <0>;
156cc0f6e96SRob Herring        pl022,tx-level-trig = <0>;
157cc0f6e96SRob Herring        pl022,ctrl-len = <0x11>;
158cc0f6e96SRob Herring        pl022,wait-state = <0>;
159cc0f6e96SRob Herring        pl022,duplex = <0>;
160cc0f6e96SRob Herring      };
161cc0f6e96SRob Herring    };
162cc0f6e96SRob Herring...
163