From owner-freebsd-arm@freebsd.org Fri Mar 25 18:23:00 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48A77ADDA85 for ; Fri, 25 Mar 2016 18:23:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 25CB91871 for ; Fri, 25 Mar 2016 18:22:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 9f804c06-f2b6-11e5-9036-c33267960ba8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 25 Mar 2016 18:23:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2PIMoLU019394; Fri, 25 Mar 2016 12:22:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458930170.1091.65.camel@freebsd.org> Subject: Re: Booting kernel.bin directly on Raspberry Pi / external DTB support From: Ian Lepore To: Warner Losh , Sylvain Garrigues Cc: freebsd-arm , ticso@cicely.de Date: Fri, 25 Mar 2016 12:22:50 -0600 In-Reply-To: References: <1CCA59DC-5539-4CFB-81BA-0112E2120B3B@gmail.com> <20160325052509.GE48704@cicely7.cicely.de> <97BB142C-D335-469B-9514-D1210E869C5D@gmail.com> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 18:23:00 -0000 On Fri, 2016-03-25 at 12:01 -0600, Warner Losh wrote: > On Fri, Mar 25, 2016 at 11:55 AM, Sylvain Garrigues > > wrote: > > > Thank you. > > > > I wanted to boot the kernel directly so as to: > > 1/ remove the dependency on a 3rd party loader > > 2/ reduce boot time and make it comparable with NetBSD and Linux > > (which > > don¢t use u-boot) > > > > NetBSD and Linux on the Pi boot so much faster than our FreeBSD > > image: > > less than 1 second after power-up, the first kernel copyright line > > appears > > on my LCD. For the FreeBSD images, the longest part is ubldr > > loading the > > kernel. It takes around 4/5 seconds (with the same SD card). > > > > I used recent u-boot versions (the current u-boot-rpi2 port is > > getting old > > and is not in sync with the u-boot-rpi port recently updated), > > tried with > > dcache enabled, but the boot process still takes several seconds, > > most of > > the time being spent in ubldr loading the kernel. > > > > I have no idea how we could improve the booting time? I wanted to > > experiment with booting the kernel directly as the first ARM > > program on my > > Pi, but as you explained I need some init code. I managed to > > compile > > Andrew¢s one ( > > https://github.com/freebsd/freebsd/commit/074d37d46c3f9b282cd2d849d > > 997b1b39acd710c) > > but I don¢t know how to use it. Andrew, if you read this ;-) > > > > I wonder if the loader could be more efficient at loading off the > > SD card. > The SD cards can do 10-20MB/s easily, and the ARM kernel is around > 5MB last > time I checked. 5 seconds is 1MB/s, which is much slower than we know > the > hardware can do. I don't know if that's because the callback > mechanism in > u-boot.bin is so slow (that's what ubldr uses to load the kernel), or > there's something inherently slow about our loader. Some analysis > here > might be quite useful. I'm guessing that we're not getting all the > benefits > from streaming read mode because we're doing I/Os that are tiny for > some > reason. But I haven't looked to make sure. > > What's the speed when booting directly from u-boot.bin? > > Warner To be clear here, the time it takes to get from hitting reset to the freebsd copyright on my rpi using u-boot and ubldr is 2.5 - 3 seconds. Considering some of the serious bugs we haven't had time to fix yet, this is just not a thing we need to waste a lot of effort on. -- Ian