aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/srmmu.c
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/mm/srmmu.c
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/mm/srmmu.c')
-rw-r--r--arch/sparc/mm/srmmu.c25
1 files changed, 21 insertions, 4 deletions
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