From owner-freebsd-emulation@FreeBSD.ORG Sat Nov 24 04:20:49 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C03097ED; Sat, 24 Nov 2012 04:20:49 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7308FC12; Sat, 24 Nov 2012 04:20:48 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Tc7ET-0009ku-0O; Fri, 23 Nov 2012 20:20:46 -0800 Message-ID: <50B04B1A.8090907@bluezbox.com> Date: Fri, 23 Nov 2012 20:20:42 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: grenville armitage Subject: Re: FreeBSD-CURRENT on Qemu-emulated Gumstix Verdex? References: <50AFEAC5.6040607@swin.edu.au> In-Reply-To: <50AFEAC5.6040607@swin.edu.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 11/23/2012 1:29 PM, grenville armitage wrote: > All, > > Apologies if I have the wrong lists, feel free to redirect me. > > I recently decided to try getting an arm build of 10.0-CURRENT > (r243319) (TARGET=arm KERNCONF=GUMSTIX-QEMU) running inside a > Qemu-emulated Gumstix Verdex board, using qemu-devel (1.1.1) as the > emulator. > > Short version: I fire up qemu-system-arm with "-m 768" to make sure > there's enough virtual RAM. u-boot reports the emulated Verdex board > as having 256MB of DRAM (I believe this limit is imposed by u-boot). > But when control passes to FreeBSD the kernel prints the usual > copyright messages, detects the CPU type ("PXA27x step C-0 (XScale > core)"), auto-detects 512MB of real memory rather than 256MB and > promptly panics (with "panic: vm_page_insert: page already inserted"). > > The problem appears to be FreeBSD auto-detecting twice the emulated > available RAM. Does this ring any bells with anyone? My google-fu has > so far failed me. > > (I've been contemplating trying this for awhile, since noticing > sys/arm/conf/GUMSTIX-QEMU was added to head earlier this year. > Admittedly GUMSTIX-QEMU relies on GUMSTIX, which notes it is for the > Basix and Connex boards. So I recognise that the answer when emulating > Verdex boards might simply be "don't do that".) > > FWIW, this is a side project to get an emulated ARM environment > running on my amd64 box for building ARM Ports. I've also tried > booting the same kernel using Qemu's emulation of the Gumstix Connex > board -- this does seem to work, but the emulated 64MB RAM is too > tight. > (http://matrossi.blogspot.com.au/2011/09/freebsd-arm-on-qemu-in-virtualbox.html > was my early motivation for doing this.) > > FWIW#2, the actual console output during a failed boot: [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: freebsd-emulation@freebsd.org, freebsd-arm@freebsd.org X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 04:20:49 -0000 On 11/23/2012 1:29 PM, grenville armitage wrote: > All, > > Apologies if I have the wrong lists, feel free to redirect me. > > I recently decided to try getting an arm build of 10.0-CURRENT > (r243319) (TARGET=arm KERNCONF=GUMSTIX-QEMU) running inside a > Qemu-emulated Gumstix Verdex board, using qemu-devel (1.1.1) as the > emulator. > > Short version: I fire up qemu-system-arm with "-m 768" to make sure > there's enough virtual RAM. u-boot reports the emulated Verdex board > as having 256MB of DRAM (I believe this limit is imposed by u-boot). > But when control passes to FreeBSD the kernel prints the usual > copyright messages, detects the CPU type ("PXA27x step C-0 (XScale > core)"), auto-detects 512MB of real memory rather than 256MB and > promptly panics (with "panic: vm_page_insert: page already inserted"). > > The problem appears to be FreeBSD auto-detecting twice the emulated > available RAM. Does this ring any bells with anyone? My google-fu has > so far failed me. > > (I've been contemplating trying this for awhile, since noticing > sys/arm/conf/GUMSTIX-QEMU was added to head earlier this year. > Admittedly GUMSTIX-QEMU relies on GUMSTIX, which notes it is for the > Basix and Connex boards. So I recognise that the answer when emulating > Verdex boards might simply be "don't do that".) > > FWIW, this is a side project to get an emulated ARM environment > running on my amd64 box for building ARM Ports. I've also tried > booting the same kernel using Qemu's emulation of the Gumstix Connex > board -- this does seem to work, but the emulated 64MB RAM is too > tight. > (http://matrossi.blogspot.com.au/2011/09/freebsd-arm-on-qemu-in-virtualbox.html > was my early motivation for doing this.) > > FWIW#2, the actual console output during a failed boot: AFAIU you can't specify just any memory size for PXA2XX-based boards since they've got strict SDRAM configuration format. From quick glance it seems that FreeBSD's SDRAM size detection code thinks that there are 4 banks of 128Mb. While the same MDCNFG register value(0x8ad30ad3) is used in U-Boot source to indicate 256Mb memory size. So I assume our code is broken for PXA270. If anybody got a datasheet for it - please take a look, or send datasheet my way.