Skip to content

Commit

Permalink
tpm: of: Handle IBM,vtpm20 case when getting log parameters
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stefanberger authored and Jarkko Sakkinen committed Mar 13, 2020
1 parent 77b400d commit 5cb2ace
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/char/tpm/eventlog/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ int tpm_read_log_of(struct tpm_chip *chip)
* endian format. For this reason, vtpm doesn't need conversion
* but physical tpm needs the conversion.
*/
if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) {
if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0 &&
of_property_match_string(np, "compatible", "IBM,vtpm20") < 0) {
size = be32_to_cpup((__force __be32 *)sizep);
base = be64_to_cpup((__force __be64 *)basep);
} else {
Expand Down

0 comments on commit 5cb2ace

Please sign in to comment.