diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/SLOF/board-qemu/slof/vtpm-sml.fs | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/SLOF/board-qemu/slof/vtpm-sml.fs')
-rw-r--r-- | roms/SLOF/board-qemu/slof/vtpm-sml.fs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/roms/SLOF/board-qemu/slof/vtpm-sml.fs b/roms/SLOF/board-qemu/slof/vtpm-sml.fs new file mode 100644 index 000000000..865db062c --- /dev/null +++ b/roms/SLOF/board-qemu/slof/vtpm-sml.fs @@ -0,0 +1,81 @@ +\ ***************************************************************************** +\ * Copyright (c) 2015-2020 IBM Corporation +\ * All rights reserved. +\ * This program and the accompanying materials +\ * are made available under the terms of the BSD License +\ * which accompanies this distribution, and is available at +\ * http://www.opensource.org/licenses/bsd-license.php +\ * +\ * Contributors: +\ * IBM Corporation - initial implementation +\ ****************************************************************************/ + +" /" find-device + +new-device + +false VALUE vtpm-debug? + +\ create /ibm,vtpm +s" ibm,vtpm" 2dup device-name device-type + +\ +\ only internal API calls +\ + +: separator-event ( start-pcr end-pcr -- ) + tpm-add-event-separators ( errcode ) + ?dup IF + ." VTPM: Error code from tpm-add-event-separators: " . cr + THEN +; + +80 CONSTANT BCV_DEVICE_HDD + +: measure-hdd-mbr ( addr length -- ) + 0 7 separator-event + BCV_DEVICE_HDD ( addr length bootdrv ) + -rot ( bootdrv addr length ) + tpm-measure-bcv-mbr ( errcode ) + ?dup IF + ." VTPM: Error code from tpm-measure-hdd: " . cr + THEN +; + +: measure-gpt ( ) + 0 7 separator-event + tpm-measure-gpt + ?dup IF + ." VTPM: Error code from tpm-measure-gpt: " . cr + THEN +; + +: leave-firmware ( -- ) + tpm-leave-firmware ( errcode ) + ?dup IF + ." VTPM: Error code from tpm-leave-firmware: " . cr + THEN +; + +: measure-scrtm ( -- ) + tpm-measure-scrtm ( errcode ) + ?dup IF + ." VTPM: Error code from tpm-measure-scrtm: " . cr + THEN +; + +: vtpm-menu + tpm-is-working IF + tpm20-menu + THEN +; + +: open true ; +: close ; + +finish-device +device-end + +s" /ibm,vtpm" find-node ?dup IF + s" measure-scrtm" rot $call-static +THEN |