aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Horstmann <david.horstmann@arm.com>2021-03-01 19:34:37 +0000
committerDavid Horstmann <david.horstmann@arm.com>2021-04-28 12:13:12 +0100
commitd13dbb6f1d5e28737a3319af035a6cb991bc6f8f (patch)
treed17aba423c89703ac9f61d41311315e46b5bd958 /include
parent067cb3aedf5ff1aa9255387407862118833bc276 (diff)
downloadtrusted-firmware-a-d13dbb6f1d5e28737a3319af035a6cb991bc6f8f.tar.gz
feat(fdt): introduce wrapper function to read DT UUIDs
TF-A does not have the capability to read UUIDs in string form from the device tree. This capability is useful for readability, so add a wrapper function, fdtw_read_uuid() to parse UUIDs from the DT. This function should parse a string of the form: "aabbccdd-eeff-4099-8877-665544332211" to the byte sequence in memory: [aa bb cc dd ee ff 40 99 88 77 66 55 44 33 22 11] Change-Id: I99a92fbeb40f4f4713f3458b36cb3863354d2bdf Signed-off-by: David Horstmann <david.horstmann@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/common/fdt_wrappers.h4
-rw-r--r--include/common/uuid.h15
2 files changed, 18 insertions, 1 deletions
diff --git a/include/common/fdt_wrappers.h b/include/common/fdt_wrappers.h
index a571092e36..e8b39335d4 100644
--- a/include/common/fdt_wrappers.h
+++ b/include/common/fdt_wrappers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -24,6 +24,8 @@ int fdt_read_uint32_array(const void *dtb, int node, const char *prop_name,
unsigned int cells, uint32_t *value);
int fdtw_read_string(const void *dtb, int node, const char *prop,
char *str, size_t size);
+int fdtw_read_uuid(const void *dtb, int node, const char *prop,
+ unsigned int length, uint8_t *uuid);
int fdtw_write_inplace_cells(void *dtb, int node, const char *prop,
unsigned int cells, void *value);
int fdtw_read_bytes(const void *dtb, int node, const char *prop,
diff --git a/include/common/uuid.h b/include/common/uuid.h
new file mode 100644
index 0000000000..5651d0d583
--- /dev/null
+++ b/include/common/uuid.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef UUID_H
+#define UUID_H
+
+#define UUID_BYTES_LENGTH 16
+#define UUID_STRING_LENGTH 36
+
+int read_uuid(uint8_t *dest, char *uuid);
+
+#endif /* UUID_H */