diff options
author | Paul Burton <paul.burton@imgtec.com> | 2016-09-21 11:18:48 +0100 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2016-09-21 15:04:04 +0200 |
commit | 8cb4817d0f076605c5126f0925f6c7fdb0461bf6 (patch) | |
tree | 2a0ee6d92cec0d877ec0a3690b8d75ddbde27168 /arch/mips/cpu | |
parent | 0dfe04d6c8a52624c5404392168e52fe70fe0dc9 (diff) | |
download | u-boot-8cb4817d0f076605c5126f0925f6c7fdb0461bf6.tar.gz u-boot-8cb4817d0f076605c5126f0925f6c7fdb0461bf6.tar.xz u-boot-8cb4817d0f076605c5126f0925f6c7fdb0461bf6.zip |
MIPS: Probe cache line sizes once during boot
Rather than probing the cache line sizes on every call of any cache
maintenance function, probe them once during boot & store the values in
the global data structure for later use. This will reduce the overhead
of the cache maintenance functions, which isn't a big deal yet but
becomes more important once L2 caches which may expose their properties
via coprocessor 2 or the CM are supported.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Diffstat (limited to 'arch/mips/cpu')
-rw-r--r-- | arch/mips/cpu/cpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/cpu/cpu.c b/arch/mips/cpu/cpu.c index 391feb3250..1b919ed822 100644 --- a/arch/mips/cpu/cpu.c +++ b/arch/mips/cpu/cpu.c @@ -8,6 +8,7 @@ #include <common.h> #include <command.h> #include <linux/compiler.h> +#include <asm/cache.h> #include <asm/mipsregs.h> #include <asm/reboot.h> @@ -35,3 +36,9 @@ void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1) write_c0_index(index); tlb_write_indexed(); } + +int arch_cpu_init(void) +{ + mips_cache_probe(); + return 0; +} |