Commit 6ed67659b93f9b3190558845c20faea1447ae4ce
Committed by
Andreas Bießmann
1 parent
806a5a3958
Exists in
v2017.01-smarct4x
and in
25 other branches
arm, at91: add icache support
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>
Showing 3 changed files with 30 additions and 6 deletions Side-by-side Diff
arch/arm/mach-at91/arm926ejs/Makefile
arch/arm/mach-at91/arm926ejs/cache.c
1 | +/* | |
2 | + * (C) Copyright 2016 | |
3 | + * Heiko Schocher, DENX Software Engineering, hs@denx.de. | |
4 | + * | |
5 | + * SPDX-License-Identifier: GPL-2.0+ | |
6 | + */ | |
7 | +#include <linux/types.h> | |
8 | +#include <common.h> | |
9 | + | |
10 | +void enable_caches(void) | |
11 | +{ | |
12 | +#ifndef CONFIG_SYS_ICACHE_OFF | |
13 | + icache_enable(); | |
14 | +#endif | |
15 | +} | |
16 | + | |
17 | +#ifndef CONFIG_SYS_ICACHE_OFF | |
18 | +/* Invalidate entire I-cache and branch predictor array */ | |
19 | +void invalidate_icache_all(void) | |
20 | +{ | |
21 | + unsigned long i = 0; | |
22 | + | |
23 | + asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i)); | |
24 | +} | |
25 | +#else | |
26 | +void invalidate_icache_all(void) | |
27 | +{ | |
28 | +} | |
29 | +#endif |
board/bluewater/gurnard/gurnard.c