cache: Check dcache availability before calling cache functions
authorBoon Khai Ng <boon.khai.ng@altera.com>
Thu, 14 Aug 2025 03:17:40 +0000 (11:17 +0800)
committerTien Fong Chee <tien.fong.chee@intel.com>
Tue, 30 Sep 2025 06:29:55 +0000 (14:29 +0800)
commit38d49808d4cd51e8972bfe7478db03325118d553
tree477b351ad3cc30e50a4d89813eca17094ae21d8d
parentc4e9554015ebe919a480a54e508461af7a3e9fc8
cache: Check dcache availability before calling cache functions

When the data cache (dcache) is disabled, calling related
status functions can lead to compilation errors due to
undefined references.

Adding a !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) check before
invoking dcache_status() (used in common/memsize.c:get_ram_size())
and mmu_status() (from arch/arm/include/asm/io.h).

Without this check, builds with dcache disabled will fail to compile.

Signed-off-by: Boon Khai Ng <boon.khai.ng@altera.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/include/asm/io.h
common/memsize.c