[Skiboot] [PATCH 1/3] secvar_devtree: add generic compatible, and new format device tree property

Eric Richter erichte at linux.ibm.com
Wed Dec 4 11:03:47 AEDT 2019


This patch adds a generic compatible entry to the secvar/compatible
device tree property for kernels, etc to match for basic secvar
information (e.g. the linux secvar-sysfs implementation).

The new "format" property exposes the expected format for data passing
in and out of the secvar API. In most cases, this should be the same as
the backend-specific compatible entry.

Signed-off-by: Eric Richter <erichte at linux.ibm.com>
---
 doc/device-tree/ibm,opal/secvar/binding.rst | 21 ++++++++++++++++++++-
 libstb/secvar/secvar_devtree.c              |  3 ++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/doc/device-tree/ibm,opal/secvar/binding.rst b/doc/device-tree/ibm,opal/secvar/binding.rst
index bc86fb2b..0956e49c 100644
--- a/doc/device-tree/ibm,opal/secvar/binding.rst
+++ b/doc/device-tree/ibm,opal/secvar/binding.rst
@@ -42,6 +42,25 @@ Properties:
   all further images to require signature validations. See the
   "On Enforcing Secure Mode" section below.
 
+  This property also contains a generic "ibm,secvar-backend" compatible,
+  which defines the basic-level compatibility of the secvar implementation.
+  This includes the basic behavior of the API (excluding the data format),
+  and the expected device tree properties contained in this node.
+
+- format
+
+  Usage:
+    required
+  Value type:
+    string
+
+  This property defines the format of data passed in and out of the secvar
+  API. In most cases, this should be the same string as the backend-specific
+  string in compatible.
+
+  The format defined by this string should be documented by the corresponding
+  backend.
+
 - status
 
   Usage:
@@ -119,7 +138,7 @@ Example
 .. code-block:: dts
 
 	/ibm,opal/secvar {
-		compatible = "ibm,edk2-compat-v1";
+		compatible = "ibm,secvar-backend" "ibm,edk2-compat-v1";
 
                 status = "okay";
                 max-var-size = <0x1000>;
diff --git a/libstb/secvar/secvar_devtree.c b/libstb/secvar/secvar_devtree.c
index 5489db76..4bff1392 100644
--- a/libstb/secvar/secvar_devtree.c
+++ b/libstb/secvar/secvar_devtree.c
@@ -37,7 +37,8 @@ void secvar_init_devnode(const char *compatible)
 
 	secvar_node = dt_new(sb_root, "secvar");
 
-	dt_add_property_string(secvar_node, "compatible", compatible);
+	dt_add_property_strings(secvar_node, "compatible", "ibm,secvar-backend", compatible);
+	dt_add_property_string(secvar_node, "format", compatible);
 	dt_add_property_u64(secvar_node, "max-var-size", secvar_storage.max_var_size);
 	dt_add_property_u64(secvar_node, "max-var-key-len", SECVAR_MAX_KEY_LEN);
 }
-- 
2.21.0



More information about the Skiboot mailing list