From 093a6c67005148ae32a5c9e4553491b9f5c2457b Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 07:40:51 +0000
Subject: [PATCH] disable kernel build waring

---
 u-boot/lib/optee_clientApi/OpteeClientInterface.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/u-boot/lib/optee_clientApi/OpteeClientInterface.c b/u-boot/lib/optee_clientApi/OpteeClientInterface.c
index c16a460..9f2022b 100644
--- a/u-boot/lib/optee_clientApi/OpteeClientInterface.c
+++ b/u-boot/lib/optee_clientApi/OpteeClientInterface.c
@@ -73,6 +73,20 @@
 	flush_cache(aligned_input, aligned_len);
 }
 
+static void crypto_invalidate_cacheline(uint32_t addr, uint32_t size)
+{
+	ulong alignment = CONFIG_SYS_CACHELINE_SIZE;
+	ulong aligned_input, aligned_len;
+
+	if (!addr || !size)
+		return;
+
+	/* Must invalidate dcache after crypto DMA write data region */
+	aligned_input = round_down(addr, alignment);
+	aligned_len = round_up(size + (addr - aligned_input), alignment);
+	invalidate_dcache_range(aligned_input, aligned_input + aligned_len);
+}
+
 static uint32_t trusty_base_write_security_data(char *filename,
 						uint32_t filename_size,
 						uint8_t *data,
@@ -1014,6 +1028,8 @@
 					&TeecOperation,
 					&ErrorOrigin);
 
+	crypto_invalidate_cacheline(dst_phys_addr, len);
+
 exit:
 	TEEC_ReleaseSharedMemory(&SharedMem_config);
 	TEEC_CloseSession(&TeecSession);

--
Gitblit v1.6.2