1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (c) 2020 MediaTek Inc.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/memory-controllers/mediatek,smi-larb.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: SMI (Smart Multimedia Interface) Local Arbiter
9
10maintainers:
11  - Yong Wu <yong.wu@mediatek.com>
12
13description: |
14  The hardware block diagram please check bindings/iommu/mediatek,iommu.yaml
15
16properties:
17  compatible:
18    oneOf:
19      - enum:
20          - mediatek,mt2701-smi-larb
21          - mediatek,mt2712-smi-larb
22          - mediatek,mt6779-smi-larb
23          - mediatek,mt8167-smi-larb
24          - mediatek,mt8173-smi-larb
25          - mediatek,mt8183-smi-larb
26          - mediatek,mt8192-smi-larb
27
28      - description: for mt7623
29        items:
30          - const: mediatek,mt7623-smi-larb
31          - const: mediatek,mt2701-smi-larb
32
33  reg:
34    maxItems: 1
35
36  clocks:
37    description: |
38      apb and smi are mandatory. gals(global async local sync) is optional.
39    minItems: 2
40    items:
41      - description: apb is Advanced Peripheral Bus clock, It's the clock for
42          setting the register.
43      - description: smi is the clock for transfer data and command.
44      - description: the clock for gals.
45
46  clock-names:
47    minItems: 2
48    maxItems: 3
49
50  power-domains:
51    maxItems: 1
52
53  mediatek,smi:
54    $ref: /schemas/types.yaml#/definitions/phandle-array
55    description: a phandle to the smi_common node.
56
57  mediatek,larb-id:
58    $ref: /schemas/types.yaml#/definitions/uint32
59    minimum: 0
60    maximum: 31
61    description: the hardware id of this larb. It's only required when this
62      hardward id is not consecutive from its M4U point of view.
63
64required:
65  - compatible
66  - reg
67  - clocks
68  - clock-names
69  - power-domains
70
71allOf:
72  - if:  # HW has gals
73      properties:
74        compatible:
75          enum:
76            - mediatek,mt8183-smi-larb
77
78    then:
79      properties:
80        clock:
81          items:
82            minItems: 3
83            maxItems: 3
84        clock-names:
85          items:
86            - const: apb
87            - const: smi
88            - const: gals
89
90    else:
91      properties:
92        clock:
93          items:
94            minItems: 2
95            maxItems: 2
96        clock-names:
97          items:
98            - const: apb
99            - const: smi
100
101  - if:
102      properties:
103        compatible:
104          contains:
105            enum:
106              - mediatek,mt2701-smi-larb
107              - mediatek,mt2712-smi-larb
108              - mediatek,mt6779-smi-larb
109              - mediatek,mt8167-smi-larb
110              - mediatek,mt8192-smi-larb
111
112    then:
113      required:
114        - mediatek,larb-id
115
116additionalProperties: false
117
118examples:
119  - |+
120    #include <dt-bindings/clock/mt8173-clk.h>
121    #include <dt-bindings/power/mt8173-power.h>
122
123    larb1: larb@16010000 {
124      compatible = "mediatek,mt8173-smi-larb";
125      reg = <0x16010000 0x1000>;
126      mediatek,smi = <&smi_common>;
127      power-domains = <&scpsys MT8173_POWER_DOMAIN_VDEC>;
128      clocks = <&vdecsys CLK_VDEC_CKEN>,
129               <&vdecsys CLK_VDEC_LARB_CKEN>;
130      clock-names = "apb", "smi";
131    };
132