]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arch: arm: mach-socfpga: smc: Add dcache flushing and invalidation in smc_send_mailbox()
authorBoon Khai Ng <boon.khai.ng@altera.com>
Thu, 14 Aug 2025 03:17:39 +0000 (11:17 +0800)
committerTien Fong Chee <tien.fong.chee@intel.com>
Tue, 30 Sep 2025 06:29:54 +0000 (14:29 +0800)
Adding the dcache flushing and invalidation in the smc_send_mailbox()
At the same time replace the use of u64 with uintptr_t to ensure
compatibility across different architectures and correct the
pointer arithmetic for buffer end address calculation.

Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Signed-off-by: Boon Khai Ng <boon.khai.ng@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
arch/arm/mach-socfpga/smc_api.c

index b212a94b32127826197923b95e93db83dfb5f3fc..a531030f5be486a45aadabddafa6c270c7837a4f 100644 (file)
@@ -57,6 +57,7 @@ int smc_send_mailbox(u32 cmd, u32 len, u32 *arg, u8 urgent, u32 *resp_buf_len,
                         resp, ARRAY_SIZE(resp));
 
        if (ret == INTEL_SIP_SMC_STATUS_OK && resp_buf && resp_buf_len) {
+               invalidate_dcache_range((uintptr_t)resp_buf, (uintptr_t)(resp_buf + *resp_buf_len));
                if (!resp[0])
                        *resp_buf_len = resp[1];
        }