Page MenuHomeFreeBSD

tpm: Refactor TIS and add a SPI attachment
ClosedPublic

Authored by jhibbits on May 2 2024, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 28 2024, 7:51 PM
Unknown Object (File)
Sep 13 2024, 11:13 AM
Unknown Object (File)
Sep 12 2024, 1:30 PM
Unknown Object (File)
Sep 8 2024, 4:59 PM
Unknown Object (File)
Sep 7 2024, 4:19 AM
Unknown Object (File)
Sep 6 2024, 10:14 PM
Unknown Object (File)
Aug 15 2024, 7:36 AM
Unknown Object (File)
Aug 9 2024, 5:01 AM
Subscribers

Details

Summary

Though mostly used in x86 devices, TPM can be used on others, with a
direct SPI attachment. Refactor the TPM 2.0 driver set to use an
attachment interface, and implement a SPI bus interface.

Obtained from: Juniper Networks, Inc.

Test Plan

Tested on a Raspberry Pi 4, with a GeeekPi TPM2.0 module (SLB9670
TPM) using security/tpm2-tools tpm2_getcaps for very light testing against the
spibus attachment.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/conf/files
3201

Other TPM ACPI dependent files are only included files.amd64.
Could you also move them here as a part of this commit?
This way we could support TPM in ARM64 based boards that run ACPI.

sys/dev/tpm/tpm_tis.h
28 ↗(On Diff #138038)

Do we really need this?
Looks like an empty header.

sys/modules/tpm/Makefile
15

How about .if defined(${OPT_ACPI})?
Also please move this below the #TPM 2.0 comment (line 21).
This way it'll be easier to differenciate which files are used for the old (TPM1.2) driver.

jhibbits added inline comments.
sys/conf/files
3201

This does allow ACPI ARM64 to do TPM2 with TIS. I can't verify CRB at all.

sys/dev/tpm/tpm_tis.h
28 ↗(On Diff #138038)

Oops. This was leftover from dev.

sys/modules/tpm/Makefile
15

I can sort it, but I don't see OPT_ACPI anywhere existing.

This revision is now accepted and ready to land.May 3 2024, 7:40 PM
This revision was automatically updated to reflect the committed changes.
jhibbits marked an inline comment as done.