From owner-freebsd-mips@FreeBSD.ORG Thu Mar 22 22:08:12 2012 Return-Path: Delivered-To: freebsd-mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9129D106564A; Thu, 22 Mar 2012 22:08:12 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 3DDBD8FC15; Thu, 22 Mar 2012 22:08:12 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 40EA4EC332; Thu, 22 Mar 2012 23:07:57 +0100 (CET) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id IqOAh0RuOLmW; Thu, 22 Mar 2012 23:07:56 +0100 (CET) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id 0CCAFEC2F1; Thu, 22 Mar 2012 23:07:55 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <43E920D8-72A6-43F0-8941-32C40783C523@bsdimp.com> Date: Thu, 22 Mar 2012 23:08:01 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <46D6F510-A824-4F00-9B77-E804A417324D@semihalf.com> References: <43E920D8-72A6-43F0-8941-32C40783C523@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1084) Cc: Juli Mallett , "freebsd-mips@FreeBSD.org" Subject: Re: RouterBOOT on RB450G has a 4MB NAND kernel size limit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 22:08:12 -0000 On 2012-03-09, at 02:00, Warner Losh wrote: >=20 > On Mar 8, 2012, at 5:24 PM, Juli Mallett wrote: >=20 >> Hey folks, >>=20 >> I thought it might be useful to share this with others, so they don't >> waste 6 hours diffing ELF files trying to figure out what the problem >> is. >>=20 >> It turns out that although it can load ELF files of variable size = over >> TFTP, and although the system is configured with a larger kernel NAND >> partition, RouterBOOT seems to choke (without any clear error, mind >> you, because that would be gratuitously-sensible) on loading kernels >> larger than 4MB. Of course, it's hard to figure this out because >> nothing useful turns up on a quick search for '"setting up elf >> image..." hang' or '"setting up elf image..." -"setting up elf >> image... ok"', although once you figure it out, it's easy to confirm >> with a quick Google along the lines of 'rb450g 4mb kernel'. >>=20 >> So, be warned if you're thinking that you'll use an OpenWRT kernel >> with initramfs over netboot to provision devices to use FreeBSD by >> copying the kernel to NAND. Or if you've got yaffs patches to your >> kernel and can just copy over kernels with impunity. >>=20 >> Has anyone looked at using U-Boot as a second stage loader on this >> hardware? In order to make loader useful, we'd have to add an awful >> lot of infrastructure, including another yaffs implementation, when = we >> don't even have one in-tree yet. What would be most useful, too, >> would be to have MMC + SPI support in loader (here again, U-Boot is >> helpful), so that we could load kernels from SD. That's a lot of = work >> on loader, and U-Boot already does it all, right? Any thoughts? >=20 > While not specifically for that hardware, I've scoped out the work it = would take to port raj@'s work from ARM to MIPS. It doesn't look huge, = once you settle on the right 'syscall' model. figured it would take a = dedicated person in the weeks to months range of effort, depending on = the person :). Maybe semihalf has already done a port? No, we haven't finally managed to (despite a couple of approaches :-), = but the thing is not at all very difficult as you said. One needs to = provide U-Boot context/restore and the MIPS 'syscall' routine, plus = debugging. The rest of /boot/ubldr code is independent of the arch. Rafal