[RFC 0/1] SPI support in QEMU TPM

Iris Chen posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220803023241.63739-1-irischenlj@gmail.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Stefan Berger <stefanb@linux.vnet.ibm.com>
configs/devices/arm-softmmu/default.mak |   1 +
hw/arm/Kconfig                          |   5 +
hw/tpm/Kconfig                          |   5 +
hw/tpm/meson.build                      |   1 +
hw/tpm/tpm_tis_spi.c                    | 311 ++++++++++++++++++++++++
include/sysemu/tpm.h                    |   3 +
6 files changed, 326 insertions(+)
create mode 100644 hw/tpm/tpm_tis_spi.c
[RFC 0/1] SPI support in QEMU TPM
Posted by Iris Chen 1 year, 9 months ago
From: Iris Chen <irischenlj@fb.com>

Hey everyone,

Thanks for all your comments on the SPI GPIO model. I am working through them.

As for adding support for SPI-based TPMs in QEMU, this RFC patch adds SPI
support in the QEMU TPM implementation via tpm_tis_spi.c.

The QEMU tree already has support for two connection methods to the TPM:
mmio (isa for x86, sysbus for arm) and “spapr”. This patch adds a new SPI
bus implementation for the TPM. Specifically, this SPI bus implementation
connects to the Yosemite-v3.5 model using the SPI-GPIO model sent earlier
last week. I have already tested these implementations locally together
and can verify that the Linux kernel can successfully probe the TPM device
on Yosemite-v3.5 and we can run the TPM command line tools to interact with it.

Please let me know what you think about this!

Thanks,
Iris

Iris Chen (1):
  hw: tpmtisspi: add SPI support to QEMU TPM implementation

 configs/devices/arm-softmmu/default.mak |   1 +
 hw/arm/Kconfig                          |   5 +
 hw/tpm/Kconfig                          |   5 +
 hw/tpm/meson.build                      |   1 +
 hw/tpm/tpm_tis_spi.c                    | 311 ++++++++++++++++++++++++
 include/sysemu/tpm.h                    |   3 +
 6 files changed, 326 insertions(+)
 create mode 100644 hw/tpm/tpm_tis_spi.c

--
2.30.2

Re: [RFC 0/1] SPI support in QEMU TPM
Posted by Cédric Le Goater 1 year, 9 months ago
[ Adding Stefan, TPM maintainer ]

On 8/3/22 04:32, Iris Chen wrote:
> From: Iris Chen <irischenlj@fb.com>
> 
> Hey everyone,
> 
> Thanks for all your comments on the SPI GPIO model. I am working through them.
> 
> As for adding support for SPI-based TPMs in QEMU, this RFC patch adds SPI
> support in the QEMU TPM implementation via tpm_tis_spi.c.
> 
> The QEMU tree already has support for two connection methods to the TPM:
> mmio (isa for x86, sysbus for arm) and “spapr”. This patch adds a new SPI
> bus implementation for the TPM. Specifically, this SPI bus implementation
> connects to the Yosemite-v3.5 model using the SPI-GPIO model sent earlier
> last week. I have already tested these implementations locally together
> and can verify that the Linux kernel can successfully probe the TPM device
> on Yosemite-v3.5 and we can run the TPM command line tools to interact with it.
> 
> Please let me know what you think about this!
> 
> Thanks,
> Iris
> 
> Iris Chen (1):
>    hw: tpmtisspi: add SPI support to QEMU TPM implementation
> 
>   configs/devices/arm-softmmu/default.mak |   1 +
>   hw/arm/Kconfig                          |   5 +
>   hw/tpm/Kconfig                          |   5 +
>   hw/tpm/meson.build                      |   1 +
>   hw/tpm/tpm_tis_spi.c                    | 311 ++++++++++++++++++++++++
>   include/sysemu/tpm.h                    |   3 +
>   6 files changed, 326 insertions(+)
>   create mode 100644 hw/tpm/tpm_tis_spi.c
> 
> --
> 2.30.2