From: Simon Glass <sjg@chromium.org>
Date: Thu, 27 Jun 2024 08:29:47 +0000 (+0100)
Subject: spl: Allow ATF to work when dcache is disabled
X-Git-Tag: v2025.01-rc5-pxa1908~440^2~2
X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B%20%24style.Permalink%20%7D%7D?a=commitdiff_plain;h=024767e66dbe18971e4439b804de96f85462b3e4;p=u-boot.git

spl: Allow ATF to work when dcache is disabled

The dcache may not be enabled in SPL. Add a check to avoid trying to
use an undefined function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---

diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
index 3bdd013a35..9afe6456bc 100644
--- a/common/spl/spl_atf.c
+++ b/common/spl/spl_atf.c
@@ -204,7 +204,8 @@ static void __noreturn bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry,
 						       fdt_addr);
 
 	raw_write_daif(SPSR_EXCEPTION_MASK);
-	dcache_disable();
+	if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+		dcache_disable();
 
 	atf_entry(bl31_params, (void *)fdt_addr);
 }