[SeaBIOS] [PATCH v2 3/3] tpm: when CRB is active, select, lock it, and check addresses

Stefan Berger posted 3 patches 7 years, 1 month ago
[SeaBIOS] [PATCH v2 3/3] tpm: when CRB is active, select, lock it, and check addresses
Posted by Stefan Berger 7 years, 1 month ago
Do not just indicate that the probing for the CRB interface was successful
if we find it active. Instead, select it, lock it, and test the addresses
for whether they can be used (must be 32 bit).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
---
 src/hw/tpm_drivers.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/hw/tpm_drivers.c b/src/hw/tpm_drivers.c
index 271f8d3..bd971f7 100644
--- a/src/hw/tpm_drivers.c
+++ b/src/hw/tpm_drivers.c
@@ -395,9 +395,7 @@ static u32 crb_probe(void)
     if ((ifaceid & 0xf) != 0xf) {
         if ((ifaceid & 0xf) == 1) {
             /* CRB is active */
-            return 1;
-        }
-        if ((ifaceid & (1 << 14)) == 0) {
+        } else if ((ifaceid & (1 << 14)) == 0) {
             /* CRB cannot be selected */
             return 0;
         }
-- 
2.5.5


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios