mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-12 07:57:21 +00:00
95c6f6d34d
Add data cache support for ARM V7 systems. Used cache flush functions from linux:arch/arm/mm/cache-v7.S developed from Catalin Marinas. Enable "cache" command on Beagle board and test performance. Test 1: Loading 127 MB of data from NAND flash into RAM: Instr. Cache off on on Data Cache off off on -------------------------------------------------- Beagle (Cortex A8) 116s 106s 30.3s = x 3.8 Test 2: uncompressing a gzipped image from RAM to RAM (size compressed: 6.5 MiB, uncompressed: 35 MiB): Instr. Cache off on on Data Cache off off on -------------------------------------------------- Beagle (Cortex A8) 1.84s 1.64s 0.12s = x 15.3 Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Ben Gardiner<bengardiner@nanometrics.ca>
47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
/*
|
|
* (C) Copyright 2002
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
*
|
|
* See file CREDITS for list of people who contributed to this
|
|
* project.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 of
|
|
* the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
* MA 02111-1307 USA
|
|
*/
|
|
|
|
/* for now: just dummy functions to satisfy the linker */
|
|
|
|
#include <common.h>
|
|
|
|
void flush_cache (unsigned long dummy1, unsigned long dummy2)
|
|
{
|
|
#ifdef CONFIG_OMAP2420
|
|
void arm1136_cache_flush(void);
|
|
|
|
arm1136_cache_flush();
|
|
#endif
|
|
#ifdef CONFIG_ARM926EJS
|
|
/* test and clean, page 2-23 of arm926ejs manual */
|
|
asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
|
|
/* disable write buffer as well (page 2-22) */
|
|
asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
|
|
#endif
|
|
#ifdef CONFIG_ARMCORTEXA8
|
|
void v7_flush_cache_all(void);
|
|
|
|
v7_flush_cache_all();
|
|
#endif
|
|
return;
|
|
}
|