aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-05-25 17:20:19 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-28 02:52:51 -0400
commit805918f80fb11d95e9b117a6faf5a6a7a8339e49 (patch)
tree69d2795cf73d3ad67ddc21618f2842b18efa9780 /arch/sparc
parentb0acd2495e2a7f2655b9d4c761bd09e6dd05fbc4 (diff)
sparc32: srmmu_probe now knows about leon too
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/leon.h2
-rw-r--r--arch/sparc/include/asm/pgtsrmmu.h17
-rw-r--r--arch/sparc/mm/leon_mm.c2
-rw-r--r--arch/sparc/mm/srmmu.c25
4 files changed, 23 insertions, 23 deletions
diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h
index 995c4e05be6d..ba46083ee42e 100644
--- a/arch/sparc/include/asm/leon.h
+++ b/arch/sparc/include/asm/leon.h
@@ -197,7 +197,7 @@ static inline int sparc_leon3_cpuid(void)
197#ifndef __ASSEMBLY__ 197#ifndef __ASSEMBLY__
198struct vm_area_struct; 198struct vm_area_struct;
199 199
200extern unsigned long srmmu_swprobe(unsigned long vaddr, unsigned long *paddr); 200extern unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr);
201extern void leon_flush_icache_all(void); 201extern void leon_flush_icache_all(void);
202extern void leon_flush_dcache_all(void); 202extern void leon_flush_dcache_all(void);
203extern void leon_flush_cache_all(void); 203extern void leon_flush_cache_all(void);
diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h
index 72f71214ef87..79da17866fa8 100644
--- a/arch/sparc/include/asm/pgtsrmmu.h
+++ b/arch/sparc/include/asm/pgtsrmmu.h
@@ -166,23 +166,6 @@ static inline void srmmu_flush_whole_tlb(void)
166 166
167} 167}
168 168
169/* These flush types are not available on all chips... */
170#ifndef CONFIG_SPARC_LEON
171static inline unsigned long srmmu_hwprobe(unsigned long vaddr)
172{
173 unsigned long retval;
174
175 vaddr &= PAGE_MASK;
176 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
177 "=r" (retval) :
178 "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE));
179
180 return retval;
181}
182#else
183#define srmmu_hwprobe(addr) srmmu_swprobe(addr, 0)
184#endif
185
186static inline int 169static inline int
187srmmu_get_pte (unsigned long addr) 170srmmu_get_pte (unsigned long addr)
188{ 171{
diff --git a/arch/sparc/mm/leon_mm.c b/arch/sparc/mm/leon_mm.c
index 4c67ae6e5023..5bed085a2c17 100644
--- a/arch/sparc/mm/leon_mm.c
+++ b/arch/sparc/mm/leon_mm.c
@@ -32,7 +32,7 @@ static inline unsigned long leon_get_ctable_ptr(void)
32} 32}
33 33
34 34
35unsigned long srmmu_swprobe(unsigned long vaddr, unsigned long *paddr) 35unsigned long leon_swprobe(unsigned long vaddr, unsigned long *paddr)
36{ 36{
37 37
38 unsigned int ctxtbl; 38 unsigned int ctxtbl;
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 256db6b22c54..62e3f5773303 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -646,6 +646,23 @@ static void __init srmmu_allocate_ptable_skeleton(unsigned long start,
646 } 646 }
647} 647}
648 648
649/* These flush types are not available on all chips... */
650static inline unsigned long srmmu_probe(unsigned long vaddr)
651{
652 unsigned long retval;
653
654 if (sparc_cpu_model != sparc_leon) {
655
656 vaddr &= PAGE_MASK;
657 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
658 "=r" (retval) :
659 "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE));
660 } else {
661 retval = leon_swprobe(vaddr, 0);
662 }
663 return retval;
664}
665
649/* 666/*
650 * This is much cleaner than poking around physical address space 667 * This is much cleaner than poking around physical address space
651 * looking at the prom's page table directly which is what most 668 * looking at the prom's page table directly which is what most
@@ -665,7 +682,7 @@ static void __init srmmu_inherit_prom_mappings(unsigned long start,
665 break; /* probably wrap around */ 682 break; /* probably wrap around */
666 if(start == 0xfef00000) 683 if(start == 0xfef00000)
667 start = KADB_DEBUGGER_BEGVM; 684 start = KADB_DEBUGGER_BEGVM;
668 if(!(prompte = srmmu_hwprobe(start))) { 685 if(!(prompte = srmmu_probe(start))) {
669 start += PAGE_SIZE; 686 start += PAGE_SIZE;
670 continue; 687 continue;
671 } 688 }
@@ -674,12 +691,12 @@ static void __init srmmu_inherit_prom_mappings(unsigned long start,
674 what = 0; 691 what = 0;
675 692
676 if(!(start & ~(SRMMU_REAL_PMD_MASK))) { 693 if(!(start & ~(SRMMU_REAL_PMD_MASK))) {
677 if(srmmu_hwprobe((start-PAGE_SIZE) + SRMMU_REAL_PMD_SIZE) == prompte) 694 if(srmmu_probe((start-PAGE_SIZE) + SRMMU_REAL_PMD_SIZE) == prompte)
678 what = 1; 695 what = 1;
679 } 696 }
680 697
681 if(!(start & ~(SRMMU_PGDIR_MASK))) { 698 if(!(start & ~(SRMMU_PGDIR_MASK))) {
682 if(srmmu_hwprobe((start-PAGE_SIZE) + SRMMU_PGDIR_SIZE) == 699 if(srmmu_probe((start-PAGE_SIZE) + SRMMU_PGDIR_SIZE) ==
683 prompte) 700 prompte)
684 what = 2; 701 what = 2;
685 } 702 }
@@ -1156,7 +1173,7 @@ static void turbosparc_flush_page_to_ram(unsigned long page)
1156#ifdef TURBOSPARC_WRITEBACK 1173#ifdef TURBOSPARC_WRITEBACK
1157 volatile unsigned long clear; 1174 volatile unsigned long clear;
1158 1175
1159 if (srmmu_hwprobe(page)) 1176 if (srmmu_probe(page))
1160 turbosparc_flush_page_cache(page); 1177 turbosparc_flush_page_cache(page);
1161 clear = srmmu_get_fstatus(); 1178 clear = srmmu_get_fstatus();
1162#endif 1179#endif