diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2015-05-27 15:15:15 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-06-21 21:52:41 +0200 |
commit | 3bcb03f3a7160e411c5f335028a5c70b32f0edb7 (patch) | |
tree | 74abe01f8ee04361686a6e1c9330858868849f6c /arch/mips/mm/tlb-r3k.c | |
parent | MIPS: tlb-r3k: Also invalidate wired TLB entries on boot (diff) | |
download | linux-3bcb03f3a7160e411c5f335028a5c70b32f0edb7.tar.xz linux-3bcb03f3a7160e411c5f335028a5c70b32f0edb7.zip |
MIPS: tlb-r3k: Move CP0.Wired register initialisation to `tlb_init'
Move the initialisation of the CP0.Wired register implemented by Toshiba
TX3922 and TX3927 processors from `tx39_cache_init' to `tlb_init' where
it belongs, correcting code structure and making sure initialisation
does not rely on `tx39_cache_init' being called before `tlb_init' to
work correctly.
Make `r3k_have_wired_reg' static as it's no longer externally referred
to; remove a stale declaration too.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10195/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/tlb-r3k.c')
-rw-r--r-- | arch/mips/mm/tlb-r3k.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c index b34b75d62a73..49b7132069d0 100644 --- a/arch/mips/mm/tlb-r3k.c +++ b/arch/mips/mm/tlb-r3k.c @@ -36,7 +36,7 @@ extern void build_tlb_refill_handler(void); "nop\n\t" \ ".set pop\n\t") -int r3k_have_wired_reg; /* should be in cpu_data? */ +static int r3k_have_wired_reg; /* Should be in cpu_data? */ /* TLB operations. */ static void local_flush_tlb_from(int entry) @@ -280,6 +280,13 @@ void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, void tlb_init(void) { + switch (current_cpu_type()) { + case CPU_TX3922: + case CPU_TX3927: + r3k_have_wired_reg = 1; + write_c0_wired(0); /* Set to 8 on reset... */ + break; + } local_flush_tlb_from(0); build_tlb_refill_handler(); } |