From owner-svn-src-head@FreeBSD.ORG Fri May 27 23:09:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D8751065714; Fri, 27 May 2011 23:09:13 +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 2D85A8FC29; Fri, 27 May 2011 23:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RN9Dt7056851; Fri, 27 May 2011 23:09:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RN9DVq056848; Fri, 27 May 2011 23:09:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201105272309.p4RN9DVq056848@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 27 May 2011 23:09:13 +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: r222391 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 23:09:13 -0000 Author: marcel Date: Fri May 27 23:09:12 2011 New Revision: 222391 URL: http://svn.freebsd.org/changeset/base/222391 Log: Wire the kernel using TLB1 entry 0 rather than entry 1. A more recent U-Boot as found on the P1020RDB doesn't like it when we use entry 1 (for some reason) whereas an older U-Boot doesn't mind if we use entry 0. If anything else, this simplifies the code a bit. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Fri May 27 22:14:49 2011 (r222390) +++ head/sys/powerpc/booke/locore.S Fri May 27 23:09:12 2011 (r222391) @@ -148,7 +148,7 @@ __start: */ /* Final kernel mapping, map in 16 MB of RAM */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - li %r4, 1 /* Entry 1 */ + li %r4, 0 /* Entry 0 */ rlwimi %r3, %r4, 16, 12, 15 mtspr SPR_MAS0, %r3 isync @@ -318,7 +318,7 @@ kernload_ap: */ /* Final kernel mapping, map in 16 MB of RAM */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - li %r4, 1 /* Entry 1 */ + li %r4, 0 /* Entry 0 */ rlwimi %r3, %r4, 16, 4, 15 mtspr SPR_MAS0, %r3 isync @@ -490,11 +490,7 @@ tlb1_temp_mapping_as1: */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ addi %r29, %r30, 1 /* Use next entry. */ - li %r4, 1 - cmpw %r4, %r29 - bne 1f - addi %r29, %r29, 1 -1: rlwimi %r3, %r29, 16, 12, 15 /* Select temp entry */ + rlwimi %r3, %r29, 16, 12, 15 /* Select temp entry */ mtspr SPR_MAS0, %r3 isync mfspr %r5, SPR_MAS1 Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri May 27 22:14:49 2011 (r222390) +++ head/sys/powerpc/booke/pmap.c Fri May 27 23:09:12 2011 (r222391) @@ -91,9 +91,6 @@ __FBSDID("$FreeBSD$"); #include "mmu_if.h" -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) #else @@ -3019,24 +3016,18 @@ tlb1_init(vm_offset_t ccsrbar) { uint32_t mas0; - /* TLB1[1] is used to map the kernel. Save that entry. */ - mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(1); + /* TLB1[0] is used to map the kernel. Save that entry. */ + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(0); mtspr(SPR_MAS0, mas0); __asm __volatile("isync; tlbre"); - tlb1[1].mas1 = mfspr(SPR_MAS1); - tlb1[1].mas2 = mfspr(SPR_MAS2); - tlb1[1].mas3 = mfspr(SPR_MAS3); + tlb1[0].mas1 = mfspr(SPR_MAS1); + tlb1[0].mas2 = mfspr(SPR_MAS2); + tlb1[0].mas3 = mfspr(SPR_MAS3); - /* Map in CCSRBAR in TLB1[0] */ - tlb1_idx = 0; + /* Map in CCSRBAR in TLB1[1] */ + tlb1_idx = 1; tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO); - /* - * Set the next available TLB1 entry index. Note TLB[1] is reserved - * for initial mapping of kernel text+data, which was set early in - * locore, we need to skip this [busy] entry. - */ - tlb1_idx = 2; /* Setup TLB miss defaults */ set_mas4_defaults();