1# Copyright (c) 2024, Ambiq Micro Inc. <www.ambiq.com>
2# SPDX-License-Identifier: Apache-2.0
3
4# Common fields for MSPI controllers
5
6include: base.yaml
7
8bus: mspi
9
10properties:
11  clock-frequency:
12    type: int
13    description: |
14      Clock frequency the MSPI peripheral is being driven at, in Hz.
15  "#address-cells":
16    required: true
17    const: 1
18  "#size-cells":
19    required: true
20    const: 0
21
22  op-mode:
23    type: string
24    enum:
25      - "MSPI_CONTROLLER"
26      - "MSPI_PERIPHERAL"
27    description: |
28      Indicate MSPI controller or peripheral mode of the controller.
29      The controller driver may use this during initialization.
30
31  duplex:
32    type: string
33    enum:
34      - "MSPI_HALF_DUPLEX"
35      - "MSPI_FULL_DUPLEX"
36    description: |
37      Indicate MSPI Duplex mode, full or half.
38      The controller driver may check this setting against its
39      capabilities.
40
41  dqs-support:
42    type: boolean
43    description: |
44      Indicate whether the hardware supports DQS.
45      The controller driver may check this setting against its
46      capabilities.
47
48  software-multiperipheral:
49    type: boolean
50    description: |
51      Indicate whether the controller driver enables support for
52      software managed multi peripheral feature.
53      At the minimum, the controller driver should use it to allow
54      or disallow calling mspi_dev_config with MSPI_DEVICE_CONFIG_NONE.
55
56  ce-gpios:
57    type: phandle-array
58    description: |
59      An array of chip select GPIOs to use. Each element
60      in the array specifies a GPIO. The index in the array
61      corresponds to the child node that the CE gpio controls.
62
63      Example:
64
65        mspi@... {
66                ce-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>,
67                              <&gpio1 10 GPIO_ACTIVE_LOW>,
68                              ...;
69
70                mspi-device@0 {
71                        reg = <0>;
72                        ...
73                };
74                mspi-device@1 {
75                        reg = <1>;
76                        ...
77                };
78                ...
79        };
80
81      The child node "mspi-device@0" specifies a mspi device with
82      chip select controller gpio0, pin 23, and devicetree
83      GPIO flags GPIO_ACTIVE_LOW. Similarly, "mspi-device@1" has CE GPIO
84      controller gpio1, pin 10, and flags GPIO_ACTIVE_LOW. Additional
85      devices can be configured in the same way.
86
87      If unsure about the flags cell, GPIO_ACTIVE_LOW is generally a safe
88      choice for a typical "CEn" pin. GPIO_ACTIVE_HIGH may be used if
89      intervening hardware inverts the signal to the peripheral device or
90      the line itself is active high.
91
92      Regardless of whether the CE pin may need software control or MSPI
93      controller has dedicated CE pin, this field should be defined to
94      help manage multiple devices on the same MSPI controller.
95