← Documents Documentation/ABI/testing/sysfs-firmware-ofw GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

Open Firmware and FDT sysfs ABI

Stable /proc/device-tree access, detached trees, exact binary properties와 CRC32-validated boot FDT blob을 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-firmware-ofw
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Stable device-tree hierarchy

sysfs-firmware-ofw:1-29

Device tree node와 property를 directory·binary files로 내보내며 userspace ABI는 변경 가능한 base path가 아니라 /proc/device-tree symlink입니다.

Validated raw boot blob

sysfs-firmware-ofw:30-52

Bootloader가 변경한 raw FDT를 kexec와 debugging에 제공하되 late_initcall CRC32 검증을 통과한 경우에만 노출합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/firmware/devicetree/*
2 Date: November 2013
3 Contact: Grant Likely <[email protected]>, [email protected]
4 Description:
5 When using OpenFirmware or a Flattened Device Tree to enumerate
6 hardware, the device tree structure will be exposed in this
7 directory.
8
9 It is possible for multiple device-tree directories to exist.
10 Some device drivers use a separate detached device tree which
11 have no attachment to the system tree and will appear in a
12 different subdirectory under /sys/firmware/devicetree.
13
14 Userspace must not use the /sys/firmware/devicetree/base
15 path directly, but instead should follow /proc/device-tree
16 symlink. It is possible that the absolute path will change
17 in the future, but the symlink is the stable ABI.
18
19 The /proc/device-tree symlink replaces the devicetree /proc
20 filesystem support, and has largely the same semantics and
21 should be compatible with existing userspace.
22
23 The contents of /sys/firmware/devicetree/ is a
24 hierarchy of directories, one per device tree node. The
25 directory name is the resolved path component name (node
26 name plus address). Properties are represented as files
27 in the directory. The contents of each file is the exact
28 binary data from the device tree.
29
30 What: /sys/firmware/fdt
31 Date: February 2015
32 KernelVersion: 3.19
33 Contact: Frank Rowand <[email protected]>, [email protected]
34 Description:
35 Exports the FDT blob that was passed to the kernel by
36 the bootloader. This allows userland applications such
37 as kexec to access the raw binary. This blob is also
38 useful when debugging since it contains any changes
39 made to the blob by the bootloader.
40
41 The fact that this node does not reside under
42 /sys/firmware/device-tree is deliberate: FDT is also used
43 on arm64 UEFI/ACPI systems to communicate just the UEFI
44 and ACPI entry points, but the FDT is never unflattened
45 and used to configure the system.
46
47 A CRC32 checksum is calculated over the entire FDT
48 blob, and verified at late_initcall time. The sysfs
49 entry is instantiated only if the checksum is valid,
50 i.e., if the FDT blob has not been modified in the mean
51 time. Otherwise, a warning is printed.
52 Users: kexec, debugging
53

3. 한국어 전문 번역

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

Open Firmware device-tree hierarchy

1-29
항목한국어 전문 번역
What/sys/firmware/devicetree/*
Date2013년 11월
ContactGrant Likely <[email protected]>, [email protected]
DescriptionOpenFirmware 또는 Flattened Device Tree로 hardware를 열거하면 device-tree structure가 이 directory에 노출됩니다. System tree와 연결되지 않은 detached device tree를 별도로 사용하는 drivers도 있으므로 `/sys/firmware/devicetree` 아래에 여러 device-tree directories가 존재할 수 있습니다. Userspace는 `/sys/firmware/devicetree/base`를 직접 사용하지 말고 `/proc/device-tree` symlink를 따라야 합니다. Absolute path는 앞으로 바뀔 수 있지만 symlink가 stable ABI입니다. 이 symlink는 기존 devicetree `/proc` filesystem support를 대체하며 semantics가 거의 같아 기존 userspace와 호환되어야 합니다. `/sys/firmware/devicetree/`는 device-tree node마다 directory 하나를 두는 hierarchy입니다. Directory name은 node name과 address를 합친 resolved path component이고 properties는 files로 표현되며, 각 file 내용은 device tree의 exact binary data입니다.
Stable device-tree access path
Userspace opens /proc/device-treeFollow the stable symlinkReach the active device-tree directoryRead node directories and exact binary property files

Userspace가 변경 가능한 absolute path 대신 stable symlink를 사용합니다.

Bootloader-provided FDT blob

30-52
항목한국어 전문 번역
What/sys/firmware/fdt
Date2015년 2월
KernelVersion3.19
ContactFrank Rowand <[email protected]>, [email protected]
DescriptionBootloader가 kernel에 전달한 FDT blob을 export하여 kexec 같은 userland applications가 raw binary에 접근하도록 합니다. Blob에는 bootloader가 적용한 변경도 포함되므로 debugging에도 유용합니다. 이 node가 `/sys/firmware/device-tree` 아래에 있지 않은 것은 의도적입니다. Arm64 UEFI/ACPI systems도 UEFI와 ACPI entry points만 전달하기 위해 FDT를 사용하지만, 이 경우 FDT를 unflatten하거나 system configuration에 사용하지 않기 때문입니다. Kernel은 전체 FDT blob에 CRC32 checksum을 계산해 `late_initcall` 시점에 검증합니다. Checksum이 valid하여 그동안 blob이 수정되지 않은 경우에만 sysfs entry를 만들며, 그렇지 않으면 warning을 출력합니다.
Userskexec, debugging
FDT blob integrity gate
Bootloader passes raw FDT blobKernel calculates CRC32 over the whole blobVerify CRC32 at late_initcallPublish /sys/firmware/fdt only when unchangedPrint a warning when validation fails

Bootloader handoff부터 conditional sysfs publication까지의 과정입니다.