Commit 6ed67659b93f9b3190558845c20faea1447ae4ce

Authored by Heiko Schocher
Committed by Andreas Bießmann
1 parent 806a5a3958

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
... ... @@ -18,6 +18,7 @@
18 18 obj-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o
19 19 obj-$(CONFIG_AT91_EFLASH) += eflash.o
20 20 obj-$(CONFIG_AT91_LED) += led.o
  21 +obj-y += cache.o
21 22 obj-y += clock.o
22 23 obj-y += cpu.o
23 24 obj-y += reset.o
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
... ... @@ -414,12 +414,6 @@
414 414 {
415 415 }
416 416  
417   -/* This breaks the Ethernet MAC at present */
418   -void enable_caches(void)
419   -{
420   - dcache_enable();
421   -}
422   -
423 417 /* SPI chip select control - only used for FPGA programming */
424 418 #ifdef CONFIG_ATMEL_SPI
425 419