요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/spi/sprd,spi-adi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Spreadtrum ADI controller
maintainers:
- Orson Zhai <[email protected]>
- Baolin Wang <[email protected]>
- Chunyan Zhang <[email protected]>
description: |
ADI is the abbreviation of Anolog-Digital interface, which is used to access
analog chip (such as PMIC) from digital chip. ADI controller follows the SPI
framework for its hardware implementation is alike to SPI bus and its timing
is compatile to SPI timing.
ADI controller has 50 channels including 2 software read/write channels and
48 hardware channels to access analog chip. For 2 software read/write channels,
users should set ADI registers to access analog chip. For hardware channels,
we can configure them to allow other hardware components to use it independently,
which means we can just link one analog chip address to one hardware channel,
then users can access the mapped analog chip address by this hardware channel
triggered by hardware components instead of ADI software channels.
Thus we introduce one property named "sprd,hw-channels" to configure hardware
channels, the first value specifies the hardware channel id which is used to
transfer data triggered by hardware automatically, and the second value specifies
the analog chip address where user want to access by hardware components.
Since we have multi-subsystems will use unique ADI to access analog chip, when
one system is reading/writing data by ADI software channels, that should be under
one hardware spinlock protection to prevent other systems from reading/writing
data by ADI software channels at the same time, or two parallel routine of setting
ADI registers will make ADI controller registers chaos to lead incorrect results.
Then we need one hardware spinlock to synchronize between the multiple subsystems.
The new version ADI controller supplies multiple master channels for different
subsystem accessing, that means no need to add hardware spinlock to synchronize,
thus change the hardware spinlock support to be optional to keep backward
compatibility.
allOf:
- $ref: /schemas/spi/spi-controller.yaml#
properties:
compatible:
enum:
- sprd,sc9860-adi
- sprd,sc9863-adi
- sprd,ums512-adi
reg:
maxItems: 1
hwlocks:
maxItems: 1
hwlock-names:
const: adi
sprd,hw-channels:
$ref: /schemas/types.yaml#/definitions/uint32-matrix
description: A list of hardware channels
minItems: 1
maxItems: 48
items:
items:
- description: The hardware channel id which is used to transfer data
triggered by hardware automatically, channel id 0-1 are for software
use, 2-49 are hardware channels.
minimum: 2
maximum: 49
- description: The analog chip address where user want to access by
hardware components.
required:
- compatible
- reg
- '#address-cells'
- '#size-cells'
unevaluatedProperties: false
examples:
- |
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>;
};
};
...
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-31ADI 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>;
};
};
...
요약과 해설
sprd,spi-adi.yaml:1-103Spreadtrum ADI의 software·hardware channel, 주소 mapping과 subsystem 동기화를 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·symbol·source path·수치·예제 코드를 원형대로 유지합니다.