diff options
author | Eric Richter <erichte@linux.ibm.com> | 2020-09-16 11:21:21 -0500 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2020-10-01 13:44:06 +1000 |
commit | 795f639c016f4884887173348c8045c16f4f290f (patch) | |
tree | 47db7aea490690f7aeee9bca68b6a9db2ca9a9c8 /libstb/secvar/secvar_devtree.c | |
parent | 31f662a51bfc8bfb5a9fdeb1f84951b6dbf6df72 (diff) | |
download | skiboot-795f639c016f4884887173348c8045c16f4f290f.zip skiboot-795f639c016f4884887173348c8045c16f4f290f.tar.gz skiboot-795f639c016f4884887173348c8045c16f4f290f.tar.bz2 |
secvar_devtree: add physical presence mode helper
This patch adds a simple function to detect whether or not physical
presence has been asserted. In the current implementation, all physical
presence assertion modes are treated the same.
Signed-off-by: Eric Richter <erichte@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'libstb/secvar/secvar_devtree.c')
-rw-r--r-- | libstb/secvar/secvar_devtree.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libstb/secvar/secvar_devtree.c b/libstb/secvar/secvar_devtree.c index 998093f..5903ee3 100644 --- a/libstb/secvar/secvar_devtree.c +++ b/libstb/secvar/secvar_devtree.c @@ -64,3 +64,18 @@ void secvar_set_update_status(uint64_t val) dt_add_property_u64(secvar_node, "update-status", val); } +bool secvar_check_physical_presence(void) +{ + struct dt_node *secureboot; + + secureboot = dt_find_by_path(dt_root, "ibm,secureboot"); + if (!secureboot) + return false; + + if (dt_find_property(secureboot, "clear-os-keys") + || dt_find_property(secureboot, "clear-all-keys") + || dt_find_property(secureboot, "clear-mfg-keys")) + return true; + + return false; +} |