
Changes in v2: - split the original patch in 3 parts - add function comments - drop #ifdefs around asm/cache.h includes - drop reserve_mmu function and leave only arch_reserve_mmu
For the following suggestion: "Can you please try to use if() instead of #if as much as possible?"
I tried replacing in reserve_mmu #if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) with if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) { ... } but it caused compile issues on different arm platforms such as: ... arch/arm/lib/cache.c: In function 'arm_reserve_mmu': arch/arm/lib/cache.c:134:11: error: 'volatile struct arch_global_data' has no member named 'tlb_size' gd->arch.tlb_size = PGTABLE_SIZE; ^ arch/arm/lib/cache.c:135:28: error: 'volatile struct arch_global_data' has no member named 'tlb_size' gd->relocaddr -= gd->arch.tlb_size; ^ arch/arm/lib/cache.c:140:11: error: 'volatile struct arch_global_data' has no member named 'tlb_addr' gd->arch.tlb_addr = gd->relocaddr; In file included from include/common.h:34:0, from arch/arm/lib/cache.c:9: arch/arm/lib/cache.c:141:52: error: 'volatile struct arch_global_data' has no member named 'tlb_addr' ...
Ovidiu Panait (3): common/board_f: Move arm-specific reserve_mmu to arch/arm/lib/cache.c arm: asm/cache.c: Introduce arm_reserve_mmu common/board_f: Make reserve_mmu generic
arch/arm/include/asm/cache.h | 11 +++++++++++ arch/arm/lib/cache.c | 33 +++++++++++++++++++++++++++++++++ arch/arm/mach-versal/cpu.c | 3 ++- arch/arm/mach-zynqmp/cpu.c | 3 ++- common/board_f.c | 29 ++--------------------------- include/init.h | 13 ++++++++++++- 6 files changed, 62 insertions(+), 30 deletions(-)