요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/usb-device.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Generic USB Device
maintainers:
- Greg Kroah-Hartman <[email protected]>
description: |
Usually, we only use device tree for hard wired USB device.
The reference binding doc is from:
http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
Four types of device-tree nodes are defined: "host-controller nodes"
representing USB host controllers, "device nodes" representing USB devices,
"interface nodes" representing USB interfaces and "combined nodes"
representing simple USB devices.
A combined node shall be used instead of a device node and an interface node
for devices of class 0 or 9 (hub) with a single configuration and a single
interface.
A "hub node" is a combined node or an interface node that represents a USB
hub.
properties:
compatible:
contains:
pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$"
description: Device nodes or combined nodes.
"usbVID,PID", where VID is the vendor id and PID the product id.
The textual representation of VID and PID shall be in lower case
hexadecimal with leading zeroes suppressed. The other compatible
strings from the above standard binding could also be used,
but a device adhering to this binding may leave out all except
for "usbVID,PID".
reg:
description: the number of the USB hub port or the USB host-controller
port to which this device is attached.
items:
- minimum: 1
maximum: 255
"#address-cells":
description: should be 1 for hub nodes with device nodes,
should be 2 for device nodes with interface nodes.
enum: [1, 2]
"#size-cells":
const: 0
patternProperties:
"^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$":
type: object
description: USB interface nodes.
The configuration component is not included in the textual
representation of an interface-node unit address for configuration 1.
properties:
compatible:
pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$"
description: Interface nodes.
"usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
the product id, CN is the configuration value and IN is the interface
number. The textual representation of VID, PID, CN and IN shall be
in lower case hexadecimal with leading zeroes suppressed.
The other compatible strings from the above standard binding could
also be used, but a device adhering to this binding may leave out
all except for "usbifVID,PID.configCN.IN".
reg:
description: should be 2 cells long, the first cell represents
the interface number and the second cell represents the
configuration value.
maxItems: 1
required:
- reg
additionalProperties: true
examples:
# hub connected to port 1
# device connected to port 2
# device connected to port 3
# interface 0 of configuration 1
# interface 0 of configuration 2
- |
usb@11270000 {
reg = <0x11270000 0x1000>;
interrupts = <0x0 0x4e 0x0>;
#address-cells = <1>;
#size-cells = <0>;
hub@1 {
compatible = "usb5e3,608";
reg = <1>;
};
device@2 {
compatible = "usb123,4567";
reg = <2>;
};
device@3 {
compatible = "usb123,abcd";
reg = <3>;
#address-cells = <2>;
#size-cells = <0>;
interface@0 {
compatible = "usbif123,abcd.config1.0";
reg = <0 1>;
};
interface@0,2 {
compatible = "usbif123,abcd.config2.0";
reg = <0 2>;
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Generic USB device node 모델
1-28GPL-2.0-only 또는 BSD-2-Clause로 배포되는 이 스키마는 일반 USB device를 정의합니다. device tree는 보통 board에 고정 배선된 USB device에만 사용하며 기준 문서는 Open Firmware USB 1.0 binding입니다. 관리자는 Greg Kroah-Hartman입니다.
node 유형은 USB host controller를 나타내는 host-controller node, USB device를 나타내는 device node, USB interface를 나타내는 interface node, 단순 USB device를 나타내는 combined node의 네 가지입니다.
class 0 또는 class 9(hub) device가 configuration 하나와 interface 하나만 가지면 device node와 interface node 대신 combined node를 사용해야 합니다. hub node는 USB hub를 나타내는 combined node 또는 interface node입니다.
VID·PID compatible과 port 주소
29-55device node 또는 combined node의 compatible에는 `usbVID,PID` 형식이 포함됩니다. VID는 vendor ID, PID는 product ID이며 소문자 16진수로 쓰고 선행 0은 생략합니다. 표준의 다른 compatible도 함께 사용할 수 있지만 이 형식 하나만 남겨도 됩니다.
`reg`는 device가 연결된 USB hub port 또는 host-controller port 번호이며 범위는 1~255입니다. device child가 있는 hub node는 `#address-cells = <1>`, interface child가 있는 device node는 `<2>`를 사용하고 `#size-cells`는 0입니다.
properties:
compatible:
contains:
pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$"
description: Device nodes or combined nodes.
"usbVID,PID", where VID is the vendor id and PID the product id.
The textual representation of VID and PID shall be in lower case
hexadecimal with leading zeroes suppressed. The other compatible
strings from the above standard binding could also be used,
but a device adhering to this binding may leave out all except
for "usbVID,PID".
reg:
description: the number of the USB hub port or the USB host-controller
port to which this device is attached.
items:
- minimum: 1
maximum: 255
"#address-cells":
description: should be 1 for hub nodes with device nodes,
should be 2 for device nodes with interface nodes.
enum: [1, 2]
"#size-cells":
const: 0
USB interface node 표기
56-80interface node의 unit address는 interface number와 필요하면 configuration component를 소문자 16진수로 나타냅니다. configuration 1에서는 textual unit address에서 configuration component를 생략합니다.
interface compatible은 `usbifVID,PID.configCN.IN` 형식입니다. VID·PID는 vendor·product ID, CN은 configuration value, IN은 interface number이며 모두 소문자 16진수로 쓰고 선행 0은 생략합니다. `reg`는 두 cell로, 첫 cell이 interface number이고 둘째가 configuration value입니다.
patternProperties:
"^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$":
type: object
description: USB interface nodes.
The configuration component is not included in the textual
representation of an interface-node unit address for configuration 1.
properties:
compatible:
pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$"
description: Interface nodes.
"usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
the product id, CN is the configuration value and IN is the interface
number. The textual representation of VID, PID, CN and IN shall be
in lower case hexadecimal with leading zeroes suppressed.
The other compatible strings from the above standard binding could
also be used, but a device adhering to this binding may leave out
all except for "usbifVID,PID.configCN.IN".
reg:
description: should be 2 cells long, the first cell represents
the interface number and the second cell represents the
configuration value.
maxItems: 1
필수 port 번호와 확장
81-85`reg`가 필수입니다. device별 속성을 수용할 수 있도록 추가 속성은 허용합니다.
required:
- reg
additionalProperties: true
hub, device와 두 configuration 예제
86-126예제 host controller의 port 1에는 VID 0x05e3·PID 0x0608 hub, port 2에는 단순 device가 연결됩니다. port 3의 device는 interface child를 위해 두 개의 address cell을 사용합니다.
configuration 1의 interface 0은 unit address `interface@0`과 `reg = <0 1>`을 사용합니다. configuration 2의 interface 0은 `interface@0,2`, compatible `usbif123,abcd.config2.0`, `reg = <0 2>`로 구분합니다.
examples:
# hub connected to port 1
# device connected to port 2
# device connected to port 3
# interface 0 of configuration 1
# interface 0 of configuration 2
- |
usb@11270000 {
reg = <0x11270000 0x1000>;
interrupts = <0x0 0x4e 0x0>;
#address-cells = <1>;
#size-cells = <0>;
hub@1 {
compatible = "usb5e3,608";
reg = <1>;
};
device@2 {
compatible = "usb123,4567";
reg = <2>;
};
device@3 {
compatible = "usb123,abcd";
reg = <3>;
#address-cells = <2>;
#size-cells = <0>;
interface@0 {
compatible = "usbif123,abcd.config1.0";
reg = <0 1>;
};
interface@0,2 {
compatible = "usbif123,abcd.config2.0";
reg = <0 2>;
};
};
};
요약과 해설
usb-device.yaml:1-126USB device·interface·combined·hub node와 VID/PID·port 주소 규칙을 설명합니다. 접을 수 있는 영어 원문 전체와 한국어 전문 번역을 함께 제공하며, compatible, register, interrupt, regulator, USB ID, graph 구조, source path와 원문 줄 좌표를 원형대로 보존합니다.