diff options
author | Konrad Eisele <konrad@gaisler.com> | 2009-08-16 20:13:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-17 21:32:11 -0400 |
commit | 75d9e34698540e96b422293e1d76ab02cc7faefb (patch) | |
tree | af7e037f1b3d59af4b2c53b5d7381afb82f3664e /arch/sparc/mm/srmmu.c | |
parent | e63829de3d03f92cea2b26119e0aa9a7043b9913 (diff) |
sparc, leon: sparc-leon specific SRMMU initialization and bootup fixes.
The sparc-leon caches are virtually tagged so a flush is needed on ctx
switch.
Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/srmmu.c')
-rw-r--r-- | arch/sparc/mm/srmmu.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index ade4eb373bdd..509b1ffeba66 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <asm/tsunami.h> | 46 | #include <asm/tsunami.h> |
47 | #include <asm/swift.h> | 47 | #include <asm/swift.h> |
48 | #include <asm/turbosparc.h> | 48 | #include <asm/turbosparc.h> |
49 | #include <asm/leon.h> | ||
49 | 50 | ||
50 | #include <asm/btfixup.h> | 51 | #include <asm/btfixup.h> |
51 | 52 | ||
@@ -569,6 +570,9 @@ static void srmmu_switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, | |||
569 | srmmu_ctxd_set(&srmmu_context_table[mm->context], mm->pgd); | 570 | srmmu_ctxd_set(&srmmu_context_table[mm->context], mm->pgd); |
570 | } | 571 | } |
571 | 572 | ||
573 | if (sparc_cpu_model == sparc_leon) | ||
574 | leon_switch_mm(); | ||
575 | |||
572 | if (is_hypersparc) | 576 | if (is_hypersparc) |
573 | hyper_flush_whole_icache(); | 577 | hyper_flush_whole_icache(); |
574 | 578 | ||
@@ -1977,6 +1981,45 @@ static void __init init_viking(void) | |||
1977 | poke_srmmu = poke_viking; | 1981 | poke_srmmu = poke_viking; |
1978 | } | 1982 | } |
1979 | 1983 | ||
1984 | #ifdef CONFIG_SPARC_LEON | ||
1985 | |||
1986 | void __init poke_leonsparc(void) | ||
1987 | { | ||
1988 | } | ||
1989 | |||
1990 | void __init init_leon(void) | ||
1991 | { | ||
1992 | |||
1993 | srmmu_name = "Leon"; | ||
1994 | |||
1995 | BTFIXUPSET_CALL(flush_cache_all, leon_flush_cache_all, | ||
1996 | BTFIXUPCALL_NORM); | ||
1997 | BTFIXUPSET_CALL(flush_cache_mm, leon_flush_cache_all, | ||
1998 | BTFIXUPCALL_NORM); | ||
1999 | BTFIXUPSET_CALL(flush_cache_page, leon_flush_pcache_all, | ||
2000 | BTFIXUPCALL_NORM); | ||
2001 | BTFIXUPSET_CALL(flush_cache_range, leon_flush_cache_all, | ||
2002 | BTFIXUPCALL_NORM); | ||
2003 | BTFIXUPSET_CALL(flush_page_for_dma, leon_flush_dcache_all, | ||
2004 | BTFIXUPCALL_NORM); | ||
2005 | |||
2006 | BTFIXUPSET_CALL(flush_tlb_all, leon_flush_tlb_all, BTFIXUPCALL_NORM); | ||
2007 | BTFIXUPSET_CALL(flush_tlb_mm, leon_flush_tlb_all, BTFIXUPCALL_NORM); | ||
2008 | BTFIXUPSET_CALL(flush_tlb_page, leon_flush_tlb_all, BTFIXUPCALL_NORM); | ||
2009 | BTFIXUPSET_CALL(flush_tlb_range, leon_flush_tlb_all, BTFIXUPCALL_NORM); | ||
2010 | |||
2011 | BTFIXUPSET_CALL(__flush_page_to_ram, leon_flush_cache_all, | ||
2012 | BTFIXUPCALL_NOP); | ||
2013 | BTFIXUPSET_CALL(flush_sig_insns, leon_flush_cache_all, BTFIXUPCALL_NOP); | ||
2014 | |||
2015 | poke_srmmu = poke_leonsparc; | ||
2016 | |||
2017 | srmmu_cache_pagetables = 0; | ||
2018 | |||
2019 | leon_flush_during_switch = leon_flush_needed(); | ||
2020 | } | ||
2021 | #endif | ||
2022 | |||
1980 | /* Probe for the srmmu chip version. */ | 2023 | /* Probe for the srmmu chip version. */ |
1981 | static void __init get_srmmu_type(void) | 2024 | static void __init get_srmmu_type(void) |
1982 | { | 2025 | { |
@@ -1992,7 +2035,15 @@ static void __init get_srmmu_type(void) | |||
1992 | psr_typ = (psr >> 28) & 0xf; | 2035 | psr_typ = (psr >> 28) & 0xf; |
1993 | psr_vers = (psr >> 24) & 0xf; | 2036 | psr_vers = (psr >> 24) & 0xf; |
1994 | 2037 | ||
1995 | /* First, check for HyperSparc or Cypress. */ | 2038 | /* First, check for sparc-leon. */ |
2039 | if (sparc_cpu_model == sparc_leon) { | ||
2040 | psr_typ = 0xf; /* hardcoded ids for older models/simulators */ | ||
2041 | psr_vers = 2; | ||
2042 | init_leon(); | ||
2043 | return; | ||
2044 | } | ||
2045 | |||
2046 | /* Second, check for HyperSparc or Cypress. */ | ||
1996 | if(mod_typ == 1) { | 2047 | if(mod_typ == 1) { |
1997 | switch(mod_rev) { | 2048 | switch(mod_rev) { |
1998 | case 7: | 2049 | case 7: |