xref: /freebsd/sys/contrib/device-tree/Bindings/ata/ahci-platform.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
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*fac71e4eSEmmanuel Vadot          - socionext,uniphier-pro4-ahci
34*fac71e4eSEmmanuel Vadot          - socionext,uniphier-pxs2-ahci
35*fac71e4eSEmmanuel Vadot          - socionext,uniphier-pxs3-ahci
36c9ccf3a3SEmmanuel Vadot  required:
37c9ccf3a3SEmmanuel Vadot    - compatible
38c9ccf3a3SEmmanuel Vadot
39c9ccf3a3SEmmanuel Vadotproperties:
40c9ccf3a3SEmmanuel Vadot  compatible:
41c9ccf3a3SEmmanuel Vadot    oneOf:
42c9ccf3a3SEmmanuel Vadot      - items:
43c9ccf3a3SEmmanuel Vadot          - enum:
44c9ccf3a3SEmmanuel Vadot              - brcm,iproc-ahci
45c9ccf3a3SEmmanuel Vadot              - marvell,armada-8k-ahci
46c9ccf3a3SEmmanuel Vadot              - marvell,berlin2-ahci
47c9ccf3a3SEmmanuel Vadot              - marvell,berlin2q-ahci
48*fac71e4eSEmmanuel Vadot              - socionext,uniphier-pro4-ahci
49*fac71e4eSEmmanuel Vadot              - socionext,uniphier-pxs2-ahci
50*fac71e4eSEmmanuel Vadot              - socionext,uniphier-pxs3-ahci
51c9ccf3a3SEmmanuel Vadot          - const: generic-ahci
52c9ccf3a3SEmmanuel Vadot      - enum:
53c9ccf3a3SEmmanuel Vadot          - cavium,octeon-7130-ahci
54c9ccf3a3SEmmanuel Vadot          - hisilicon,hisi-ahci
55c9ccf3a3SEmmanuel Vadot          - ibm,476gtr-ahci
56c9ccf3a3SEmmanuel Vadot          - marvell,armada-3700-ahci
57c9ccf3a3SEmmanuel Vadot
58c9ccf3a3SEmmanuel Vadot  reg:
59c9ccf3a3SEmmanuel Vadot    minItems: 1
60c9ccf3a3SEmmanuel Vadot    maxItems: 2
61c9ccf3a3SEmmanuel Vadot
62c9ccf3a3SEmmanuel Vadot  reg-names:
63c9ccf3a3SEmmanuel Vadot    maxItems: 1
64c9ccf3a3SEmmanuel Vadot
65c9ccf3a3SEmmanuel Vadot  clocks:
66c9ccf3a3SEmmanuel Vadot    minItems: 1
67c9ccf3a3SEmmanuel Vadot    maxItems: 3
68c9ccf3a3SEmmanuel Vadot
69c9ccf3a3SEmmanuel Vadot  clock-names:
70c9ccf3a3SEmmanuel Vadot    minItems: 1
71c9ccf3a3SEmmanuel Vadot    maxItems: 3
72c9ccf3a3SEmmanuel Vadot
73c9ccf3a3SEmmanuel Vadot  interrupts:
74c9ccf3a3SEmmanuel Vadot    maxItems: 1
75c9ccf3a3SEmmanuel Vadot
76c9ccf3a3SEmmanuel Vadot  power-domains:
77c9ccf3a3SEmmanuel Vadot    maxItems: 1
78c9ccf3a3SEmmanuel Vadot
79c9ccf3a3SEmmanuel Vadot  resets:
80*fac71e4eSEmmanuel Vadot    minItems: 1
81*fac71e4eSEmmanuel Vadot    maxItems: 3
82c9ccf3a3SEmmanuel Vadot
837ef62cebSEmmanuel VadotpatternProperties:
847ef62cebSEmmanuel Vadot  "^sata-port@[0-9a-f]+$":
857ef62cebSEmmanuel Vadot    $ref: /schemas/ata/ahci-common.yaml#/$defs/ahci-port
867ef62cebSEmmanuel Vadot
877ef62cebSEmmanuel Vadot    anyOf:
887ef62cebSEmmanuel Vadot      - required: [ phys ]
897ef62cebSEmmanuel Vadot      - required: [ target-supply ]
907ef62cebSEmmanuel Vadot
917ef62cebSEmmanuel Vadot    unevaluatedProperties: false
92c9ccf3a3SEmmanuel Vadot
93c9ccf3a3SEmmanuel Vadotrequired:
94c9ccf3a3SEmmanuel Vadot  - compatible
95c9ccf3a3SEmmanuel Vadot  - reg
96c9ccf3a3SEmmanuel Vadot  - interrupts
97c9ccf3a3SEmmanuel Vadot
98*fac71e4eSEmmanuel VadotallOf:
99*fac71e4eSEmmanuel Vadot  - $ref: ahci-common.yaml#
100*fac71e4eSEmmanuel Vadot  - if:
101*fac71e4eSEmmanuel Vadot      properties:
102*fac71e4eSEmmanuel Vadot        compatible:
103*fac71e4eSEmmanuel Vadot          contains:
104*fac71e4eSEmmanuel Vadot            const: socionext,uniphier-pro4-ahci
105*fac71e4eSEmmanuel Vadot    then:
106*fac71e4eSEmmanuel Vadot      properties:
107*fac71e4eSEmmanuel Vadot        resets:
108*fac71e4eSEmmanuel Vadot          items:
109*fac71e4eSEmmanuel Vadot            - description: reset line for the parent
110*fac71e4eSEmmanuel Vadot            - description: reset line for the glue logic
111*fac71e4eSEmmanuel Vadot            - description: reset line for the controller
112*fac71e4eSEmmanuel Vadot      required:
113*fac71e4eSEmmanuel Vadot        - resets
114*fac71e4eSEmmanuel Vadot    else:
115*fac71e4eSEmmanuel Vadot      if:
116*fac71e4eSEmmanuel Vadot        properties:
117*fac71e4eSEmmanuel Vadot          compatible:
118*fac71e4eSEmmanuel Vadot            contains:
119*fac71e4eSEmmanuel Vadot              enum:
120*fac71e4eSEmmanuel Vadot                - socionext,uniphier-pxs2-ahci
121*fac71e4eSEmmanuel Vadot                - socionext,uniphier-pxs3-ahci
122*fac71e4eSEmmanuel Vadot      then:
123*fac71e4eSEmmanuel Vadot        properties:
124*fac71e4eSEmmanuel Vadot          resets:
125*fac71e4eSEmmanuel Vadot            items:
126*fac71e4eSEmmanuel Vadot              - description: reset for the glue logic
127*fac71e4eSEmmanuel Vadot              - description: reset for the controller
128*fac71e4eSEmmanuel Vadot        required:
129*fac71e4eSEmmanuel Vadot          - resets
130*fac71e4eSEmmanuel Vadot      else:
131*fac71e4eSEmmanuel Vadot        properties:
132*fac71e4eSEmmanuel Vadot          resets:
133*fac71e4eSEmmanuel Vadot            maxItems: 1
134*fac71e4eSEmmanuel Vadot
135c9ccf3a3SEmmanuel VadotunevaluatedProperties: false
136c9ccf3a3SEmmanuel Vadot
137c9ccf3a3SEmmanuel Vadotexamples:
138c9ccf3a3SEmmanuel Vadot  - |
139c9ccf3a3SEmmanuel Vadot    sata@ffe08000 {
140c9ccf3a3SEmmanuel Vadot        compatible = "snps,spear-ahci";
141c9ccf3a3SEmmanuel Vadot        reg = <0xffe08000 0x1000>;
142c9ccf3a3SEmmanuel Vadot        interrupts = <115>;
143c9ccf3a3SEmmanuel Vadot    };
144c9ccf3a3SEmmanuel Vadot  - |
145c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
146c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/berlin2q.h>
1477ef62cebSEmmanuel Vadot    #include <dt-bindings/ata/ahci.h>
1487ef62cebSEmmanuel Vadot
149c9ccf3a3SEmmanuel Vadot    sata@f7e90000 {
150c9ccf3a3SEmmanuel Vadot        compatible = "marvell,berlin2q-ahci", "generic-ahci";
151c9ccf3a3SEmmanuel Vadot        reg = <0xf7e90000 0x1000>;
152c9ccf3a3SEmmanuel Vadot        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
153c9ccf3a3SEmmanuel Vadot        clocks = <&chip CLKID_SATA>;
154c9ccf3a3SEmmanuel Vadot        #address-cells = <1>;
155c9ccf3a3SEmmanuel Vadot        #size-cells = <0>;
156c9ccf3a3SEmmanuel Vadot
1577ef62cebSEmmanuel Vadot        hba-cap = <HBA_SMPS>;
1587ef62cebSEmmanuel Vadot
159c9ccf3a3SEmmanuel Vadot        sata0: sata-port@0 {
160c9ccf3a3SEmmanuel Vadot            reg = <0>;
1617ef62cebSEmmanuel Vadot
162c9ccf3a3SEmmanuel Vadot            phys = <&sata_phy 0>;
163c9ccf3a3SEmmanuel Vadot            target-supply = <&reg_sata0>;
1647ef62cebSEmmanuel Vadot
1657ef62cebSEmmanuel Vadot            hba-port-cap = <(HBA_PORT_FBSCP | HBA_PORT_ESP)>;
166c9ccf3a3SEmmanuel Vadot        };
167c9ccf3a3SEmmanuel Vadot
168c9ccf3a3SEmmanuel Vadot        sata1: sata-port@1 {
169c9ccf3a3SEmmanuel Vadot            reg = <1>;
1707ef62cebSEmmanuel Vadot
171c9ccf3a3SEmmanuel Vadot            phys = <&sata_phy 1>;
172c9ccf3a3SEmmanuel Vadot            target-supply = <&reg_sata1>;
1737ef62cebSEmmanuel Vadot
1747ef62cebSEmmanuel Vadot            hba-port-cap = <(HBA_PORT_HPCP | HBA_PORT_MPSP | HBA_PORT_FBSCP)>;
175c9ccf3a3SEmmanuel Vadot        };
176c9ccf3a3SEmmanuel Vadot    };
177