Skip to content

Commit

Permalink
secvar_devtree: add generic compatible, and new format device tree pr…
Browse files Browse the repository at this point in the history
…operty

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@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
erichte-ibm authored and oohal committed Dec 5, 2019
1 parent 9f7b726 commit a55c46d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion doc/device-tree/ibm,opal/secvar/binding.rst
Expand Up @@ -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:
Expand Down Expand Up @@ -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>;
Expand Down
3 changes: 2 additions & 1 deletion libstb/secvar/secvar_devtree.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit a55c46d

Please sign in to comment.