Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Oct 2008 03:36:21 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184244 - head/sys/powerpc/booke
Message-ID:  <200810250336.m9P3aLPE014391@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810250336.m9P3aLPE014391>