]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
firmware: scmi: use PAGE_SIZE alignment for ARM64
authorPeng Fan <peng.fan@nxp.com>
Fri, 26 Sep 2025 16:06:18 +0000 (00:06 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 9 Oct 2025 20:16:11 +0000 (14:16 -0600)
For ARMv7, the alignment could be SECTION size. But for ARM64, use
PAGE_SIZE.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/firmware/scmi/smt.c

index 5eb78387344dd874fe3cc3fea38a0586ae149ef4..237871559f01b4ecf8079f943b666000d5059535 100644 (file)
@@ -62,11 +62,17 @@ int scmi_dt_get_smt_buffer(struct udevice *dev, struct scmi_smt *smt)
                scmi_smt_enable_intr(smt, true);
 
 #ifdef CONFIG_ARM
-       if (dcache_status())
-               mmu_set_region_dcache_behaviour(ALIGN_DOWN((uintptr_t)smt->buf, MMU_SECTION_SIZE),
-                                               ALIGN(smt->size, MMU_SECTION_SIZE),
-                                               DCACHE_OFF);
+       if (dcache_status()) {
+               u32 align_size;
 
+               if (IS_ENABLED(CONFIG_ARM64))
+                       align_size = PAGE_SIZE;
+               else
+                       align_size = MMU_SECTION_SIZE;
+
+               mmu_set_region_dcache_behaviour(ALIGN_DOWN((uintptr_t)smt->buf, align_size),
+                                               ALIGN(smt->size, align_size), DCACHE_OFF);
+       }
 #endif
 
        return 0;