From 05c69cf75edf53478e23fce157fea72372b49597 Mon Sep 17 00:00:00 2001 From: Jeffrey Kardatzke Date: Mon, 3 Oct 2022 15:50:21 -0700 Subject: feat(optee): add loading OP-TEE image via an SMC This adds the ability to load the OP-TEE image via an SMC called from non-secure userspace rather than loading it during boot. This should only be utilized on platforms that can ensure security is maintained up until the point the SMC is invoked as it breaks the normal barrier between the secure and non-secure world. Signed-off-by: Jeffrey Kardatzke Change-Id: I21cfa9699617c493fa4190f01d1cbb714e7449cc --- lib/optee/optee_utils.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'lib') diff --git a/lib/optee/optee_utils.c b/lib/optee/optee_utils.c index 6c87b0d07..25272fc94 100644 --- a/lib/optee/optee_utils.c +++ b/lib/optee/optee_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2023, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,42 +11,6 @@ #include -/* - * load_addr_hi and load_addr_lo: image load address. - * image_id: 0 - pager, 1 - paged - * size: image size in bytes. - */ -typedef struct optee_image { - uint32_t load_addr_hi; - uint32_t load_addr_lo; - uint32_t image_id; - uint32_t size; -} optee_image_t; - -#define OPTEE_PAGER_IMAGE_ID 0 -#define OPTEE_PAGED_IMAGE_ID 1 - -#define OPTEE_MAX_NUM_IMAGES 2u - -#define TEE_MAGIC_NUM_OPTEE 0x4554504f -/* - * magic: header magic number. - * version: OPTEE header version: - * 1 - not supported - * 2 - supported - * arch: OPTEE os architecture type: 0 - AARCH32, 1 - AARCH64. - * flags: unused currently. - * nb_images: number of images. - */ -typedef struct optee_header { - uint32_t magic; - uint8_t version; - uint8_t arch; - uint16_t flags; - uint32_t nb_images; - optee_image_t optee_image_list[]; -} optee_header_t; - /******************************************************************************* * Check if it is a valid tee header * Return true if valid -- cgit v1.2.1