From owner-freebsd-arm@freebsd.org Tue Apr 12 14:19:38 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 A5DD3B0CBB6 for ; Tue, 12 Apr 2016 14:19:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (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 870CD16C7 for ; Tue, 12 Apr 2016 14:19:38 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6afa4e62-00b9-11e6-827e-7d17a39bef25 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 outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 12 Apr 2016 14:18:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3CEJULj016375; Tue, 12 Apr 2016 08:19:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1460470770.52955.14.camel@freebsd.org> Subject: Re: Booting FreeBSD on BeagleBone Black from microSD by default From: Ian Lepore To: Tim Kientzle , Hal Murray Cc: freebsd-arm Date: Tue, 12 Apr 2016 08:19:30 -0600 In-Reply-To: <3BC5A04D-79DD-4820-A44F-B0A921D2FAA9@kientzle.com> References: <20160411040655.632D3406076@ip-64-139-1-69.sjc.megapath.net> <3BC5A04D-79DD-4820-A44F-B0A921D2FAA9@kientzle.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Tue, 12 Apr 2016 14:19:38 -0000 On Mon, 2016-04-11 at 06:33 -0700, Tim Kientzle wrote: > > On Apr 10, 2016, at 9:06 PM, Hal Murray > > wrote: > > > > > > Does anybody have the recipe for setting things up so that power on > > boots > > from the microSD card without holding down the button? > > If the ROM cannot boot from eMMC, it will try to boot from microSD. > > The easiest way to make the eMMC not bootable is to zero out the > boot sectors using dd: > > dd if=/dev/zero of= count=100 > > Of course, this makes the eMMC entirely unusable. I think you > can then reformat the eMMC (make sure it does not have a FAT > partition and does not have boot blocks) so it can be used without > the ROM trying to boot from it. > > This way, the ROM will load U-Boot from microSD. > > > > > I'm pretty sure it will be simple after I know how to do it. > > Google found info on the idea, but I couldn't find the file that > > needs editing. It's off in uBoot land. > > Even if the ROM loads U-Boot from eMMC, the default Linux > U-Boot setup on the eMMC can be configured to then load > the Linux kernel from microSD. > > If you install the FreeBSD version of U-Boot to eMMC, you might be > able to > do the same thing. Personally, I find the recipe above much > simpler. > > Cheers, > > Tim No need to zero out the onboard emmc or mess with its too-complicated linux-centric env vars... The AM335x ROM boot code loads u-boot from the first FAT partition it finds with the active/bootable flag set. Normally that's the emmc, but you can turn it off and then it'll look for a partition on the external sdcard. Once you've booted to freebsd normally, do gpart unset -a active -i 1 mmcsd1 And now it will boot from the sdcard unless you turn the active flag back on on the emmc. - Ian