Author: marcel
Date: Sat Oct 25 03:36:21 2008
New Revision: 184244
URL: http://svn.freebsd.org/changeset/base/184244

Log:
  In mmu_booke_mapdev(), handle mappings that cannot be represented
  by a single TLB entry. The boot ROM on the MPC85555CDS is 8MB, for
  example, and in order to map that we need 2 4MB TLB entries.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c       Sat Oct 25 03:06:47 2008        
(r184243)
+++ head/sys/powerpc/booke/pmap.c       Sat Oct 25 03:36:21 2008        
(r184244)
@@ -2296,14 +2296,25 @@ mmu_booke_dev_direct_mapped(mmu_t mmu, v
 static void *
 mmu_booke_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size)
 {
+       void *res;
        uintptr_t va;
+       vm_size_t sz;
 
        va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa);
-       if (bootverbose)
-               printf("Wiring VA=%x to PA=%x (size=%x), using TLB1[%d]\n",
-                   va, pa, size, tlb1_idx);
-       tlb1_set_entry(va, pa, size, _TLB_ENTRY_IO);
-       return ((void *)va);
+       res = (void *)va;
+
+       do {
+               sz = 1 << (ilog2(size) & ~1);
+               if (bootverbose)
+                       printf("Wiring VA=%x to PA=%x (size=%x), "
+                           "using TLB1[%d]\n", va, pa, sz, tlb1_idx);
+               tlb1_set_entry(va, pa, sz, _TLB_ENTRY_IO);
+               size -= sz;
+               pa += sz;
+               va += sz;
+       } while (size > 0);
+
+       return (res);
 }
 
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to