Skip to content

Commit 5cb2ace

Browse files
stefanbergerJarkko Sakkinen
authored andcommitted
tpm: of: Handle IBM,vtpm20 case when getting log parameters
A vTPM 2.0 is identified by 'IBM,vtpm20' in the 'compatible' node in the device tree. Handle it in the same way as 'IBM,vtpm'. The vTPM 2.0's log is written in little endian format so that for this aspect we can rely on existing code. Signed-off-by: Stefan Berger <[email protected]> Acked-by: Nayna Jain <[email protected]> Tested-by: Nayna Jain <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 77b400d commit 5cb2ace

File tree

1 file changed

+2
-1
lines changed
  • drivers/char/tpm/eventlog

1 file changed

+2
-1
lines changed

drivers/char/tpm/eventlog/of.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ int tpm_read_log_of(struct tpm_chip *chip)
5151
* endian format. For this reason, vtpm doesn't need conversion
5252
* but physical tpm needs the conversion.
5353
*/
54-
if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) {
54+
if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0 &&
55+
of_property_match_string(np, "compatible", "IBM,vtpm20") < 0) {
5556
size = be32_to_cpup((__force __be32 *)sizep);
5657
base = be64_to_cpup((__force __be64 *)basep);
5758
} else {

0 commit comments

Comments
 (0)