diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2018-09-25 16:40:15 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-10-07 10:47:38 -0400 |
commit | 1cc8cc4e675e32cde76487292c8bace5fa927eee (patch) | |
tree | 1b0d3f82ae5d0b34ec92047a6c4e950daa124fae /drivers | |
parent | 232cfd6d9152fd2a4e7113faec51db2a9ab8c6bd (diff) | |
download | u-boot-1cc8cc4e675e32cde76487292c8bace5fa927eee.zip u-boot-1cc8cc4e675e32cde76487292c8bace5fa927eee.tar.gz u-boot-1cc8cc4e675e32cde76487292c8bace5fa927eee.tar.bz2 |
tee: optee: support AVB trusted application
Adds configuration option OPTEE_TA_AVB and a header file describing the
interface to the Android Verified Boot 2.0 (AVB) trusted application
provided by OP-TEE.
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tee/optee/Kconfig | 16 | ||||
-rw-r--r-- | drivers/tee/tee-uclass.c | 24 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/tee/optee/Kconfig b/drivers/tee/optee/Kconfig index 7484e6f..dbfa784 100644 --- a/drivers/tee/optee/Kconfig +++ b/drivers/tee/optee/Kconfig @@ -9,3 +9,19 @@ config OPTEE mechanism. This driver can request services from OP-TEE, but also handle Remote Procedure Calls (RPC) from OP-TEE needed to execute a service. For more information see: https://www.op-tee.org + +if OPTEE + +menu "OP-TEE options" + +config OPTEE_TA_AVB + bool "Support AVB TA" + default y + help + Enables support for the AVB Trusted Application (TA) in OP-TEE. + The TA can support the "avb" subcommands "read_rb", "write"rb" + and "is_unlocked". + +endmenu + +endif diff --git a/drivers/tee/tee-uclass.c b/drivers/tee/tee-uclass.c index 1bee54e..abb88c0 100644 --- a/drivers/tee/tee-uclass.c +++ b/drivers/tee/tee-uclass.c @@ -207,3 +207,27 @@ UCLASS_DRIVER(tee) = { .pre_probe = tee_pre_probe, .pre_remove = tee_pre_remove, }; + +void tee_optee_ta_uuid_from_octets(struct tee_optee_ta_uuid *d, + const u8 s[TEE_UUID_LEN]) +{ + d->time_low = ((u32)s[0] << 24) | ((u32)s[1] << 16) | + ((u32)s[2] << 8) | s[3], + d->time_mid = ((u32)s[4] << 8) | s[5]; + d->time_hi_and_version = ((u32)s[6] << 8) | s[7]; + memcpy(d->clock_seq_and_node, s + 8, sizeof(d->clock_seq_and_node)); +} + +void tee_optee_ta_uuid_to_octets(u8 d[TEE_UUID_LEN], + const struct tee_optee_ta_uuid *s) +{ + d[0] = s->time_low >> 24; + d[1] = s->time_low >> 16; + d[2] = s->time_low >> 8; + d[3] = s->time_low; + d[4] = s->time_mid >> 8; + d[5] = s->time_mid; + d[6] = s->time_hi_and_version >> 8; + d[7] = s->time_hi_and_version; + memcpy(d + 8, s->clock_seq_and_node, sizeof(s->clock_seq_and_node)); +} |