From 218a9917d6f0b11c41189ceb649cf04201325daf Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Wed, 18 Jan 2023 17:38:21 +0200 Subject: [PATCH 1/4] tee: optee: fix a print error on rng probing If we fail to probe the optee-rng device, we print a wrong message referring to the firmware tpm. Fixes: 476a3d58dfeb ("tee: optee: don't fail probe because of optee-rng") Reviewed-by: Patrick Delaunay Reviewed-by: Etienne Carriere Reviewed-by: Jens Wiklander Signed-off-by: Ilias Apalodimas --- drivers/tee/optee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index a813a84a4f..88e23d252b 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -850,7 +850,7 @@ static int optee_probe(struct udevice *dev) ret = device_bind_driver_to_node(dev, "optee-rng", "optee-rng", dev_ofnode(dev), NULL); if (ret) - dev_warn(dev, "ftpm_tee failed to bind: %d\n", ret); + dev_warn(dev, "optee-rng failed to bind: %d\n", ret); } return 0; From 8aedcaf9918403a550a1c108092bba7f73ccd0c9 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 19 Jan 2023 17:10:57 +0200 Subject: [PATCH 2/4] MAINTAINERS: add a new entry on TEE MAINTAINERS Since I do have a look on TEE patches regardless and Jens doesn't have his own tree, add myself as a co-maintainer. I'll be carrying over the TEE related patches from now on. While at it add the maintenance tree for TPM Reviewed-by: Jens Wiklander Signed-off-by: Ilias Apalodimas --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2de50ccfc..8dcce886b8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1452,6 +1452,7 @@ F: configs/j721s2_hs_evm_r5_defconfig TPM DRIVERS M: Ilias Apalodimas S: Maintained +T: git https://source.denx.de/u-boot/custodians/u-boot-tpm.git F: drivers/tpm/ TQ GROUP @@ -1461,6 +1462,8 @@ T: git git://git.denx.de/u-boot-tq-group.git TEE M: Jens Wiklander +M: Ilias Apalodimas +T: git https://source.denx.de/u-boot/custodians/u-boot-tpm.git S: Maintained F: drivers/tee/ F: include/tee.h From 9d28f67c8153ce2eaea21b2f3b7810a1aa8fce6d Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 19 Jan 2023 16:36:12 +0200 Subject: [PATCH 3/4] tpm2: ftpm: add the device in the OP-TEE services list commit fe8a4ed0111073 ("tee: optee: discover services dependent on tee-supplicant") is trying to automatically scan and add TAs that are presented on pseudo bus from the secure world. In order to be able to list and compare the scanned devices the available drivers have to register themselves on the op-tee service list. Acked-by: Etienne Carriere Reviewed-by: Jens Wiklander Signed-off-by: Ilias Apalodimas --- drivers/tpm/tpm2_ftpm_tee.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tpm/tpm2_ftpm_tee.c b/drivers/tpm/tpm2_ftpm_tee.c index 3c4c12983d..c61ff2c2af 100644 --- a/drivers/tpm/tpm2_ftpm_tee.c +++ b/drivers/tpm/tpm2_ftpm_tee.c @@ -18,10 +18,13 @@ #include #include #include +#include #include "tpm_tis.h" #include "tpm2_ftpm_tee.h" +OPTEE_SERVICE_DRIVER(optee_ftpm, TA_FTPM_UUID, "ftpm_tee"); + /** * ftpm_tee_transceive() - send fTPM commands and retrieve fTPM response. * @sendbuf - address of the data to send, byte by byte From eda976d36a37d459da5908fb922173a4bafe8666 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 19 Jan 2023 11:21:37 +0200 Subject: [PATCH 4/4] tee: optee: fix uuid comparisons on service discovery When comparing UUIDs for discovered services we only compare up to the ptr size instead of the entire UUID Fixes: 94ccfb78a4d61 ("drivers: tee: optee: discover OP-TEE services") Signed-off-by: Ilias Apalodimas Reviewed-by: Etienne Carriere Reviewed-by: Jens Wiklander --- drivers/tee/optee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 88e23d252b..9a9b697e91 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -73,7 +73,7 @@ static struct optee_service *find_service_driver(const struct tee_optee_ta_uuid for (idx = 0; idx < service_cnt; idx++, service++) { tee_optee_ta_uuid_to_octets(loc_uuid, &service->uuid); - if (!memcmp(uuid, loc_uuid, sizeof(uuid))) + if (!memcmp(uuid, loc_uuid, sizeof(*uuid))) return service; }