From 04dd17822334871b23ea2862f7798fb0e0007777 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Sat, 11 May 2024 08:53:19 +0000 Subject: [PATCH] change otg to host mode --- 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