1.. SPDX-License-Identifier: GPL-2.0
2
3========================
4TPM CRB over FF-A Driver
5========================
6
7The TPM Command Response Buffer (CRB) interface is a standard TPM interface
8defined in the TCG PC Client Platform TPM Profile (PTP) Specification [1]_.
9The CRB provides a structured set of control registers a client uses when
10interacting with a TPM as well as a data buffer for storing TPM commands and
11responses. A CRB interface can be implemented in:
12
13- hardware registers in a discrete TPM chip
14
15- in memory for a TPM running in isolated environment where shared memory
16  allows a client to interact with the TPM
17
18The Firmware Framework for Arm A-profile (FF-A) [2]_ is a specification
19that defines interfaces and protocols for the following purposes:
20
21- Compartmentalize firmware into software partitions that run in the Arm
22  Secure world environment (also know as TrustZone)
23
24- Provide a standard interface for software components in the Non-secure
25  state, for example OS and Hypervisors, to communicate with this firmware.
26
27A TPM can be implemented as an FF-A secure service.  This could be a firmware
28TPM or could potentially be a TPM service that acts as a proxy to a discrete
29TPM chip. An FF-A based TPM abstracts hardware details (e.g. bus controller
30and chip selects) away from the OS and can protect locality 4 from access
31by an OS.  The TCG-defined CRB interface is used by clients to interact
32with the TPM service.
33
34The Arm TPM Service Command Response Buffer Interface Over FF-A [3]_
35specification defines FF-A messages that can be used by a client to signal
36when updates have been made to the CRB.
37
38How the Linux CRB driver interacts with FF-A is summarized below:
39
40- The tpm_crb_ffa driver registers with the FF-A subsystem in the kernel
41  with an architected TPM service UUID defined in the CRB over FF-A spec.
42
43- If a TPM service is discovered by FF-A, the probe() function in the
44  tpm_crb_ffa driver runs, and the driver initializes.
45
46- The probing and initialization of the Linux CRB driver is triggered
47  by the discovery of a TPM advertised via ACPI.  The CRB driver can
48  detect the type of TPM through the ACPI 'start' method.  The start
49  method for Arm FF-A was defined in TCG ACPI v1.4 [4]_.
50
51- When the CRB driver performs its normal functions such as signaling 'start'
52  and locality request/relinquish it invokes the tpm_crb_ffa_start() funnction
53  in the tpm_crb_ffa driver which handles the FF-A messaging to the TPM.
54
55References
56==========
57
58.. [1] **TCG PC Client Platform TPM Profile (PTP) Specification**
59   https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/
60.. [2] **Arm Firmware Framework for Arm A-profile (FF-A)**
61   https://developer.arm.com/documentation/den0077/latest/
62.. [3] **Arm TPM Service Command Response Buffer Interface Over FF-A**
63   https://developer.arm.com/documentation/den0138/latest/
64.. [4] **TCG ACPI Specification**
65   https://trustedcomputinggroup.org/resource/tcg-acpi-specification/
66