요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Spreadtrum Pin Controller
The Spreadtrum pin controller are organized in 3 blocks (types).
The first block comprises some global control registers, and each
register contains several bit fields with one bit or several bits
to configure for some global common configuration, such as domain
pad driving level, system control select and so on ("domain pad
driving level": One pin can output 3.0v or 1.8v, depending on the
related domain pad driving selection, if the related domain pad
select 3.0v, then the pin can output 3.0v. "system control" is used
to choose one function (like: UART0) for which system, since we
have several systems (AP/CP/CM4) on one SoC.).
There are too much various configuration that we can not list all
of them, so we can not make every Spreadtrum-special configuration
as one generic configuration, and maybe it will add more strange
global configuration in future. Then we add one "sprd,control" to
set these various global control configuration, and we need use
magic number for this property.
Moreover we recognise every fields comprising one bit or several
bits in one global control register as one pin, thus we should
record every pin's bit offset, bit width and register offset to
configure this field (pin).
The second block comprises some common registers which have unified
register definition, and each register described one pin is used
to configure the pin sleep mode, function select and sleep related
configuration.
Now we have 4 systems for sleep mode on SC9860 SoC: AP system,
PUBCP system, TGLDSP system and AGDSP system. And the pin sleep
related configuration are:
- input-enable
- input-disable
- output-high
- output-low
- bias-pull-up
- bias-pull-down
In some situation we need set the pin sleep mode and pin sleep related
configuration, to set the pin sleep related configuration automatically
by hardware when the system specified by sleep mode goes into deep
sleep mode. For example, if we set the pin sleep mode as PUBCP_SLEEP
and set the pin sleep related configuration as "input-enable", which
means when PUBCP system goes into deep sleep mode, this pin will be set
input enable automatically.
Moreover we can not use the "sleep" state, since some systems (like:
PUBCP system) do not run linux kernel OS (only AP system run linux
kernel on SC9860 platform), then we can not select "sleep" state
when the PUBCP system goes into deep sleep mode. Thus we introduce
"sprd,sleep-mode" property to set pin sleep mode.
The last block comprises some misc registers which also have unified
register definition, and each register described one pin is used to
configure drive strength, pull up/down and so on. Especially for pull
up, we have two kind pull up resistor: 20K and 4.7K.
Required properties for Spreadtrum pin controller:
- compatible: "sprd,<soc>-pinctrl"
Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported SoCs.
- reg: The register address of pin controller device.
- pins : An array of pin names.
Optional properties:
- function: Specified the function name.
- drive-strength: Drive strength in mA.
- input-schmitt-disable: Enable schmitt-trigger mode.
- input-schmitt-enable: Disable schmitt-trigger mode.
- bias-disable: Disable pin bias.
- bias-pull-down: Pull down on pin.
- bias-pull-up: Pull up on pin.
- input-enable: Enable pin input.
- input-disable: Enable pin output.
- output-high: Set the pin as an output level high.
- output-low: Set the pin as an output level low.
- sleep-hardware-state: Indicate these configs in this state are sleep related.
- sprd,control: Control values referring to databook for global control pins.
- sprd,sleep-mode: Sleep mode selection.
Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported values.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
첫 번째 block: global control register
1-26Spreadtrum pin controller는 세 종류의 block으로 구성됩니다. 첫 번째 block은 global control register들로 이루어지고, register마다 1bit 또는 여러 bit의 field가 있어 domain pad driving level, system control 선택 같은 전역 공통 구성을 설정합니다.
Domain pad driving level은 관련 domain pad 선택에 따라 한 pin이 3.0V 또는 1.8V를 출력하게 합니다. 예를 들어 domain pad가 3.0V를 선택하면 pin도 3.0V를 출력할 수 있습니다. System control은 하나의 SoC에 `AP/CP/CM4` 같은 여러 system이 있을 때 UART0 같은 function을 어느 system이 사용할지 고릅니다.
구성 종류가 너무 많아 모두 열거할 수 없고 Spreadtrum 전용 설정마다 generic configuration 하나를 만들 수도 없으며, 향후 더 특수한 global configuration이 추가될 수 있습니다. 그래서 `sprd,control` 하나로 여러 global control 구성을 설정하며 이 property에는 magic number를 사용해야 합니다.
또한 하나의 global control register에서 1bit 또는 여러 bit로 이루어진 각 field를 pin 하나로 간주합니다. 따라서 이 field, 즉 pin을 구성하려면 각 pin의 bit offset, bit width, register offset을 기록해야 합니다.
두 번째 block: common register와 sleep
27-55두 번째 block은 통일된 register 정의를 가진 common register들입니다. 각 register는 pin 하나를 나타내며 pin sleep mode, function 선택, sleep 관련 구성을 설정합니다.
SC9860 SoC의 sleep mode 대상 system은 AP, PUBCP, TGLDSP, AGDSP 네 개입니다. Pin의 sleep 관련 구성은 다음과 같습니다.
| Property | Sleep 동작 |
|---|---|
| input-enable | Sleep 때 pin input을 활성화 |
| input-disable | Sleep 때 pin input을 비활성화 |
| output-high | Sleep 때 output을 high로 설정 |
| output-low | Sleep 때 output을 low로 설정 |
| bias-pull-up | Sleep 때 pull-up을 설정 |
| bias-pull-down | Sleep 때 pull-down을 설정 |
어떤 상황에서는 pin sleep mode와 sleep 관련 구성을 함께 지정하여, sleep mode로 지정한 system이 deep sleep에 들어갈 때 hardware가 해당 구성을 자동 적용하게 해야 합니다. 예를 들어 `PUBCP_SLEEP`과 `input-enable`을 설정하면 PUBCP system이 deep sleep에 진입할 때 이 pin의 input이 자동으로 활성화됩니다.
PUBCP처럼 Linux kernel을 실행하지 않는 system도 있고 SC9860에서는 AP만 Linux를 실행하므로, PUBCP가 deep sleep에 들어갈 때 Linux의 `sleep` state를 선택할 수 없습니다. 이 때문에 pin sleep mode를 지정하는 `sprd,sleep-mode` property를 도입했습니다.
세 번째 block과 필수 속성
56-66마지막 block은 역시 통일된 register 정의를 가진 misc register들입니다. 각 register는 pin 하나를 나타내며 drive strength, pull-up/down 등을 설정합니다. 특히 pull-up resistor는 20K와 4.7K 두 종류입니다.
Spreadtrum pin controller의 필수 `compatible` 형식은 `sprd,<soc>-pinctrl`이며 지원 SoC는 각 `sprd,<soc>-pinctrl.txt` binding 문서를 봅니다. `reg`는 pin controller device의 register address이고 `pins`는 pin 이름 배열입니다.
선택 속성
67-83선택 가능한 property와 원문이 부여한 의미는 다음과 같습니다. 지원 값은 각 `sprd,<soc>-pinctrl.txt` binding 문서를 참조합니다.
| Property | Meaning |
|---|---|
| function | Function 이름 |
| drive-strength | mA 단위 drive strength |
| input-schmitt-disable | 원문 설명: Schmitt-trigger mode 활성화 |
| input-schmitt-enable | 원문 설명: Schmitt-trigger mode 비활성화 |
| bias-disable | Pin bias 비활성화 |
| bias-pull-down | Pin pull-down |
| bias-pull-up | Pin pull-up |
| input-enable | Pin input 활성화 |
| input-disable | Pin output 활성화 |
| output-high | Output level high |
| output-low | Output level low |
| sleep-hardware-state | 이 state의 설정이 sleep 관련임을 표시 |
| sprd,control | Global-control pin의 databook control value |
| sprd,sleep-mode | Sleep mode 선택 |
원문은 `input-schmitt-disable`을 Schmitt-trigger mode 활성화, `input-schmitt-enable`을 비활성화라고 설명해 이름과 의미가 뒤집혀 보입니다. 원문 보존을 위해 이 표에서는 해당 문구를 수정하지 않았습니다.
요약과 해설
sprd,pinctrl.txt:1-83세 register block의 역할과 Linux를 실행하지 않는 subsystem을 위한 `sprd,sleep-mode`를 설명합니다.