요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
1
.. SPDX-License-Identifier: GPL-2.0
3
=================================
4
Devicetree Dynamic Resolver Notes
5
=================================
7
This document describes the implementation of the in-kernel
8
DeviceTree resolver, residing in drivers/of/resolver.c
10
How the resolver works
11
----------------------
13
The resolver is given as an input an arbitrary tree compiled with the
14
proper dtc option and having a /plugin/ tag. This generates the
15
appropriate __fixups__ & __local_fixups__ nodes.
17
In sequence the resolver works by the following steps:
19
1. Get the maximum device tree phandle value from the live tree + 1.
20
2. Adjust all the local phandles of the tree to resolve by that amount.
21
3. Using the __local__fixups__ node information adjust all local references
22
by the same amount.
23
4. For each property in the __fixups__ node locate the node it references
24
in the live tree. This is the label used to tag the node.
25
5. Retrieve the phandle of the target of the fixup.
26
6. For each fixup in the property locate the node:property:offset location
27
and replace it with the phandle value.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Devicetree Dynamic Resolver 구현
1-9이 문서는 `drivers/of/resolver.c`에 있는 커널 내부 DeviceTree resolver의 구현을 설명합니다. 문서에는 `GPL-2.0` 라이선스가 적용됩니다.
resolver 입력과 fixup 노드
10-16resolver는 올바른 `dtc` 옵션으로 컴파일되고 `/plugin/` 태그가 있는 임의의 트리를 입력으로 받습니다. 이 컴파일 과정은 적절한 `__fixups__`와 `__local_fixups__` 노드를 생성합니다.
phandle 충돌 방지와 참조 해석 순서
17-27resolver는 다음 순서로 동작합니다.
- 1. 실행 중인 트리에서 가장 큰 Device Tree phandle 값을 구한 뒤 1을 더합니다.
- 2. 해석할 트리의 모든 로컬 phandle에 그 값을 더합니다.
- 3. `__local_fixups__` 노드 정보를 사용하여 모든 로컬 참조에도 같은 값을 더합니다.
- 4. `__fixups__` 노드의 각 속성에 대해, 그 속성이 참조하는 실행 중인 트리의 노드를 찾습니다. 이때 노드에 붙은 label을 사용합니다.
- 5. fixup 대상의 phandle을 가져옵니다.
- 6. 속성의 각 fixup에 대해 `node:property:offset` 위치를 찾아 phandle 값으로 교체합니다.
요약과 해설
dynamic-resolution-notes.rst:1-27overlay의 로컬 phandle과 fixup 참조를 실행 중인 트리에 맞게 보정하는 커널 resolver의 6단계 동작을 설명합니다. 영어 원문 전체와 한국어 전문 번역을 함께 제공하며 함수명, symbol, source path, RST directive와 원문 줄 좌표를 보존합니다.