Page MenuHomeFreeBSD

tpm: Refactor TIS and add a SPI attachment
ClosedPublic

Authored by jhibbits on Thu, May 2, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 4:59 AM
Unknown Object (File)
Sat, May 4, 5:37 PM
Unknown Object (File)
Sat, May 4, 2:25 AM
Unknown Object (File)
Sat, May 4, 12:11 AM
Unknown Object (File)
Fri, May 3, 5:52 AM
Unknown Object (File)
Fri, May 3, 5:52 AM
Unknown Object (File)
Thu, May 2, 10:55 PM
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.Fri, May 3, 7:40 PM
This revision was automatically updated to reflect the committed changes.
jhibbits marked an inline comment as done.