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

Linux 6.18.37 · ABI / testing

Firmware fallback and upload sysfs ABI

Firmware image 쓰기, upload 취소·오류·남은 크기·상태와 fallback timeout을 제어하는 sysfs ABI를 설명합니다.

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

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

1. 요약·해설

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

Image write, cancellation, and errors

sysfs-class-firmware:1-35

loading과 data node의 write handshake, lower-level device 전송 취소 조건과 <STATUS>:<ERROR> 실패 보고 형식을 정의합니다.

Write control and transfer progress

sysfs-class-firmware:37-60

loading 값 1·-1·0으로 data 쓰기를 시작·중단·완료하고 transferring 단계의 남은 byte 크기를 추적합니다.

Upload status and fallback timeout

sysfs-class-firmware:62-77

Upload의 idle·receiving·preparing·transferring·programming 상태와 upload에는 영향을 주지 않는 fallback timeout을 구분합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/class/firmware/.../data
2 Date: July 2022
3 KernelVersion: 5.19
4 Contact: Russ Weight <[email protected]>
5 Description: The data sysfs file is used for firmware-fallback and for
6 firmware uploads. Cat a firmware image to this sysfs file
7 after you echo 1 to the loading sysfs file. When the firmware
8 image write is complete, echo 0 to the loading sysfs file. This
9 sequence will signal the completion of the firmware write and
10 signal the lower-level driver that the firmware data is
11 available.
12
13 What: /sys/class/firmware/.../cancel
14 Date: July 2022
15 KernelVersion: 5.19
16 Contact: Russ Weight <[email protected]>
17 Description: Write-only. For firmware uploads, write a "1" to this file to
18 request that the transfer of firmware data to the lower-level
19 device be canceled. This request will be rejected (EBUSY) if
20 the update cannot be canceled (e.g. a FLASH write is in
21 progress) or (ENODEV) if there is no firmware update in progress.
22
23 What: /sys/class/firmware/.../error
24 Date: July 2022
25 KernelVersion: 5.19
26 Contact: Russ Weight <[email protected]>
27 Description: Read-only. Returns a string describing a failed firmware
28 upload. This string will be in the form of <STATUS>:<ERROR>,
29 where <STATUS> will be one of the status strings described
30 for the status sysfs file and <ERROR> will be one of the
31 following: "hw-error", "timeout", "user-abort", "device-busy",
32 "invalid-file-size", "read-write-error", "flash-wearout". The
33 error sysfs file is only meaningful when the current firmware
34 upload status is "idle". If this file is read while a firmware
35 transfer is in progress, then the read will fail with EBUSY.
36
37 What: /sys/class/firmware/.../loading
38 Date: July 2022
39 KernelVersion: 5.19
40 Contact: Russ Weight <[email protected]>
41 Description: The loading sysfs file is used for both firmware-fallback and
42 for firmware uploads. Echo 1 onto the loading file to indicate
43 you are writing a firmware file to the data sysfs node. Echo
44 -1 onto this file to abort the data write or echo 0 onto this
45 file to indicate that the write is complete. For firmware
46 uploads, the zero value also triggers the transfer of the
47 firmware data to the lower-level device driver.
48
49 What: /sys/class/firmware/.../remaining_size
50 Date: July 2022
51 KernelVersion: 5.19
52 Contact: Russ Weight <[email protected]>
53 Description: Read-only. For firmware upload, this file contains the size
54 of the firmware data that remains to be transferred to the
55 lower-level device driver. The size value is initialized to
56 the full size of the firmware image that was previously
57 written to the data sysfs file. This value is periodically
58 updated during the "transferring" phase of the firmware
59 upload.
60 Format: "%u".
61
62 What: /sys/class/firmware/.../status
63 Date: July 2022
64 KernelVersion: 5.19
65 Contact: Russ Weight <[email protected]>
66 Description: Read-only. Returns a string describing the current status of
67 a firmware upload. The string will be one of the following:
68 idle, "receiving", "preparing", "transferring", "programming".
69
70 What: /sys/class/firmware/.../timeout
71 Date: July 2022
72 KernelVersion: 5.19
73 Contact: Russ Weight <[email protected]>
74 Description: This file supports the timeout mechanism for firmware
75 fallback. This file has no affect on firmware uploads. For
76 more information on timeouts please see the documentation
77 for firmware fallback.
78

3. 한국어 전문 번역

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

Firmware image data 전송

1-11
항목한국어 전문 번역
What/sys/class/firmware/.../data
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
Descriptiondata sysfs file은 firmware fallback과 firmware upload에 사용됩니다. loading sysfs file에 1을 쓴 다음 이 sysfs file로 firmware image를 씁니다. Firmware image 쓰기가 끝나면 loading sysfs file에 0을 씁니다. 이 순서는 firmware 쓰기가 완료되었음을 알리고 lower-level driver에 firmware data를 사용할 수 있음을 알립니다.
echo 1 > loading
cat firmware.bin > data
echo 0 > loading
Firmware data write sequence
UserspaceloadingdataLower-level driver
01 echo 1write 시작
02 cat firmware.binimage 쓰기
03 echo 0write 완료
04 완료 signalfirmware data 사용 가능

loading node로 시작과 완료를 표시하고 data node로 image를 전달합니다.

Firmware upload 취소 요청

13-21
항목한국어 전문 번역
What/sys/class/firmware/.../cancel
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
DescriptionWrite-only입니다. Firmware upload에서 이 file에 "1"을 쓰면 lower-level device로 firmware data를 전송하는 작업의 취소를 요청합니다. Update를 취소할 수 없으면(예: FLASH write 진행 중) 요청이 EBUSY로 거부되고, 진행 중인 firmware update가 없으면 ENODEV로 거부됩니다.
echo 1 > cancel
cancel 요청 결과
상황결과
Update를 취소할 수 없음EBUSY
진행 중인 firmware update가 없음ENODEV

취소할 수 없는 시점과 진행 중 update 부재를 구분합니다.

Firmware upload 오류 문자열

23-35
항목한국어 전문 번역
What/sys/class/firmware/.../error
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
DescriptionRead-only입니다. 실패한 firmware upload를 설명하는 문자열을 반환합니다. 문자열은 <STATUS>:<ERROR> 형식입니다. <STATUS>는 status sysfs file에서 설명하는 status 문자열 중 하나이고, <ERROR>는 "hw-error", "timeout", "user-abort", "device-busy", "invalid-file-size", "read-write-error", "flash-wearout" 중 하나입니다. error sysfs file은 현재 firmware upload status가 "idle"일 때만 의미가 있습니다. Firmware 전송 진행 중 이 file을 읽으면 EBUSY로 실패합니다.
<STATUS>:<ERROR>
Firmware upload error 값
ERROR분류
hw-errorHardware error
timeoutTimeout
user-abortUser abort
device-busyDevice busy
invalid-file-sizeInvalid firmware file size
read-write-errorRead/write error
flash-wearoutFlash wearout

error 문자열의 <ERROR> field에 올 수 있는 일곱 값입니다.

Firmware data write 상태 제어

37-47
항목한국어 전문 번역
What/sys/class/firmware/.../loading
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
Descriptionloading sysfs file은 firmware fallback과 firmware upload 모두에 사용됩니다. loading file에 1을 써서 data sysfs node에 firmware file을 쓰고 있음을 나타냅니다. 이 file에 -1을 쓰면 data 쓰기를 중단하고, 0을 쓰면 쓰기가 완료되었음을 나타냅니다. Firmware upload에서는 0 값이 lower-level device driver로 firmware data를 전송하는 작업도 시작합니다.
loading 제어 값
의미Upload 추가 동작
1data node 쓰기 시작없음
-1data 쓰기 중단없음
0data 쓰기 완료Lower-level driver로 전송 시작

Firmware image write lifecycle을 제어하는 세 값입니다.

남은 firmware 전송 크기

49-60
항목한국어 전문 번역
What/sys/class/firmware/.../remaining_size
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
DescriptionRead-only입니다. Firmware upload에서 lower-level device driver로 아직 전송해야 하는 firmware data 크기를 담습니다. 이 값은 앞서 data sysfs file에 쓴 firmware image의 전체 크기로 초기화되며, firmware upload의 "transferring" 단계 동안 주기적으로 갱신됩니다. 형식은 "%u"입니다.

Firmware upload 현재 상태

62-68
항목한국어 전문 번역
What/sys/class/firmware/.../status
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
DescriptionRead-only입니다. Firmware upload의 현재 상태를 설명하는 문자열을 반환합니다. 문자열은 idle, "receiving", "preparing", "transferring", "programming" 중 하나입니다.
Firmware upload status
idlereceivingpreparingtransferringprogramming

원문에 나열된 upload 상태를 일반적인 진행 순서로 배치했습니다.

Firmware fallback timeout

70-77
항목한국어 전문 번역
What/sys/class/firmware/.../timeout
Date2022년 7월
KernelVersion5.19
ContactRuss Weight <[email protected]>
DescriptionFirmware fallback의 timeout mechanism을 지원합니다. 이 file은 firmware upload에는 영향을 주지 않습니다. Timeout에 대한 자세한 내용은 firmware fallback 문서를 참조하십시오.