xref: /freebsd-src/sys/contrib/device-tree/Bindings/ata/ahci-platform.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c9ccf3a3SEmmanuel Vadot%YAML 1.2
3c9ccf3a3SEmmanuel Vadot---
4c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/ata/ahci-platform.yaml#
5c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c9ccf3a3SEmmanuel Vadot
7c9ccf3a3SEmmanuel Vadottitle: AHCI SATA Controller
8c9ccf3a3SEmmanuel Vadot
9c9ccf3a3SEmmanuel Vadotdescription: |
10c9ccf3a3SEmmanuel Vadot  SATA nodes are defined to describe on-chip Serial ATA controllers.
11c9ccf3a3SEmmanuel Vadot  Each SATA controller should have its own node.
12c9ccf3a3SEmmanuel Vadot
13c9ccf3a3SEmmanuel Vadot  It is possible, but not required, to represent each port as a sub-node.
14c9ccf3a3SEmmanuel Vadot  It allows to enable each port independently when dealing with multiple
15c9ccf3a3SEmmanuel Vadot  PHYs.
16c9ccf3a3SEmmanuel Vadot
17c9ccf3a3SEmmanuel Vadotmaintainers:
18c9ccf3a3SEmmanuel Vadot  - Hans de Goede <hdegoede@redhat.com>
19c9ccf3a3SEmmanuel Vadot  - Jens Axboe <axboe@kernel.dk>
20c9ccf3a3SEmmanuel Vadot
21c9ccf3a3SEmmanuel Vadotselect:
22c9ccf3a3SEmmanuel Vadot  properties:
23c9ccf3a3SEmmanuel Vadot    compatible:
24c9ccf3a3SEmmanuel Vadot      contains:
25c9ccf3a3SEmmanuel Vadot        enum:
26c9ccf3a3SEmmanuel Vadot          - brcm,iproc-ahci
27c9ccf3a3SEmmanuel Vadot          - cavium,octeon-7130-ahci
28c9ccf3a3SEmmanuel Vadot          - hisilicon,hisi-ahci
29c9ccf3a3SEmmanuel Vadot          - ibm,476gtr-ahci
30c9ccf3a3SEmmanuel Vadot          - marvell,armada-3700-ahci
31c9ccf3a3SEmmanuel Vadot          - marvell,armada-8k-ahci
32c9ccf3a3SEmmanuel Vadot          - marvell,berlin2q-ahci
33*b2d2a78aSEmmanuel Vadot          - qcom,apq8064-ahci
34*b2d2a78aSEmmanuel Vadot          - qcom,ipq806x-ahci
35fac71e4eSEmmanuel Vadot          - socionext,uniphier-pro4-ahci
36fac71e4eSEmmanuel Vadot          - socionext,uniphier-pxs2-ahci
37fac71e4eSEmmanuel Vadot          - socionext,uniphier-pxs3-ahci
38c9ccf3a3SEmmanuel Vadot  required:
39c9ccf3a3SEmmanuel Vadot    - compatible
40c9ccf3a3SEmmanuel Vadot
41c9ccf3a3SEmmanuel Vadotproperties:
42c9ccf3a3SEmmanuel Vadot  compatible:
43c9ccf3a3SEmmanuel Vadot    oneOf:
44c9ccf3a3SEmmanuel Vadot      - items:
45c9ccf3a3SEmmanuel Vadot          - enum:
46c9ccf3a3SEmmanuel Vadot              - brcm,iproc-ahci
47c9ccf3a3SEmmanuel Vadot              - marvell,armada-8k-ahci
48c9ccf3a3SEmmanuel Vadot              - marvell,berlin2-ahci
49c9ccf3a3SEmmanuel Vadot              - marvell,berlin2q-ahci
50*b2d2a78aSEmmanuel Vadot              - qcom,apq8064-ahci
51*b2d2a78aSEmmanuel Vadot              - qcom,ipq806x-ahci
52fac71e4eSEmmanuel Vadot              - socionext,uniphier-pro4-ahci
53fac71e4eSEmmanuel Vadot              - socionext,uniphier-pxs2-ahci
54fac71e4eSEmmanuel Vadot              - socionext,uniphier-pxs3-ahci
55c9ccf3a3SEmmanuel Vadot          - const: generic-ahci
56c9ccf3a3SEmmanuel Vadot      - enum:
57c9ccf3a3SEmmanuel Vadot          - cavium,octeon-7130-ahci
58c9ccf3a3SEmmanuel Vadot          - hisilicon,hisi-ahci
59c9ccf3a3SEmmanuel Vadot          - ibm,476gtr-ahci
60c9ccf3a3SEmmanuel Vadot          - marvell,armada-3700-ahci
61c9ccf3a3SEmmanuel Vadot
62c9ccf3a3SEmmanuel Vadot  reg:
63c9ccf3a3SEmmanuel Vadot    minItems: 1
64c9ccf3a3SEmmanuel Vadot    maxItems: 2
65c9ccf3a3SEmmanuel Vadot
66c9ccf3a3SEmmanuel Vadot  reg-names:
67c9ccf3a3SEmmanuel Vadot    maxItems: 1
68c9ccf3a3SEmmanuel Vadot
69c9ccf3a3SEmmanuel Vadot  clocks:
70c9ccf3a3SEmmanuel Vadot    minItems: 1
71*b2d2a78aSEmmanuel Vadot    maxItems: 5
72c9ccf3a3SEmmanuel Vadot
73c9ccf3a3SEmmanuel Vadot  clock-names:
74c9ccf3a3SEmmanuel Vadot    minItems: 1
75*b2d2a78aSEmmanuel Vadot    maxItems: 5
76c9ccf3a3SEmmanuel Vadot
77c9ccf3a3SEmmanuel Vadot  interrupts:
78c9ccf3a3SEmmanuel Vadot    maxItems: 1
79c9ccf3a3SEmmanuel Vadot
80c9ccf3a3SEmmanuel Vadot  power-domains:
81c9ccf3a3SEmmanuel Vadot    maxItems: 1
82c9ccf3a3SEmmanuel Vadot
83c9ccf3a3SEmmanuel Vadot  resets:
84fac71e4eSEmmanuel Vadot    minItems: 1
85fac71e4eSEmmanuel Vadot    maxItems: 3
86c9ccf3a3SEmmanuel Vadot
877ef62cebSEmmanuel VadotpatternProperties:
887ef62cebSEmmanuel Vadot  "^sata-port@[0-9a-f]+$":
897ef62cebSEmmanuel Vadot    $ref: /schemas/ata/ahci-common.yaml#/$defs/ahci-port
907ef62cebSEmmanuel Vadot
917ef62cebSEmmanuel Vadot    anyOf:
927ef62cebSEmmanuel Vadot      - required: [ phys ]
937ef62cebSEmmanuel Vadot      - required: [ target-supply ]
947ef62cebSEmmanuel Vadot
957ef62cebSEmmanuel Vadot    unevaluatedProperties: false
96c9ccf3a3SEmmanuel Vadot
97c9ccf3a3SEmmanuel Vadotrequired:
98c9ccf3a3SEmmanuel Vadot  - compatible
99c9ccf3a3SEmmanuel Vadot  - reg
100c9ccf3a3SEmmanuel Vadot  - interrupts
101c9ccf3a3SEmmanuel Vadot
102fac71e4eSEmmanuel VadotallOf:
103fac71e4eSEmmanuel Vadot  - $ref: ahci-common.yaml#
104*b2d2a78aSEmmanuel Vadot
105*b2d2a78aSEmmanuel Vadot  - if:
106*b2d2a78aSEmmanuel Vadot      properties:
107*b2d2a78aSEmmanuel Vadot        compatible:
108*b2d2a78aSEmmanuel Vadot          contains:
109*b2d2a78aSEmmanuel Vadot            enum:
110*b2d2a78aSEmmanuel Vadot              - qcom,apq8064-ahci
111*b2d2a78aSEmmanuel Vadot              - qcom,ipq806x-ahci
112*b2d2a78aSEmmanuel Vadot    then:
113*b2d2a78aSEmmanuel Vadot      properties:
114*b2d2a78aSEmmanuel Vadot        clocks:
115*b2d2a78aSEmmanuel Vadot          minItems: 5
116*b2d2a78aSEmmanuel Vadot        clock-names:
117*b2d2a78aSEmmanuel Vadot          items:
118*b2d2a78aSEmmanuel Vadot            - const: slave_iface
119*b2d2a78aSEmmanuel Vadot            - const: iface
120*b2d2a78aSEmmanuel Vadot            - const: core
121*b2d2a78aSEmmanuel Vadot            - const: rxoob
122*b2d2a78aSEmmanuel Vadot            - const: pmalive
123*b2d2a78aSEmmanuel Vadot      required:
124*b2d2a78aSEmmanuel Vadot        - phys
125*b2d2a78aSEmmanuel Vadot        - phy-names
126*b2d2a78aSEmmanuel Vadot        - clocks
127*b2d2a78aSEmmanuel Vadot        - clock-names
128*b2d2a78aSEmmanuel Vadot
129fac71e4eSEmmanuel Vadot  - if:
130fac71e4eSEmmanuel Vadot      properties:
131fac71e4eSEmmanuel Vadot        compatible:
132fac71e4eSEmmanuel Vadot          contains:
133fac71e4eSEmmanuel Vadot            const: socionext,uniphier-pro4-ahci
134fac71e4eSEmmanuel Vadot    then:
135fac71e4eSEmmanuel Vadot      properties:
136fac71e4eSEmmanuel Vadot        resets:
137fac71e4eSEmmanuel Vadot          items:
138fac71e4eSEmmanuel Vadot            - description: reset line for the parent
139fac71e4eSEmmanuel Vadot            - description: reset line for the glue logic
140fac71e4eSEmmanuel Vadot            - description: reset line for the controller
141fac71e4eSEmmanuel Vadot      required:
142fac71e4eSEmmanuel Vadot        - resets
143fac71e4eSEmmanuel Vadot    else:
144fac71e4eSEmmanuel Vadot      if:
145fac71e4eSEmmanuel Vadot        properties:
146fac71e4eSEmmanuel Vadot          compatible:
147fac71e4eSEmmanuel Vadot            contains:
148fac71e4eSEmmanuel Vadot              enum:
149fac71e4eSEmmanuel Vadot                - socionext,uniphier-pxs2-ahci
150fac71e4eSEmmanuel Vadot                - socionext,uniphier-pxs3-ahci
151fac71e4eSEmmanuel Vadot      then:
152fac71e4eSEmmanuel Vadot        properties:
153fac71e4eSEmmanuel Vadot          resets:
154fac71e4eSEmmanuel Vadot            items:
155fac71e4eSEmmanuel Vadot              - description: reset for the glue logic
156fac71e4eSEmmanuel Vadot              - description: reset for the controller
157fac71e4eSEmmanuel Vadot        required:
158fac71e4eSEmmanuel Vadot          - resets
159fac71e4eSEmmanuel Vadot      else:
160fac71e4eSEmmanuel Vadot        properties:
161fac71e4eSEmmanuel Vadot          resets:
162fac71e4eSEmmanuel Vadot            maxItems: 1
163fac71e4eSEmmanuel Vadot
164c9ccf3a3SEmmanuel VadotunevaluatedProperties: false
165c9ccf3a3SEmmanuel Vadot
166c9ccf3a3SEmmanuel Vadotexamples:
167c9ccf3a3SEmmanuel Vadot  - |
168c9ccf3a3SEmmanuel Vadot    sata@ffe08000 {
169c9ccf3a3SEmmanuel Vadot        compatible = "snps,spear-ahci";
170c9ccf3a3SEmmanuel Vadot        reg = <0xffe08000 0x1000>;
171c9ccf3a3SEmmanuel Vadot        interrupts = <115>;
172c9ccf3a3SEmmanuel Vadot    };
173c9ccf3a3SEmmanuel Vadot  - |
174c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
175c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/berlin2q.h>
1767ef62cebSEmmanuel Vadot    #include <dt-bindings/ata/ahci.h>
1777ef62cebSEmmanuel Vadot
178c9ccf3a3SEmmanuel Vadot    sata@f7e90000 {
179c9ccf3a3SEmmanuel Vadot        compatible = "marvell,berlin2q-ahci", "generic-ahci";
180c9ccf3a3SEmmanuel Vadot        reg = <0xf7e90000 0x1000>;
181c9ccf3a3SEmmanuel Vadot        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
182c9ccf3a3SEmmanuel Vadot        clocks = <&chip CLKID_SATA>;
183c9ccf3a3SEmmanuel Vadot        #address-cells = <1>;
184c9ccf3a3SEmmanuel Vadot        #size-cells = <0>;
185c9ccf3a3SEmmanuel Vadot
1867ef62cebSEmmanuel Vadot        hba-cap = <HBA_SMPS>;
1877ef62cebSEmmanuel Vadot
188c9ccf3a3SEmmanuel Vadot        sata0: sata-port@0 {
189c9ccf3a3SEmmanuel Vadot            reg = <0>;
1907ef62cebSEmmanuel Vadot
191c9ccf3a3SEmmanuel Vadot            phys = <&sata_phy 0>;
192c9ccf3a3SEmmanuel Vadot            target-supply = <&reg_sata0>;
1937ef62cebSEmmanuel Vadot
1947ef62cebSEmmanuel Vadot            hba-port-cap = <(HBA_PORT_FBSCP | HBA_PORT_ESP)>;
195c9ccf3a3SEmmanuel Vadot        };
196c9ccf3a3SEmmanuel Vadot
197c9ccf3a3SEmmanuel Vadot        sata1: sata-port@1 {
198c9ccf3a3SEmmanuel Vadot            reg = <1>;
1997ef62cebSEmmanuel Vadot
200c9ccf3a3SEmmanuel Vadot            phys = <&sata_phy 1>;
201c9ccf3a3SEmmanuel Vadot            target-supply = <&reg_sata1>;
2027ef62cebSEmmanuel Vadot
2037ef62cebSEmmanuel Vadot            hba-port-cap = <(HBA_PORT_HPCP | HBA_PORT_MPSP | HBA_PORT_FBSCP)>;
204c9ccf3a3SEmmanuel Vadot        };
205c9ccf3a3SEmmanuel Vadot    };
206