From owner-freebsd-arm@FreeBSD.ORG Thu Jan 26 06:01:47 2012 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97AD3106566C for ; Thu, 26 Jan 2012 06:01:47 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 5451F8FC08 for ; Thu, 26 Jan 2012 06:01:47 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q0Q61krZ020378; Thu, 26 Jan 2012 06:01:46 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.119] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id yuwvpi79pi8qsb493wvv9m4r96; Thu, 26 Jan 2012 06:01:46 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=windows-1252 From: Tim Kientzle In-Reply-To: <101D3416-6B61-4840-A89E-4CF91B0BB8BC@kientzle.com> Date: Wed, 25 Jan 2012 22:01:46 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <4574F194-D23A-47DC-863B-33B31AEBDC04@kientzle.com> References: <23CB6C35-9450-40BA-9FA3-37C44B328CA8@freebsd.org> <8042D895-3B3D-431E-ADCC-A150BDC838ED@kientzle.com> <7E53112E-DE29-4145-B597-D39AA77252C5@kientzle.com> <101D3416-6B61-4840-A89E-4CF91B0BB8BC@kientzle.com> To: Rafal Jaworowski X-Mailer: Apple Mail (2.1251.1) Cc: arm@freebsd.org Subject: Re: FreeBSD and BeagleBone X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 06:01:47 -0000 On Jan 21, 2012, at 3:29 PM, Tim Kientzle wrote: > On Jan 21, 2012, at 2:13 AM, Rafal Jaworowski wrote: >>=20 >> On 2012-01-21, at 08:34, Tim Kientzle wrote: >>>=20 >>> But ubldr still won't run: >>>=20 >>> U-Boot# fatload mmc 0 0x80008000 ubldr >>> U-Boot# bootelf 0x80008000 >>> >>>=20 >>> Anyone else used U-Boot to run ubldr on Arm? >>=20 >> Looking at memory addresses you use for loading etc. the problem you = might be hitting is with a linking address range =85 try to adjust = linking addr range in sys/boot/arm/uboot/ldscript.arm to fit your layout = and see if this helps. >=20 > That certainly does help. Setting the ELF linking address to = 0x80001000 > gets this far: >=20 > U-Boot# fatload mmc 0 0x82000000 ubldr > U-Boot# bootelf 0x82000000 > ## Starting application at 0x80001054 > Consoles: U-Boot console > Compatible API signature found @8ff760c0 > Ah. This turned out to be a bug in U-Boot's API implementation. This board doesn't start up with RAM mapped to address zero, so dereferencing a NULL pointer leads to a hang. In api/api_storage.c, dev_stor_get calls get_dev with the name of the kind of storage currently being enumerated ("ide", "mmc", etc.) If the board lacks a particular kind of storage, then the name here is NULL. get_dev() dereferences the name pointer when it calls strncmp(). There's a trivial change to get_dev() (in disk/part.c) to cause it to return NULL if it's called with a NULL name, but I'm not sure that's the best solution here. Seems better to modify dev_stor_get instead. Any thoughts? Tim