← Documents Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / SPI

Spreadtrum ADI controller

Spreadtrum ADI의 software·hardware channel, 주소 mapping과 subsystem 동기화를 설명합니다.

Source pathDocumentation/devicetree/bindings/spi/sprd,spi-adi.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

sprd,spi-adi.yaml:1-103

Spreadtrum ADI의 software·hardware channel, 주소 mapping과 subsystem 동기화를 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·symbol·source path·수치·예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/spi/sprd,spi-adi.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Spreadtrum ADI controller
8
9 maintainers:
10 - Orson Zhai <[email protected]>
11 - Baolin Wang <[email protected]>
12 - Chunyan Zhang <[email protected]>
13
14 description: |
15 ADI is the abbreviation of Anolog-Digital interface, which is used to access
16 analog chip (such as PMIC) from digital chip. ADI controller follows the SPI
17 framework for its hardware implementation is alike to SPI bus and its timing
18 is compatile to SPI timing.
19
20 ADI controller has 50 channels including 2 software read/write channels and
21 48 hardware channels to access analog chip. For 2 software read/write channels,
22 users should set ADI registers to access analog chip. For hardware channels,
23 we can configure them to allow other hardware components to use it independently,
24 which means we can just link one analog chip address to one hardware channel,
25 then users can access the mapped analog chip address by this hardware channel
26 triggered by hardware components instead of ADI software channels.
27
28 Thus we introduce one property named "sprd,hw-channels" to configure hardware
29 channels, the first value specifies the hardware channel id which is used to
30 transfer data triggered by hardware automatically, and the second value specifies
31 the analog chip address where user want to access by hardware components.
32
33 Since we have multi-subsystems will use unique ADI to access analog chip, when
34 one system is reading/writing data by ADI software channels, that should be under
35 one hardware spinlock protection to prevent other systems from reading/writing
36 data by ADI software channels at the same time, or two parallel routine of setting
37 ADI registers will make ADI controller registers chaos to lead incorrect results.
38 Then we need one hardware spinlock to synchronize between the multiple subsystems.
39
40 The new version ADI controller supplies multiple master channels for different
41 subsystem accessing, that means no need to add hardware spinlock to synchronize,
42 thus change the hardware spinlock support to be optional to keep backward
43 compatibility.
44
45 allOf:
46 - $ref: /schemas/spi/spi-controller.yaml#
47
48 properties:
49 compatible:
50 enum:
51 - sprd,sc9860-adi
52 - sprd,sc9863-adi
53 - sprd,ums512-adi
54
55 reg:
56 maxItems: 1
57
58 hwlocks:
59 maxItems: 1
60
61 hwlock-names:
62 const: adi
63
64 sprd,hw-channels:
65 $ref: /schemas/types.yaml#/definitions/uint32-matrix
66 description: A list of hardware channels
67 minItems: 1
68 maxItems: 48
69 items:
70 items:
71 - description: The hardware channel id which is used to transfer data
72 triggered by hardware automatically, channel id 0-1 are for software
73 use, 2-49 are hardware channels.
74 minimum: 2
75 maximum: 49
76 - description: The analog chip address where user want to access by
77 hardware components.
78
79 required:
80 - compatible
81 - reg
82 - '#address-cells'
83 - '#size-cells'
84
85 unevaluatedProperties: false
86
87 examples:
88 - |
89 aon {
90 #address-cells = <2>;
91 #size-cells = <2>;
92
93 adi_bus: spi@40030000 {
94 compatible = "sprd,sc9860-adi";
95 reg = <0 0x40030000 0 0x10000>;
96 hwlocks = <&hwlock1 0>;
97 hwlock-names = "adi";
98 #address-cells = <1>;
99 #size-cells = <0>;
100 sprd,hw-channels = <30 0x8c20>;
101 };
102 };
103 ...
104

3. 한국어 전문 번역

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

Spreadtrum ADI controller schema

1-13

이 GPL-2.0 또는 BSD-2-Clause YAML schema는 Spreadtrum ADI controller를 정의합니다. Maintainer는 Orson Zhai, Baolin Wang, Chunyan Zhang입니다.

Analog chip 접근과 SPI framework

14-18

원문은 ADI를 `Anolog-Digital interface`의 약어로 표기합니다. Digital chip에서 PMIC 같은 analog chip에 접근하는 interface이며, hardware 구현이 SPI bus와 유사하고 timing이 SPI timing과 호환되므로 SPI framework를 따릅니다.

Software·hardware channel과 주소 mapping

19-31

ADI controller에는 software read/write channel 2개와 hardware channel 48개, 총 50개 channel이 있습니다. Software channel은 사용자가 ADI register를 설정해 analog chip에 접근합니다.

Hardware channel은 다른 hardware component가 독립적으로 사용하도록 구성할 수 있습니다. Analog chip address 하나를 hardware channel 하나에 연결하면 ADI software channel 대신 hardware component가 trigger한 channel로 mapping 주소에 접근합니다.

`sprd,hw-channels`의 각 pair에서 첫 값은 hardware가 자동으로 trigger해 data를 전송할 channel ID이고 둘째 값은 hardware component가 접근할 analog chip address입니다.

Subsystem 간 hardware spinlock

32-43

여러 subsystem이 하나의 ADI로 analog chip에 접근하므로, 한 system이 software channel로 read/write하는 동안 다른 system의 동시 접근을 막아야 합니다. 병렬 routine 두 개가 ADI register를 설정하면 controller register 상태가 뒤섞여 잘못된 결과가 생길 수 있어 hardware spinlock으로 subsystem 사이를 동기화합니다.

새 ADI controller는 subsystem별 multiple master channel을 제공해 hardware spinlock이 필요하지 않습니다. 따라서 backward compatibility를 유지하면서 hardware spinlock 지원을 선택 사항으로 바꿨습니다.

Compatible, hwlock과 hardware channel matrix

44-78

공통 `/schemas/spi/spi-controller.yaml#`을 상속합니다. Compatible은 `sprd,sc9860-adi`, `sprd,sc9863-adi`, `sprd,ums512-adi` 중 하나이고 `reg`와 `hwlocks`는 각각 최대 한 항목입니다. `hwlock-names`는 `adi`로 고정됩니다.

`sprd,hw-channels`는 1~48개 항목의 `uint32-matrix`입니다. 각 항목의 첫 값은 channel ID로, 0~1은 software용이고 hardware channel은 2~49 범위입니다. 둘째 값은 hardware component가 접근할 analog chip address입니다.

필수 bus cell과 추가 속성 제한

79-86

필수 속성은 `compatible`, `reg`, `#address-cells`, `#size-cells`입니다. `unevaluatedProperties: false`로 평가되지 않은 추가 속성을 금지합니다.

SC9860 ADI hardware channel 30 예제

87-103

예제의 `adi_bus: spi@40030000`은 `sprd,sc9860-adi`, hardware lock 0과 이름 `adi`를 사용합니다. `sprd,hw-channels = <30 0x8c20>`은 hardware channel 30을 analog chip address 0x8c20에 mapping합니다.

    aon {
        #address-cells = <2>;
        #size-cells = <2>;

        adi_bus: spi@40030000 {
            compatible = "sprd,sc9860-adi";
            reg = <0 0x40030000 0 0x10000>;
            hwlocks = <&hwlock1 0>;
            hwlock-names = "adi";
            #address-cells = <1>;
            #size-cells = <0>;
            sprd,hw-channels = <30 0x8c20>;
        };
    };
...