ARM: invalidate caches thoroughly
The data caches should be invalided once during startup. This should also be done when we do not have the MMU enabled in barebox because the Kernel does not invalidate the caches during start. To make this sure this patch enables the arm_early_mmu_cache_invalidate function even if MMU support is disabled. Additionally this patch adds calls to arm_early_mmu_cache_invalidate in start.c and uncompress.c. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
fe4117357f
commit
e0be72d3cd
|
@ -10,7 +10,7 @@ obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o
|
|||
obj-$(CONFIG_CMD_ARM_MMUINFO) += mmuinfo.o
|
||||
obj-$(CONFIG_OFDEVICE) += dtb.o
|
||||
obj-$(CONFIG_MMU) += mmu.o cache.o mmu-early.o
|
||||
pbl-$(CONFIG_MMU) += cache.o mmu-early.o
|
||||
pbl-$(CONFIG_MMU) += mmu-early.o
|
||||
obj-$(CONFIG_CPU_32v4T) += cache-armv4.o
|
||||
pbl-$(CONFIG_CPU_32v4T) += cache-armv4.o
|
||||
obj-$(CONFIG_CPU_32v5) += cache-armv5.o
|
||||
|
@ -25,7 +25,7 @@ pbl-y += setupc.o
|
|||
pbl-$(CONFIG_PBL_SINGLE_IMAGE) += start-pbl.o
|
||||
pbl-$(CONFIG_PBL_MULTI_IMAGES) += start-images.o uncompress.o
|
||||
|
||||
obj-y += common.o
|
||||
pbl-y += common.o
|
||||
obj-y += common.o cache.o
|
||||
pbl-y += common.o cache.o
|
||||
|
||||
lwl-y += lowlevel.o
|
||||
|
|
|
@ -70,8 +70,10 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
|
|||
endmem &= ~0x3fff;
|
||||
endmem -= SZ_16K; /* ttb */
|
||||
|
||||
if (!IS_ENABLED(CONFIG_PBL_IMAGE))
|
||||
if (!IS_ENABLED(CONFIG_PBL_IMAGE)) {
|
||||
arm_early_mmu_cache_invalidate();
|
||||
mmu_early_enable(membase, memsize, endmem);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -54,6 +54,8 @@ static void noinline uncompress(uint32_t membase,
|
|||
uint32_t *ptr;
|
||||
void *pg_start;
|
||||
|
||||
arm_early_mmu_cache_invalidate();
|
||||
|
||||
endmem -= STACK_SIZE; /* stack */
|
||||
|
||||
if (IS_ENABLED(CONFIG_PBL_RELOCATABLE))
|
||||
|
|
|
@ -8,17 +8,7 @@ static inline void flush_icache(void)
|
|||
|
||||
int arm_set_cache_functions(void);
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
void arm_early_mmu_cache_flush(void);
|
||||
void arm_early_mmu_cache_invalidate(void);
|
||||
#else
|
||||
static inline void arm_early_mmu_cache_flush(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void arm_early_mmu_cache_invalidate(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue