From owner-svn-src-all@FreeBSD.ORG Sat Oct 25 03:36:22 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B4D106566C; Sat, 25 Oct 2008 03:36:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C508FC0C; Sat, 25 Oct 2008 03:36:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P3aMpx014392; Sat, 25 Oct 2008 03:36:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P3aLPE014391; Sat, 25 Oct 2008 03:36:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810250336.m9P3aLPE014391@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 03:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184244 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 03:36:22 -0000 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); } /*