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