Yes, good point, Philippe!

I will send an update in a few days in case there are additional
changes to be made.

thank you,
---
dan tan
power simulation
phone:+1.7373.099.138
email:dan...@linux.ibm.com


On 2025-02-17 01:31, Philippe Mathieu-Daudé wrote:
Hi,

On 16/2/25 23:11, dan tan wrote:
Implement support for TPM via SPI interface. The SPI bus master
is provided by PowerNV SPI device which is an SSI peripheral.
It can uses the tpm_emulator driver backend with the external
swtpm.

Signed-off-by: dan tan <dan...@linux.ibm.com>
---

v3:
- moved variable tis_addr from TPMStateSPI struct to local
- added the VM suspend/resume support:
   - added vmstate_tpm_tis_spi declaration
   - added tpm_tis_spi_pre_save() function
- fixed trace formatting string

v4:
- git commit amend only

v5:
- removed DEFINE_PROP_UINT32("irq", TPMStateSPI, tpm_state.irq_num, 0)
   from tpm_tis_spi_properties
- In tpm.rst document, under section 'The QEMU TPM emulator device',
   moved the 'PowerNV machine' section to immeidately below 'pSeriese
   machine'.

v6:
- amend commit description
- amend hw/tpm/tpm_tis_spi.c prolog to reflect the generic nature
   of the implementation
- remove irrelevant define of IBM_PONQ
- correct the function names to comply with the convention of
   beginning with tpm_tis_spi_xxxx()

v7:
- Reduce SPI wait states to improve performace.
   Although the real SPI buses have four wait states to accomodate
   the timing of various slave devices, there is no need to emulate
   that for this behavior model.

v8:
- re-package the email to comply with the convention.

v9:
- conform with the latest device property definition after rebase

---
  docs/specs/tpm.rst   |  15 ++
  include/system/tpm.h |   3 +
hw/tpm/tpm_tis_spi.c | 358 +++++++++++++++++++++++++++++++++++++++++++
  hw/tpm/Kconfig       |   6 +
  hw/tpm/meson.build   |   1 +
  hw/tpm/trace-events  |   7 +
  6 files changed, 390 insertions(+)
  create mode 100644 hw/tpm/tpm_tis_spi.c


diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig
index a46663288c..5951c225cc 100644
--- a/hw/tpm/Kconfig
+++ b/hw/tpm/Kconfig
@@ -5,6 +5,12 @@ config TPM_TIS_I2C
      select I2C
      select TPM_TIS
  +config TPM_TIS_SPI
+    bool
+    depends on TPM
+    select TPM_BACKEND
+    select TPM_TIS

       depends on SSI?

  config TPM_TIS_ISA
      bool
      depends on TPM && ISA_BUS

Reply via email to