diff options
author | Rouven Czerwinski <r.czerwinski@pengutronix.de> | 2020-01-28 06:38:18 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-01-28 10:22:27 +0100 |
commit | c3474d0f77324a15c503551dc79fdf2ef891876f (patch) | |
tree | adb1cf5276c21735fc9b80d9c8bd36663a8a779b /arch | |
parent | ee8960aec018df2ded4ac28776243bda0b633d67 (diff) | |
download | barebox-c3474d0f77324a15c503551dc79fdf2ef891876f.tar.gz barebox-c3474d0f77324a15c503551dc79fdf2ef891876f.tar.xz |
optee: move optee_verify_header() to common
Subsequent patches will use this to verify the header in the PBL, move
it to common to make it potentially available for both.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/lib32/bootm.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c index 180624445d..d64e705c40 100644 --- a/arch/arm/lib32/bootm.c +++ b/arch/arm/lib32/bootm.c @@ -137,16 +137,10 @@ static int get_kernel_addresses(size_t image_size, static int optee_verify_header_request_region(struct image_data *data, struct optee_header *hdr) { int ret = 0; - if (hdr->magic != OPTEE_MAGIC) { - pr_err("Invalid header magic 0x%08x, expected 0x%08x\n", - hdr->magic, OPTEE_MAGIC); - return -EINVAL; - } - if (hdr->arch != OPTEE_ARCH_ARM32 || hdr->init_load_addr_hi) { - pr_err("Only 32bit supported\n"); - return -EINVAL; - } + ret = optee_verify_header(hdr); + if (ret < 0) + return ret; data->tee_res = request_sdram_region("TEE", hdr->init_load_addr_lo, hdr->init_size); if (!data->tee_res) { |