From owner-svn-src-all@FreeBSD.ORG Thu May 29 16:54:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92A4F3FD; Thu, 29 May 2014 16:54:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 804F82E52; Thu, 29 May 2014 16:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TGsFq9002386; Thu, 29 May 2014 16:54:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TGsF3Z002385; Thu, 29 May 2014 16:54:15 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201405291654.s4TGsF3Z002385@svn.freebsd.org> From: Olivier Houchard Date: Thu, 29 May 2014 16:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266849 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Thu, 29 May 2014 16:54:15 -0000 Author: cognet Date: Thu May 29 16:54:15 2014 New Revision: 266849 URL: http://svnweb.freebsd.org/changeset/base/266849 Log: For old CPUs, map the 64 first MB of RAM as it used to be. Some ports (XScale mainly) expects the memory located before the kernel to be mapped, and use it to allocate the page tables, the various stacks, etc. A better fix would probably be to rewrite the various bla_machdep.c to stop using that RAM, but I'm not so inclined to do it, especially since I don't have hardware for all of them. Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Thu May 29 16:20:34 2014 (r266848) +++ head/sys/arm/arm/locore.S Thu May 29 16:54:15 2014 (r266849) @@ -166,9 +166,32 @@ Lunmapped: ldr r1, [r0, #4] sub r0, r1, r2 +#ifndef _ARM_ARCH_6 /* - * Map PA == VA + * Some of the older ports (the various XScale, mostly) assume + * that the memory before the kernel is mapped, and use it for + * the various stacks, page tables, etc. For those CPUs, map the + * 64 first MB of RAM, as it used to be. */ + /* + * Map PA == VA + */ + ldr r5, =PHYSADDR + mov r1, r5 + mov r2, r5 + /* Map 64MiB, preserved over calls to build_pagetables */ + mov r3, #64 + bl build_pagetables + + /* Create the kernel map to jump to */ + mov r1, r5 + ldr r2, =(KERNBASE) + bl build_pagetables + ldr r5, =(KERNPHYSADDR) +#else + /* + * Map PA == VA + */ /* Find the start kernels load address */ adr r5, _start ldr r2, =(L1_S_OFFSET) @@ -183,6 +206,7 @@ Lunmapped: mov r1, r5 ldr r2, =(KERNVIRTADDR) bl build_pagetables +#endif #if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Create the custom map */