-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
Description
TPM support has introduced a major regression, as SPI device enters TPM mode while TPM is not enabled, breaking support for flash and passthrough modes.
It seems that several functions are using the wrong register bank, namely spi_regs to index TPM registers, whereas the proper bank is likely tpm_regs.
What is more surprising is that the CI did not catch it?
static bool ot_spi_device_is_tpm_enabled(const OtSPIDeviceState *s)
{
return (bool)FIELD_EX32(s->spi_regs[R_TPM_CFG], TPM_CFG, EN);
}
static bool ot_spi_device_is_tpm_mode_crb(const OtSPIDeviceState *s)
{
return (bool)FIELD_EX32(s->spi_regs[R_TPM_CFG], TPM_CFG, TPM_MODE);
}
static bool ot_spi_device_tpm_disable_hw_regs(const OtSPIDeviceState *s)
{
return (bool)FIELD_EX32(s->spi_regs[R_TPM_CFG], TPM_CFG, HW_REG_DIS);
}There may be other locations where the wrong register bank is used, I have not dug further.