1# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/nvme/apple,nvme-ans.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Apple ANS NVM Express host controller
8
9maintainers:
10  - Sven Peter <sven@svenpeter.dev>
11
12properties:
13  compatible:
14    items:
15      - enum:
16          - apple,t8103-nvme-ans2
17          - apple,t6000-nvme-ans2
18      - const: apple,nvme-ans2
19
20  reg:
21    items:
22      - description: NVMe and NVMMU registers
23      - description: ANS2 co-processor control registers
24
25  reg-names:
26    items:
27      - const: nvme
28      - const: ans
29
30  resets:
31    maxItems: 1
32
33  power-domains:
34    # two domains for t8103, three for t6000
35    minItems: 2
36    items:
37      - description: power domain for the NVMe controller.
38      - description: power domain for the first PCIe bus connecting the NVMe
39          controller to the storage modules.
40      - description: optional power domain for the second PCIe bus
41          connecting the NVMe controller to the storage modules.
42
43  power-domain-names:
44    minItems: 2
45    items:
46      - const: ans
47      - const: apcie0
48      - const: apcie1
49
50  mboxes:
51    maxItems: 1
52    description: Mailbox of the ANS2 co-processor
53
54  interrupts:
55    maxItems: 1
56
57  apple,sart:
58    maxItems: 1
59    $ref: /schemas/types.yaml#/definitions/phandle
60    description: |
61      Reference to the SART address filter.
62
63      The SART address filter is documented in iommu/apple,sart.yaml.
64
65if:
66  properties:
67    compatible:
68      contains:
69        const: apple,t8103-nvme-ans2
70then:
71  properties:
72    power-domains:
73      maxItems: 2
74    power-domain-names:
75      maxItems: 2
76else:
77  properties:
78    power-domains:
79      minItems: 3
80    power-domain-names:
81      minItems: 3
82
83required:
84  - compatible
85  - reg
86  - reg-names
87  - resets
88  - power-domains
89  - power-domain-names
90  - mboxes
91  - interrupts
92  - apple,sart
93
94additionalProperties: false
95
96examples:
97  - |
98    #include <dt-bindings/interrupt-controller/apple-aic.h>
99    #include <dt-bindings/interrupt-controller/irq.h>
100
101    nvme@7bcc0000 {
102      compatible = "apple,t8103-nvme-ans2", "apple,nvme-ans2";
103      reg = <0x7bcc0000 0x40000>, <0x77400000 0x4000>;
104      reg-names = "nvme", "ans";
105      interrupts = <AIC_IRQ 590 IRQ_TYPE_LEVEL_HIGH>;
106      mboxes = <&ans>;
107      apple,sart = <&sart>;
108      power-domains = <&ps_ans2>, <&ps_apcie_st>;
109      power-domain-names = "ans", "apcie0";
110      resets = <&ps_ans2>;
111    };
112