[PATCH v1 2/3] arch: arm: lib: cache_v8: agilex5: Add weak function in cache_v8
Tom Rini
trini at konsulko.com
Wed Aug 13 16:11:16 CEST 2025
On Wed, Aug 13, 2025 at 05:50:57AM +0000, Ng, Boon Khai wrote:
> Hi Tom,
>
> > > The callers of dcache_disable/etc should be doing:
> > > if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
> >
> > Hi Tom, just get to know that the spl_atf.c already implemented with the fix
> > above, will follow the fix in spl_atf.c and submit in v2
> >
> > https://github.com/u-boot/u-boot/blob/3526f990b
> > 77fca1c933f1d8b24eb9385010a05bf/common/spl/spl_atf.c#L206
> >
>
> After carefully analyzing the code, I noticed that after adding the
> if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) check and removing
> the weak function, U-Boot still fails to compile. This is because the
> config check has now shifted from being preprocessor-based to
> runtime-based.
>
> Given this, I have two points I'd like to clarify:
> 1) Retaining the Weak Function: Since the weak function effectively
> resolves the compilation issue, would it be sufficient to retain just
> the weak function declaration?
>
> 2) Config Check Necessity: If the weak function alone solves the issue by
> preventing the compilation failure, would the addition of the
> runtime-based if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) check
> still be necessary?
>
> I'd appreciate your thoughts on whether it would be acceptable to keep
> the weak function without the config check as a solution.
What does your patch and config look like that shows this problem? It's
fine to have an undefined function when if
(!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) becomes if (0) once evaluated.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250813/87ebe092/attachment.sig>
More information about the U-Boot
mailing list