[U-Boot] arm: mach-omap2: Relax checks on OP-TEE location to allow pageable image

Message ID 20170913182744.8309-1-afd@ti.com
State Accepted
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot] arm: mach-omap2: Relax checks on OP-TEE location to allow pageable image
Related show

Commit Message

Andrew F. Davis Sept. 13, 2017, 6:27 p.m.
From: Harinarayan Bhatta <harinarayan@ti.com>

When the OP-TEE image is built for secure paging the load address may be
in SRAM, remove checks that prevent this.

Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 arch/arm/mach-omap2/sec-common.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Lokesh Vutla Sept. 14, 2017, 3:55 a.m. | #1
On Wednesday 13 September 2017 11:57 PM, Andrew F. Davis wrote:
> From: Harinarayan Bhatta <harinarayan@ti.com>
> 
> When the OP-TEE image is built for secure paging the load address may be
> in SRAM, remove checks that prevent this.
> 
> Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
> Signed-off-by: Andrew F. Davis <afd@ti.com>

Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

Thanks and regards,
Lokesh
Tom Rini Sept. 16, 2017, 2:32 a.m. | #2
On Wed, Sep 13, 2017 at 01:27:44PM -0500, Andrew F. Davis wrote:

> From: Harinarayan Bhatta <harinarayan@ti.com>
> 
> When the OP-TEE image is built for secure paging the load address may be
> in SRAM, remove checks that prevent this.
> 
> Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

Applied to u-boot/master, thanks!

Patch

diff --git a/arch/arm/mach-omap2/sec-common.c b/arch/arm/mach-omap2/sec-common.c
index 2d54a3165e..52e1785b4a 100644
--- a/arch/arm/mach-omap2/sec-common.c
+++ b/arch/arm/mach-omap2/sec-common.c
@@ -305,12 +305,8 @@  int secure_tee_install(u32 addr)
 
 	if ((hdr->magic != OPTEE_MAGIC) ||
 	    (hdr->version != OPTEE_VERSION) ||
-	    (hdr->init_load_addr_hi != 0) ||
-	    (hdr->init_load_addr_lo < (sec_mem_start + sizeof(struct optee_header))) ||
-	    (tee_file_size > size) ||
-	    ((hdr->init_load_addr_lo + tee_file_size - 1) >
-	     (sec_mem_start + size - 1))) {
-		printf("Error in TEE header. Check load address and sizes\n");
+	    (tee_file_size > size)) {
+		printf("Error in TEE header. Check firewall and TEE sizes\n");
 		unmap_sysmem(hdr);
 		return CMD_RET_FAILURE;
 	}