mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-04 10:30:32 +00:00
6ed67659b9
add at least icache support for at91 based boards. This speeds up NOR flash access on an at91sam9g15 based board from 15.2 seconds reading 8 MiB from a SPI NOR flash to 5.7 seconds. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
29 lines
505 B
C
29 lines
505 B
C
/*
|
|
* (C) Copyright 2016
|
|
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
#include <linux/types.h>
|
|
#include <common.h>
|
|
|
|
void enable_caches(void)
|
|
{
|
|
#ifndef CONFIG_SYS_ICACHE_OFF
|
|
icache_enable();
|
|
#endif
|
|
}
|
|
|
|
#ifndef CONFIG_SYS_ICACHE_OFF
|
|
/* Invalidate entire I-cache and branch predictor array */
|
|
void invalidate_icache_all(void)
|
|
{
|
|
unsigned long i = 0;
|
|
|
|
asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i));
|
|
}
|
|
#else
|
|
void invalidate_icache_all(void)
|
|
{
|
|
}
|
|
#endif
|