요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0-only
==================================
PLDM Firmware Flash Update Library
==================================
``pldmfw`` implements functionality for updating the flash on a device using
the PLDM for Firmware Update standard
<https://www.dmtf.org/documents/pmci/pldm-firmware-update-specification-100>.
.. toctree::
:maxdepth: 1
file-format
driver-ops
==================================
Overview of the ``pldmfw`` library
==================================
The ``pldmfw`` library is intended to be used by device drivers for
implementing device flash update based on firmware files following the PLDM
firmware file format.
It is implemented using an ops table that allows device drivers to provide
the underlying device specific functionality.
``pldmfw`` implements logic to parse the packed binary format of the PLDM
firmware file into data structures, and then uses the provided function
operations to determine if the firmware file is a match for the device. If
so, it sends the record and component data to the firmware using the device
specific implementations provided by device drivers. Once the device
firmware indicates that the update may be performed, the firmware data is
sent to the device for programming.
Parsing the PLDM file
=====================
The PLDM file format uses packed binary data, with most multi-byte fields
stored in the Little Endian format. Several pieces of data are variable
length, including version strings and the number of records and components.
Due to this, it is not straight forward to index the record, record
descriptors, or components.
To avoid proliferating access to the packed binary data, the ``pldmfw``
library parses and extracts this data into simpler structures for ease of
access.
In order to safely process the firmware file, care is taken to avoid
unaligned access of multi-byte fields, and to properly convert from Little
Endian to CPU host format. Additionally the records, descriptors, and
components are stored in linked lists.
Performing a flash update
=========================
To perform a flash update, the ``pldmfw`` module performs the following
steps
1. Parse the firmware file for record and component information
2. Scan through the records and determine if the device matches any record
in the file. The first matched record will be used.
3. If the matching record provides package data, send this package data to
the device.
4. For each component that the record indicates, send the component data to
the device. For each component, the firmware may respond with an
indication of whether the update is suitable or not. If any component is
not suitable, the update is canceled.
5. For each component, send the binary data to the device firmware for
updating.
6. After all components are programmed, perform any final device-specific
actions to finalize the update.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
PLDM Firmware Flash Update Library 개요
1-35`pldmfw`는 DMTF의 PLDM for Firmware Update standard를 사용하는 device flash update 공통 기능을 구현합니다. 이 문서의 `toctree`는 binary `file-format`과 device driver의 `driver-ops`를 연결합니다.
device driver는 PLDM firmware file format을 따르는 firmware file로 flash update를 제공할 때 이 library를 사용합니다. 공통 library와 device별 operation table을 나누어, packed format parsing과 update orchestration은 `pldmfw`가 맡고 실제 transport와 firmware command는 driver가 맡습니다.
library는 packed binary PLDM file을 내부 data structure로 parse하고 callback으로 record가 device와 일치하는지 확인합니다. 일치하면 record data와 component 정보를 device firmware에 보내 update 가능 여부를 협상한 뒤, firmware data를 programming하도록 driver callback에 전달합니다.
library는 format과 순서를, device driver는 실제 device 통신을 담당합니다.
.. SPDX-License-Identifier: GPL-2.0-only
==================================
PLDM Firmware Flash Update Library
==================================
``pldmfw`` implements functionality for updating the flash on a device using
the PLDM for Firmware Update standard
<https://www.dmtf.org/documents/pmci/pldm-firmware-update-specification-100>.
.. toctree::
:maxdepth: 1
file-format
driver-ops
==================================
Overview of the ``pldmfw`` library
==================================
The ``pldmfw`` library is intended to be used by device drivers for
implementing device flash update based on firmware files following the PLDM
firmware file format.
It is implemented using an ops table that allows device drivers to provide
the underlying device specific functionality.
``pldmfw`` implements logic to parse the packed binary format of the PLDM
firmware file into data structures, and then uses the provided function
operations to determine if the firmware file is a match for the device. If
so, it sends the record and component data to the firmware using the device
specific implementations provided by device drivers. Once the device
firmware indicates that the update may be performed, the firmware data is
sent to the device for programming.
packed PLDM file의 안전한 parsing
36-53PLDM file format은 packed binary data를 사용하며 대부분의 multi-byte field는 Little Endian으로 저장됩니다. version string, record 수, component 수처럼 variable-length data가 있어 record, descriptor, component를 단순 고정 offset으로 indexing하기 어렵습니다.
packed data에 대한 임의 접근이 여러 곳으로 퍼지지 않도록 `pldmfw` library가 이를 한 번 parse하고 사용하기 쉬운 구조로 추출합니다. multi-byte field의 unaligned access를 피하고 Little Endian 값을 CPU host format으로 올바르게 변환합니다.
parse된 records, descriptors, components는 linked lists에 저장됩니다. 이후 matching과 update 단계는 원본 byte buffer의 가변 위치를 다시 계산하지 않고 이 검증된 구조를 순회합니다.
가변 길이 packed bytes를 검증된 host data structure로 변환합니다.
Parsing the PLDM file
=====================
The PLDM file format uses packed binary data, with most multi-byte fields
stored in the Little Endian format. Several pieces of data are variable
length, including version strings and the number of records and components.
Due to this, it is not straight forward to index the record, record
descriptors, or components.
To avoid proliferating access to the packed binary data, the ``pldmfw``
library parses and extracts this data into simpler structures for ease of
access.
In order to safely process the firmware file, care is taken to avoid
unaligned access of multi-byte fields, and to properly convert from Little
Endian to CPU host format. Additionally the records, descriptors, and
components are stored in linked lists.
flash update 수행 순서
54-72flash update는 다음 순서로 진행합니다. 먼저 firmware file에서 record와 component 정보를 parse합니다. record들을 순서대로 검사해 device와 일치하는 첫 record를 선택합니다.
matching record에 package data가 있으면 device로 전송합니다. 이어서 record가 지정한 각 component의 정보를 device로 보내 적합성을 확인합니다. firmware가 어느 component라도 update에 부적합하다고 응답하면 전체 update를 취소합니다.
모든 component가 적합하면 각 component의 binary data를 device firmware로 보내 programming합니다. 모든 component가 완료된 뒤 device-specific final action을 수행해 update를 마무리합니다.
일치 판정과 component 적합성 검사를 통과한 뒤에만 image를 programming합니다.
Performing a flash update
=========================
To perform a flash update, the ``pldmfw`` module performs the following
steps
1. Parse the firmware file for record and component information
2. Scan through the records and determine if the device matches any record
in the file. The first matched record will be used.
3. If the matching record provides package data, send this package data to
the device.
4. For each component that the record indicates, send the component data to
the device. For each component, the firmware may respond with an
indication of whether the update is suitable or not. If any component is
not suitable, the update is canceled.
5. For each component, send the binary data to the device firmware for
updating.
6. After all components are programmed, perform any final device-specific
actions to finalize the update.
요약과 해설
index.rst:1-72`pldmfw`는 packed Little Endian PLDM package를 안전한 linked data structure로 parse하고, 첫 matching record를 선택한 뒤 package data와 component table 협상, component image programming, device-specific finalize를 순서대로 수행합니다.