[coreboot] SPI TPM question

Julius Werner jwerner at chromium.org
Sat May 19 02:05:42 CEST 2018


> build/romstage/drivers/spi/spi-generic.o: In function `spi_setup_slave':

/mnt/develop/bettong/coreboot/master/coreboot/src/drivers/spi/spi-generic.c:129:
undefined reference to `spi_ctrlr_bus_map'

/mnt/develop/bettong/coreboot/master/coreboot/src/drivers/spi/spi-generic.c:131:
undefined reference to `spi_ctrlr_bus_map_count'

/mnt/develop/bettong/coreboot/master/coreboot/src/drivers/spi/spi-generic.c:134:
undefined reference to `spi_ctrlr_bus_map'

This indicates that your chipset does not support the SPI API. Even if the
generic TPM SPI driver would work with your TPM, you still need chipset
code that tells it how to work with your particular SPI controller. This
would usually be part of the southbridge code (e.g. compare
src/southbridge/intel/common/spi.c, which defines the spi_ctrlr_bus_map
array for some Intel chipsets... although that particular controller would
not work for TPMs either).

> build/romstage/drivers/spi/tpm/tpm.o: In function `stopwatch_tick':
> /mnt/develop/bettong/coreboot/master/coreboot/src/include/timer.h:155:
undefined reference to `timer_monotonic_get'
> build/romstage/drivers/spi/tpm/tpm.o: In function `stopwatch_init':
> /mnt/develop/bettong/coreboot/master/coreboot/src/include/timer.h:131:
undefined reference to `timer_monotonic_get'
> /mnt/develop/bettong/coreboot/master/coreboot/src/include/timer.h:131:
undefined reference to `timer_monotonic_get'
> /mnt/develop/bettong/coreboot/master/coreboot/src/include/timer.h:131:
undefined reference to `timer_monotonic_get'

This indicates that your chipset does not support the monotonic timer API.
Without timers the stopwatch API doesn't work that's used by the TPM
drivers to measure certain transfer timeouts. Looks like some older AMD
CPUs have that support (see
src/cpu/amd/family_10h-family_15h/monotonic_timer.c), not sure why yours
doesn't (probably nobody ever bothered to add it).

> The SPI tpm driver was written for tpm 2.0 only.

It's even worse than that... I think the current SPI TPM driver only
supports Cr50, which is a special TPM 2.0 with a bunch of custom quirks
that is only used in Chromebooks. Patches to expand it to support other
TPMs are welcome, of course, but I don't think anybody has worked on that
for now.



More information about the coreboot mailing list