barebox/arch/arm/include/asm/cache.h
Sascha Hauer 2827883911 ARM: invalidate data caches during early init
Some SoCs come up with invalid entries in the data cache. This can
lead to memory corruption when we enable them later, so invalidate
the caches early.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Lucas Stach <l.stach@pengutronix.de>
2013-05-23 09:29:52 +02:00

25 lines
416 B
C

#ifndef __ASM_CACHE_H
#define __ASM_CACHE_H
static inline void flush_icache(void)
{
asm volatile("mcr p15, 0, %0, c7, c5, 0" : : "r" (0));
}
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