요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=========================
TPM FIFO interface driver
=========================
TCG PTP Specification defines two interface types: FIFO and CRB. The former is
based on sequenced read and write operations, and the latter is based on a
buffer containing the full command or response.
FIFO (First-In-First-Out) interface is used by the tpm_tis_core dependent
drivers. Originally Linux had only a driver called tpm_tis, which covered
memory mapped (aka MMIO) interface but it was later on extended to cover other
physical interfaces supported by the TCG standard.
For historical reasons above the original MMIO driver is called tpm_tis and the
framework for FIFO drivers is named as tpm_tis_core. The postfix "tis" in
tpm_tis comes from the TPM Interface Specification, which is the hardware
interface specification for TPM 1.x chips.
Communication is based on a 20 KiB buffer shared by the TPM chip through a
hardware bus or memory map, depending on the physical wiring. The buffer is
further split into five equal-size 4 KiB buffers, which provide equivalent
sets of registers for communication between the CPU and TPM. These
communication endpoints are called localities in the TCG terminology.
When the kernel wants to send commands to the TPM chip, it first reserves
locality 0 by setting the requestUse bit in the TPM_ACCESS register. The bit is
cleared by the chip when the access is granted. Once it completes its
communication, the kernel writes the TPM_ACCESS.activeLocality bit. This
informs the chip that the locality has been relinquished.
Pending localities are served in order by the chip in descending order, one at
a time:
- Locality 0 has the lowest priority.
- Locality 5 has the highest priority.
Further information on the purpose and meaning of the localities can be found
in section 3.2 of the TCG PC Client Platform TPM Profile Specification.
References
==========
TCG PC Client Platform TPM Profile (PTP) Specification
https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
FIFO, CRB와 tpm_tis_core
1-20TCG PTP Specification은 FIFO와 CRB 두 interface type을 정의한다. FIFO는 순서가 있는 read·write operation을 사용하고 CRB는 command 또는 response 전체를 담는 buffer를 사용한다.
FIFO interface는 `tpm_tis_core` 의존 driver가 사용한다. Linux에는 처음에 memory-mapped, 즉 MMIO interface를 담당하는 `tpm_tis`만 있었지만 이후 TCG 표준이 지원하는 다른 physical interface까지 확장되었다.
역사적 이유로 원래 MMIO driver 이름은 `tpm_tis`, FIFO driver framework 이름은 `tpm_tis_core`다. `tis` 접미사는 TPM 1.x chip의 hardware interface 사양인 TPM Interface Specification에서 왔다.
Command 전달 방식과 Linux driver 명칭을 구분한다.
.. SPDX-License-Identifier: GPL-2.0
=========================
TPM FIFO interface driver
=========================
TCG PTP Specification defines two interface types: FIFO and CRB. The former is
based on sequenced read and write operations, and the latter is based on a
buffer containing the full command or response.
FIFO (First-In-First-Out) interface is used by the tpm_tis_core dependent
drivers. Originally Linux had only a driver called tpm_tis, which covered
memory mapped (aka MMIO) interface but it was later on extended to cover other
physical interfaces supported by the TCG standard.
For historical reasons above the original MMIO driver is called tpm_tis and the
framework for FIFO drivers is named as tpm_tis_core. The postfix "tis" in
tpm_tis comes from the TPM Interface Specification, which is the hardware
interface specification for TPM 1.x chips.
20 KiB buffer와 locality
21-26통신은 physical wiring에 따라 hardware bus 또는 memory map을 통해 TPM chip과 공유하는 20 KiB buffer를 사용한다. 이 buffer는 4 KiB씩 동일한 다섯 영역으로 나뉘고, 각 영역은 CPU와 TPM 통신을 위한 동등한 register set을 제공한다.
TCG 용어로 이 communication endpoint를 locality라고 한다.
공유 buffer를 locality별 동일 register window로 분할한다.
Communication is based on a 20 KiB buffer shared by the TPM chip through a
hardware bus or memory map, depending on the physical wiring. The buffer is
further split into five equal-size 4 KiB buffers, which provide equivalent
sets of registers for communication between the CPU and TPM. These
communication endpoints are called localities in the TCG terminology.
Locality 예약·반납과 우선순위
27-41Kernel이 TPM command를 보내려면 먼저 `TPM_ACCESS` register의 `requestUse` bit를 설정해 locality 0을 예약한다. Chip이 접근을 허용하면 이 bit를 clear한다.
통신이 끝나면 kernel은 `TPM_ACCESS.activeLocality` bit를 쓴다. 이는 해당 locality를 relinquish했음을 chip에 알린다.
대기 locality는 chip이 한 번에 하나씩 내림차순 우선순위로 처리한다. 원문은 locality 0을 가장 낮은 우선순위, locality 5를 가장 높은 우선순위로 명시한다. Locality 목적과 의미는 TCG PTP specification 3.2절을 참조한다.
Locality를 요청하고 grant를 확인한 뒤 command 완료 후 반납한다.
대기 요청은 높은 번호부터 한 번에 하나씩 처리된다.
When the kernel wants to send commands to the TPM chip, it first reserves
locality 0 by setting the requestUse bit in the TPM_ACCESS register. The bit is
cleared by the chip when the access is granted. Once it completes its
communication, the kernel writes the TPM_ACCESS.activeLocality bit. This
informs the chip that the locality has been relinquished.
Pending localities are served in order by the chip in descending order, one at
a time:
- Locality 0 has the lowest priority.
- Locality 5 has the highest priority.
Further information on the purpose and meaning of the localities can be found
in section 3.2 of the TCG PC Client Platform TPM Profile Specification.
PTP specification
42-46FIFO·CRB interface와 locality의 상세 정의는 TCG PC Client Platform TPM Profile(PTP) Specification을 참조한다.
Interface와 locality의 권위 있는 정의다.
References
==========
TCG PC Client Platform TPM Profile (PTP) Specification
https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/
요약·해설
tpm_tis.rst:1-46TPM FIFO/TIS interface의 20 KiB locality buffer, requestUse·activeLocality handoff와 우선순위를 설명합니다.