xref: /freebsd/sys/contrib/device-tree/Bindings/spi/st,stm32-spi.yaml (revision a64729f5077d77e13b9497cb33ecb3c82e606ee8)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/spi/st,stm32-spi.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: STMicroelectronics STM32 SPI Controller
8
9description: |
10  The STM32 SPI controller is used to communicate with external devices using
11  the Serial Peripheral Interface. It supports full-duplex, half-duplex and
12  simplex synchronous serial communication with external devices. It supports
13  from 4 to 32-bit data size.
14
15maintainers:
16  - Erwan Leray <erwan.leray@foss.st.com>
17  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
18
19allOf:
20  - $ref: spi-controller.yaml#
21
22properties:
23  compatible:
24    enum:
25      - st,stm32f4-spi
26      - st,stm32f7-spi
27      - st,stm32h7-spi
28      - st,stm32mp25-spi
29
30  reg:
31    maxItems: 1
32
33  clocks:
34    maxItems: 1
35
36  interrupts:
37    maxItems: 1
38
39  resets:
40    maxItems: 1
41
42  dmas:
43    description: |
44      DMA specifiers for tx and rx dma. DMA fifo mode must be used. See
45      the STM32 DMA bindings Documentation/devicetree/bindings/dma/st,stm32-dma.yaml.
46    items:
47      - description: rx DMA channel
48      - description: tx DMA channel
49
50  dma-names:
51    items:
52      - const: rx
53      - const: tx
54
55required:
56  - compatible
57  - reg
58  - clocks
59  - interrupts
60
61unevaluatedProperties: false
62
63examples:
64  - |
65    #include <dt-bindings/interrupt-controller/arm-gic.h>
66    #include <dt-bindings/clock/stm32mp1-clks.h>
67    #include <dt-bindings/reset/stm32mp1-resets.h>
68    spi@4000b000 {
69        #address-cells = <1>;
70        #size-cells = <0>;
71        compatible = "st,stm32h7-spi";
72        reg = <0x4000b000 0x400>;
73        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
74        clocks = <&rcc SPI2_K>;
75        resets = <&rcc SPI2_R>;
76        dmas = <&dmamux1 0 39 0x400 0x05>,
77               <&dmamux1 1 40 0x400 0x05>;
78        dma-names = "rx", "tx";
79        cs-gpios = <&gpioa 11 0>;
80    };
81
82...
83