xref: /freebsd-src/sys/contrib/device-tree/Bindings/spi/spi-sifive.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/spi/spi-sifive.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: SiFive SPI controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Pragnesh Patel <pragnesh.patel@sifive.com>
11c66ec88fSEmmanuel Vadot  - Paul Walmsley  <paul.walmsley@sifive.com>
12c66ec88fSEmmanuel Vadot  - Palmer Dabbelt <palmer@sifive.com>
13c66ec88fSEmmanuel Vadot
14c66ec88fSEmmanuel VadotallOf:
15*cb7aa33aSEmmanuel Vadot  - $ref: spi-controller.yaml#
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadotproperties:
18c66ec88fSEmmanuel Vadot  compatible:
19c66ec88fSEmmanuel Vadot    items:
205def4c47SEmmanuel Vadot      - enum:
215def4c47SEmmanuel Vadot          - sifive,fu540-c000-spi
225def4c47SEmmanuel Vadot          - sifive,fu740-c000-spi
23c66ec88fSEmmanuel Vadot      - const: sifive,spi0
24c66ec88fSEmmanuel Vadot
25c66ec88fSEmmanuel Vadot    description:
26c66ec88fSEmmanuel Vadot      Should be "sifive,<chip>-spi" and "sifive,spi<version>".
27c66ec88fSEmmanuel Vadot      Supported compatible strings are -
285def4c47SEmmanuel Vadot      "sifive,fu540-c000-spi" and "sifive,fu740-c000-spi" for the SiFive SPI v0
295def4c47SEmmanuel Vadot      as integrated onto the SiFive FU540 and FU740 chip resp, and "sifive,spi0"
305def4c47SEmmanuel Vadot      for the SiFive SPI v0 IP block with no chip integration tweaks.
31c66ec88fSEmmanuel Vadot      Please refer to sifive-blocks-ip-versioning.txt for details
32c66ec88fSEmmanuel Vadot
33c66ec88fSEmmanuel Vadot      SPI RTL that corresponds to the IP block version numbers can be found here -
34c66ec88fSEmmanuel Vadot      https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/spi
35c66ec88fSEmmanuel Vadot
36c66ec88fSEmmanuel Vadot  reg:
37c66ec88fSEmmanuel Vadot    minItems: 1
38c66ec88fSEmmanuel Vadot    items:
39c66ec88fSEmmanuel Vadot      - description: SPI registers region
40c66ec88fSEmmanuel Vadot      - description: Memory mapped flash region
41c66ec88fSEmmanuel Vadot
42c66ec88fSEmmanuel Vadot  interrupts:
43c66ec88fSEmmanuel Vadot    maxItems: 1
44c66ec88fSEmmanuel Vadot
45c66ec88fSEmmanuel Vadot  clocks:
46c66ec88fSEmmanuel Vadot    maxItems: 1
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadot    description:
49c66ec88fSEmmanuel Vadot      Must reference the frequency given to the controller
50c66ec88fSEmmanuel Vadot
51c66ec88fSEmmanuel Vadot  sifive,fifo-depth:
52c66ec88fSEmmanuel Vadot    description:
53c66ec88fSEmmanuel Vadot      Depth of hardware queues; defaults to 8
54*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
55c66ec88fSEmmanuel Vadot    enum: [8]
56c66ec88fSEmmanuel Vadot    default: 8
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel Vadot  sifive,max-bits-per-word:
59c66ec88fSEmmanuel Vadot    description:
60c66ec88fSEmmanuel Vadot      Maximum bits per word; defaults to 8
61*cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
62c66ec88fSEmmanuel Vadot    enum: [0, 1, 2, 3, 4, 5, 6, 7, 8]
63c66ec88fSEmmanuel Vadot    default: 8
64c66ec88fSEmmanuel Vadot
65c66ec88fSEmmanuel Vadotrequired:
66c66ec88fSEmmanuel Vadot  - compatible
67c66ec88fSEmmanuel Vadot  - reg
68c66ec88fSEmmanuel Vadot  - interrupts
69c66ec88fSEmmanuel Vadot  - clocks
70c66ec88fSEmmanuel Vadot
716be33864SEmmanuel VadotunevaluatedProperties: false
726be33864SEmmanuel Vadot
73c66ec88fSEmmanuel Vadotexamples:
74c66ec88fSEmmanuel Vadot  - |
75c66ec88fSEmmanuel Vadot    spi: spi@10040000 {
76c66ec88fSEmmanuel Vadot      compatible = "sifive,fu540-c000-spi", "sifive,spi0";
77c66ec88fSEmmanuel Vadot      reg = <0x10040000 0x1000>, <0x20000000 0x10000000>;
78c66ec88fSEmmanuel Vadot      interrupt-parent = <&plic>;
79c66ec88fSEmmanuel Vadot      interrupts = <51>;
80c66ec88fSEmmanuel Vadot      clocks = <&tlclk>;
81c66ec88fSEmmanuel Vadot      #address-cells = <1>;
82c66ec88fSEmmanuel Vadot      #size-cells = <0>;
83c66ec88fSEmmanuel Vadot      sifive,fifo-depth = <8>;
84c66ec88fSEmmanuel Vadot      sifive,max-bits-per-word = <8>;
85c66ec88fSEmmanuel Vadot    };
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadot...
88