summaryrefslogtreecommitdiff
path: root/drivers/tee
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2022-03-29 14:21:24 +0200
committerTom Rini <trini@konsulko.com>2022-04-11 10:28:04 -0400
commit70812bb83da61decfd824482e9767db56b2cc932 (patch)
treed8e4654c35fb0bd1e23b5da3d7972f45dc0b8f5d /drivers/tee
parentfd52e7f9c775b71f64c4348703a7cc60f5fc8cf8 (diff)
tee: optee: bind rng optee driver
In U-Boot, the discovery of TA based on its UUID on the TEE bus is not supported. This patch only binds the driver associated to the new supported OP-TEE TA = TA_HWRNG when this driver is enable. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'drivers/tee')
-rw-r--r--drivers/tee/optee/core.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index dad46aa388..a89d62aaf0 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -7,6 +7,7 @@
#include <cpu_func.h>
#include <dm.h>
#include <dm/device_compat.h>
+#include <dm/lists.h>
#include <log.h>
#include <malloc.h>
#include <tee.h>
@@ -641,6 +642,8 @@ static int optee_probe(struct udevice *dev)
{
struct optee_pdata *pdata = dev_get_plat(dev);
u32 sec_caps;
+ struct udevice *child;
+ int ret;
if (!is_optee_api(pdata->invoke_fn)) {
dev_err(dev, "OP-TEE api uid mismatch\n");
@@ -665,6 +668,16 @@ static int optee_probe(struct udevice *dev)
return -ENOENT;
}
+ /*
+ * in U-Boot, the discovery of TA on the TEE bus is not supported:
+ * only bind the drivers associated to the supported OP-TEE TA
+ */
+ if (IS_ENABLED(CONFIG_RNG_OPTEE)) {
+ ret = device_bind_driver(dev, "optee-rng", "optee-rng", &child);
+ if (ret)
+ return ret;
+ }
+
return 0;
}