← Documents Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / USB

Amlogic Meson G12A DWC3 USB SoC Controller Glue

Amlogic G12A 계열 USB glue의 DWC2·DWC3 경로, SoC별 clock·PHY 조건과 host·peripheral 예제를 설명합니다.

Source pathDocumentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

amlogic,meson-g12a-usb-ctrl.yaml:1-237

Amlogic G12A 계열 USB glue의 DWC2·DWC3 경로, SoC별 clock·PHY 조건과 host·peripheral 예제를 설명합니다. 접을 수 있는 영어 원문 전체와 한국어 전문 번역을 함께 제공하며, compatible, register, clock, interrupt, PHY, endpoint, source path와 원문 줄 좌표를 원형대로 보존합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 # Copyright 2019 BayLibre, SAS
3 %YAML 1.2
4 ---
5 $id: http://devicetree.org/schemas/usb/amlogic,meson-g12a-usb-ctrl.yaml#
6 $schema: http://devicetree.org/meta-schemas/core.yaml#
7
8 title: Amlogic Meson G12A DWC3 USB SoC Controller Glue
9
10 maintainers:
11 - Neil Armstrong <[email protected]>
12
13 description: |
14 The Amlogic G12A embeds a DWC3 USB IP Core configured for USB2 and USB3
15 in host-only mode, and a DWC2 IP Core configured for USB2 peripheral mode
16 only.
17
18 A glue connects the DWC3 core to USB2 PHYs and optionally to an USB3 PHY.
19
20 One of the USB2 PHYs can be re-routed in peripheral mode to a DWC2 USB IP.
21
22 The DWC3 Glue controls the PHY routing and power, an interrupt line is
23 connected to the Glue to serve as OTG ID change detection.
24
25 The Amlogic A1 embeds a DWC3 USB IP Core configured for USB2 in
26 host-only mode.
27
28 The Amlogic GXL, GXM & AXG SoCs doesn't embed an USB3 PHY.
29
30 properties:
31 compatible:
32 enum:
33 - amlogic,meson-gxl-usb-ctrl
34 - amlogic,meson-gxm-usb-ctrl
35 - amlogic,meson-axg-usb-ctrl
36 - amlogic,meson-g12a-usb-ctrl
37 - amlogic,meson-a1-usb-ctrl
38
39 ranges: true
40
41 "#address-cells":
42 enum: [ 1, 2 ]
43
44 "#size-cells":
45 enum: [ 1, 2 ]
46
47 clocks:
48 minItems: 1
49 maxItems: 3
50
51 clock-names:
52 minItems: 1
53 maxItems: 3
54
55 resets:
56 minItems: 1
57
58 reg:
59 maxItems: 1
60
61 interrupts:
62 maxItems: 1
63
64 phy-names:
65 minItems: 1
66 maxItems: 3
67
68 phys:
69 minItems: 1
70 maxItems: 3
71
72 dr_mode: true
73
74 power-domains:
75 maxItems: 1
76
77 vbus-supply:
78 description: VBUS power supply when used in OTG switchable mode
79
80 patternProperties:
81 "^usb@[0-9a-f]+$":
82 oneOf:
83 - $ref: dwc2.yaml#
84 - $ref: snps,dwc3.yaml#
85
86 additionalProperties: false
87
88 required:
89 - compatible
90 - "#address-cells"
91 - "#size-cells"
92 - ranges
93 - clocks
94 - resets
95 - reg
96 - interrupts
97 - phy-names
98 - phys
99 - dr_mode
100
101 allOf:
102 - if:
103 properties:
104 compatible:
105 enum:
106 - amlogic,meson-g12a-usb-ctrl
107
108 then:
109 properties:
110 phy-names:
111 minItems: 2
112 items:
113 - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
114 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
115 - const: usb3-phy0 # USB3 PHY if USB3_0 is used
116 - if:
117 properties:
118 compatible:
119 enum:
120 - amlogic,meson-gxl-usb-ctrl
121
122 then:
123 properties:
124 clocks:
125 minItems: 2
126 clock-names:
127 items:
128 - const: usb_ctrl
129 - const: ddr
130 phy-names:
131 items:
132 - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
133 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
134 required:
135 - clock-names
136 - if:
137 properties:
138 compatible:
139 enum:
140 - amlogic,meson-gxm-usb-ctrl
141
142 then:
143 properties:
144 clocks:
145 minItems: 2
146 clock-names:
147 items:
148 - const: usb_ctrl
149 - const: ddr
150 phy-names:
151 items:
152 - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
153 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
154 - const: usb2-phy2 # USB2 PHY2 if USBOTG_C port is used
155
156 required:
157 - clock-names
158 - if:
159 properties:
160 compatible:
161 enum:
162 - amlogic,meson-axg-usb-ctrl
163
164 then:
165 properties:
166 phy-names:
167 items:
168 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
169 clocks:
170 minItems: 2
171 clock-names:
172 items:
173 - const: usb_ctrl
174 - const: ddr
175 required:
176 - clock-names
177 - if:
178 properties:
179 compatible:
180 enum:
181 - amlogic,meson-a1-usb-ctrl
182
183 then:
184 properties:
185 phy-names:
186 items:
187 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
188 clocks:
189 minItems: 3
190 clock-names:
191 items:
192 - const: usb_ctrl
193 - const: usb_bus
194 - const: xtal_usb_ctrl
195 required:
196 - clock-names
197
198 examples:
199 - |
200 usb: usb@ffe09000 {
201 compatible = "amlogic,meson-g12a-usb-ctrl";
202 reg = <0xffe09000 0xa0>;
203 interrupts = <16>;
204 #address-cells = <1>;
205 #size-cells = <1>;
206 ranges;
207
208 clocks = <&clkc_usb>;
209 resets = <&reset_usb>;
210
211 dr_mode = "otg";
212
213 phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
214 phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
215
216 dwc2: usb@ff400000 {
217 compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
218 reg = <0xff400000 0x40000>;
219 interrupts = <31>;
220 clocks = <&clkc_usb1>;
221 clock-names = "otg";
222 phys = <&usb2_phy1>;
223 dr_mode = "peripheral";
224 g-rx-fifo-size = <192>;
225 g-np-tx-fifo-size = <128>;
226 g-tx-fifo-size = <128 128 16 16 16>;
227 };
228
229 dwc3: usb@ff500000 {
230 compatible = "snps,dwc3";
231 reg = <0xff500000 0x100000>;
232 interrupts = <30>;
233 dr_mode = "host";
234 snps,dis_u2_susphy_quirk;
235 snps,quirk-frame-length-adjustment = <0x20>;
236 };
237 };
238

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Amlogic Meson USB controller glue

1-29

GPL-2.0 또는 BSD-2-Clause 라이선스의 이 schema는 Amlogic Meson G12A DWC3 USB SoC controller glue를 정의합니다. Copyright는 2019 BayLibre, SAS이고 관리자는 Neil Armstrong입니다.

G12A에는 USB2와 USB3의 host-only mode로 구성한 DWC3 IP core와 USB2 peripheral-only mode로 구성한 DWC2 IP core가 들어갑니다. Glue는 DWC3 core를 USB2 PHY들과 선택적인 USB3 PHY에 연결하며, USB2 PHY 하나를 peripheral mode에서 DWC2 IP로 다시 경로 설정할 수 있습니다.

DWC3 glue는 PHY 경로와 전원을 제어하고 OTG ID 변경을 감지하는 interrupt line을 받습니다. A1은 USB2 host-only mode의 DWC3 core를 포함합니다. GXL, GXM, AXG SoC에는 USB3 PHY가 없습니다.

공통 resource와 PHY

30-79

지원 `compatible`은 `amlogic,meson-gxl-usb-ctrl`, `amlogic,meson-gxm-usb-ctrl`, `amlogic,meson-axg-usb-ctrl`, `amlogic,meson-g12a-usb-ctrl`, `amlogic,meson-a1-usb-ctrl`입니다. `ranges`를 사용하며 `#address-cells`와 `#size-cells`는 각각 1 또는 2입니다.

Clock은 1~3개이고 `clock-names`도 1~3개입니다. Reset은 최소 1개, `reg`와 `interrupts`는 각각 최대 1개입니다. `phys`와 `phy-names`는 각각 1~3개이며 `dr_mode`를 지원합니다. `power-domains`는 최대 한 항목이고 `vbus-supply`는 OTG 전환 가능 mode에서 쓰는 VBUS 전원입니다.

properties:
  compatible:
    enum:
      - amlogic,meson-gxl-usb-ctrl
      - amlogic,meson-gxm-usb-ctrl
      - amlogic,meson-axg-usb-ctrl
      - amlogic,meson-g12a-usb-ctrl
      - amlogic,meson-a1-usb-ctrl

  ranges: true

  "#address-cells":
    enum: [ 1, 2 ]

  "#size-cells":
    enum: [ 1, 2 ]

  clocks:
    minItems: 1
    maxItems: 3

  clock-names:
    minItems: 1
    maxItems: 3

  resets:
    minItems: 1

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  phy-names:
    minItems: 1
    maxItems: 3

  phys:
    minItems: 1
    maxItems: 3

  dr_mode: true

  power-domains:
    maxItems: 1

  vbus-supply:
    description: VBUS power supply when used in OTG switchable mode

DWC2·DWC3 child와 필수 속성

80-100

이름이 `usb@[0-9a-f]+` pattern과 일치하는 child node는 `dwc2.yaml` 또는 `snps,dwc3.yaml` 중 하나를 따라야 합니다. 정의되지 않은 추가 속성은 허용하지 않습니다.

필수 속성은 `compatible`, `#address-cells`, `#size-cells`, `ranges`, `clocks`, `resets`, `reg`, `interrupts`, `phy-names`, `phys`, `dr_mode`입니다.

patternProperties:
  "^usb@[0-9a-f]+$":
    oneOf:
      - $ref: dwc2.yaml#
      - $ref: snps,dwc3.yaml#

additionalProperties: false

required:
  - compatible
  - "#address-cells"
  - "#size-cells"
  - ranges
  - clocks
  - resets
  - reg
  - interrupts
  - phy-names
  - phys
  - dr_mode

G12A PHY 이름

101-116

G12A compatible에서는 PHY가 최소 2개입니다. 순서대로 USBHOST_A port용 `usb2-phy0`, USBOTG_B port용 `usb2-phy1`을 두고, USB3_0을 사용하면 세 번째 `usb3-phy0`을 둡니다.

allOf:
  - if:
      properties:
        compatible:
          enum:
            - amlogic,meson-g12a-usb-ctrl

    then:
      properties:
        phy-names:
          minItems: 2
          items:
            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
            - const: usb3-phy0 # USB3 PHY if USB3_0 is used
  - if:

GXL clock과 PHY

117-136

GXL compatible에서는 clock이 최소 2개이며 이름은 `usb_ctrl`, `ddr` 순서입니다. PHY 이름은 USBHOST_A용 `usb2-phy0`, USBOTG_B용 `usb2-phy1` 순서이고 `clock-names`가 필수입니다.

    properties:
      compatible:
        enum:
          - amlogic,meson-gxl-usb-ctrl

  then:
    properties:
      clocks:
        minItems: 2
      clock-names:
        items:
          - const: usb_ctrl
          - const: ddr
      phy-names:
        items:
          - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
          - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
    required:
      - clock-names
- if:

GXM clock과 세 USB2 PHY

137-158

GXM compatible에서도 clock은 최소 2개이고 이름은 `usb_ctrl`, `ddr`입니다. PHY 이름은 USBHOST_A의 `usb2-phy0`, USBOTG_B의 `usb2-phy1`, USBOTG_C의 `usb2-phy2` 순서이며 `clock-names`가 필수입니다.

    properties:
      compatible:
        enum:
          - amlogic,meson-gxm-usb-ctrl

  then:
    properties:
      clocks:
        minItems: 2
      clock-names:
        items:
          - const: usb_ctrl
          - const: ddr
      phy-names:
        items:
          - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
          - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
          - const: usb2-phy2 # USB2 PHY2 if USBOTG_C port is used

    required:
      - clock-names
- if:

AXG clock과 PHY

159-177

AXG compatible의 PHY 이름은 USBOTG_B용 `usb2-phy1` 하나입니다. Clock은 최소 2개이고 이름은 `usb_ctrl`, `ddr` 순서이며 `clock-names`가 필수입니다.

    properties:
      compatible:
        enum:
          - amlogic,meson-axg-usb-ctrl

  then:
    properties:
      phy-names:
        items:
          - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
      clocks:
        minItems: 2
      clock-names:
        items:
          - const: usb_ctrl
          - const: ddr
    required:
      - clock-names
- if:

A1의 세 clock

178-197

A1 compatible의 PHY 이름은 USBOTG_B용 `usb2-phy1`입니다. Clock은 최소 3개이고 이름은 `usb_ctrl`, `usb_bus`, `xtal_usb_ctrl` 순서이며 `clock-names`가 필수입니다.

  properties:
    compatible:
      enum:
        - amlogic,meson-a1-usb-ctrl

then:
  properties:
    phy-names:
      items:
        - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
    clocks:
      minItems: 3
    clock-names:
      items:
        - const: usb_ctrl
        - const: usb_bus
        - const: xtal_usb_ctrl
  required:
    - clock-names

G12A glue 예제

198-215

예제 `usb: usb@ffe09000` wrapper는 G12A compatible, 0xa0-byte register 영역, interrupt 16, 한 개의 address/size cell과 빈 `ranges`를 사용합니다. `clkc_usb` clock과 `reset_usb` reset을 연결하고 mode는 `otg`입니다.

PHY는 `usb2_phy0`, `usb2_phy1`, `usb3_phy0`을 순서대로 연결하며 이름도 `usb2-phy0`, `usb2-phy1`, `usb3-phy0` 순서입니다.

examples:
  - |
    usb: usb@ffe09000 {
          compatible = "amlogic,meson-g12a-usb-ctrl";
          reg = <0xffe09000 0xa0>;
          interrupts = <16>;
          #address-cells = <1>;
          #size-cells = <1>;
          ranges;

          clocks = <&clkc_usb>;
          resets = <&reset_usb>;

          dr_mode = "otg";

          phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
          phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";

DWC2 peripheral과 DWC3 host child

216-237

DWC2 child `usb@ff400000`은 Amlogic G12A USB와 Synopsys DWC2 compatible을 함께 사용하고 0x40000-byte 영역, interrupt 31, `otg` 이름의 `clkc_usb1` clock, 두 번째 USB2 PHY를 연결합니다. Mode는 `peripheral`이며 RX FIFO 192, non-periodic TX FIFO 128, TX FIFO 배열 128·128·16·16·16을 지정합니다.

DWC3 child `usb@ff500000`은 Synopsys DWC3 compatible, 0x100000-byte 영역, interrupt 30, `host` mode를 사용합니다. USB2 suspend PHY quirk를 끄고 frame length 조정값을 0x20으로 지정합니다.

      dwc2: usb@ff400000 {
          compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
          reg = <0xff400000 0x40000>;
          interrupts = <31>;
          clocks = <&clkc_usb1>;
          clock-names = "otg";
          phys = <&usb2_phy1>;
          dr_mode = "peripheral";
          g-rx-fifo-size = <192>;
          g-np-tx-fifo-size = <128>;
          g-tx-fifo-size = <128 128 16 16 16>;
      };

      dwc3: usb@ff500000 {
          compatible = "snps,dwc3";
          reg = <0xff500000 0x100000>;
          interrupts = <30>;
          dr_mode = "host";
          snps,dis_u2_susphy_quirk;
          snps,quirk-frame-length-adjustment = <0x20>;
      };
};