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 <stefanb@linux.ibm.com> Acked-by: Nayna Jain <nayna@linux.ibm.com> Tested-by: Nayna Jain <nayna@linux.ibm.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
1 parent 77b400d commit 5cb2ace

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/char/tpm/eventlog

‎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)