]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
tpm: when CRB is active, select, lock it, and check addresses
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Mon, 19 Mar 2018 16:00:29 +0000 (12:00 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 21 Mar 2018 14:35:54 +0000 (10:35 -0400)
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

index 271f8d3a932d6f58f29520db5aed17158eb31738..bd971f759219f256687886230857d3f4b9694f10 100644 (file)
@@ -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;
         }