crochet rpi2 boot won't play nice for me...

Mark Millard markmi at dsl-only.net
Sat Dec 30 07:33:10 UTC 2017


[Turns out that head -r326914 broke ubldr.bin and ubldr .
Fixed in head -r327351 .]

On 2017-Dec-29, at 11:08 PM, Ross Alexander <rwa at athabascau.ca> wrote:

> On Thu, 28 Dec 2017, Mark Millard wrote:
> 
>> [... :rwa:]
> 
>> Hmm. There is a bootcode.bin but these days it is from
>> sysutils/rpi-firmware instead of from
>> sysutils/u-boot-rpi2 :
>> 
>> # ls /usr/local/share/rpi-firmware/
>> LICENCE.broadcom config.txt fixup_cd.dat fixup_x.dat start_cd.elf start_x.elf
>> bootcode.bin fixup.dat fixup_db.dat start.elf start_db.elf
>> 
>> # ls /usr/local/share/u-boot/u-boot-rpi2/
>> README u-boot.bin
> 
> Oh, nice catch.  I've twisted up a copy of sysutils/rpi-firmware.
> Copying that stuff into what crochet built on da0s1 got me to a boot
> prompt, as thus:
> 
>    U-Boot 2017.09 (Dec 26 2017 - 11:11:20 -0700)
> 
>    DRAM:  948 MiB
>    RPI 2 Model B (0xa21041)
>    MMC:   sdhci at 7e300000: 0
>    reading uboot.env
> 
>    ** Unable to read "uboot.env" from mmc0:1 **
> 
> This can't be good ...

uboot.env's message is normal.

>    Using default environment
> 
>    In:    serial
>    Out:   vidconsole
>    Err:   vidconsole
>    Net:   No ethernet found.
>    starting USB...
>    USB0:   Core Release: 2.80a
>    scanning bus 0 for devices... 3 USB Device(s) found
>          scanning usb for storage devices... 0 Storage Device(s) found
>    Hit any key to stop autoboot:  0
>    switch to partitions #0, OK
>    mmc0 is current device
>    Scanning mmc 0:1...
>    Found FreeBSD U-Boot Loader (bin)
>    reading ubldr.bin
>    232980 bytes read in 31 ms (7.2 MiB/s)
>    ## Starting application at 0x01000000 ...
>    Consoles: U-Boot console
>    Compatible U-Boot API signature found @0x3af5d988
> 
>    FreeBSD/armv6 U-Boot loader, Revision 1.2
>    (Fri Dec 29 02:27:06 MST 2017 toor at augur2.bogons)
> 
>    DRAM: 948MB
>    Number of U-Boot devices: 1
>    U-Boot env: loaderdev not set, will probe all devices.
>    Found U-Boot device: disk
>      Probing all disk devices...
>      Checking unit=0 slice=<auto> partition=<auto>... good.
>    Booting from disk0:

That should have listed something more specific,
such as disk0p1: (USB drive context example). But
ubldr.bin was broken for a while. See:

https://lists.freebsd.org/pipermail/svn-src-head/2017-December/107780.html

which says in part:

Author: imp
Date: Fri Dec 29 18:08:35 2017
New Revision: 327351
URL: 
https://svnweb.freebsd.org/changeset/base/327351


Log:
  Fix ubldr. uboot/lib uses defines for the loader. It's part of the
  loader, but not compile as loader (it's building a library), so we
  can't just include loader.mk for the defines. Move LOADER_DISK_SUPPORT
  back to defs.mk for the moment.
  
  Sponsored by: Netflix

Modified:
  head/stand/defs.mk
  head/stand/loader.mk
. . .



I hit the same issue trying to use ubldr.bin from
head -r327075 on an rpi2. I updated to -r327364
and used its ubldr.bin build and put it on the
rpi2. I was again able to boot.

>    can't load 'kernel'

This is also from the lack of LOADER_DISK_SUPPORT .

>    Type '?' for a list of commands, 'help' for more detailed help.
>    loader>
> 
> which is great, now all I have to do is remember the syntax for
> the boot path.  lsdev shows
> 
>    loader> lsdev
>    disk devices:
>           disk0 (MMC)
>           disk0s1: DOS/Windows
>           disk0s2: FreeBSD
>           disk0s2a: FreeBSD UFS
>    net devices:
>           net0:
> 
> A naive "boot -s disk02a:/boot/kernel/kernel" doesn't work, and
> ls isn't implemented.  Nothing I can think of is a good path.
> Mounting the mmscd on the devel box shows:
> 
>    augur2:/root # mount -o ro /dev/da0s2a /mnt0
>    augur2:/root # ls -l /mnt0/boot/kernel/kernel
>    -r-xr-xr-x  1 root  wheel  10649356 Dec 29 02:27 /mnt0/boot/kernel/kernel
> 
>    augur2:/root # file /mnt0/boot/kernel/kernel
>    /mnt0/boot/kernel/kernel: ELF 32-bit LSB executable, ARM, EABI5 version 1 \
>    (FreeBSD), dynamically linked, interpreter /red/herring, for FreeBSD 12.0 \
>    (1200054), not stripped
> 
> Anyway I'm downloading an image from ftp.freebsd.org and will see
> what I can learn from inspecting it.  I'm surprised that crochet
> has lost track of the pi2, though.  Lots of them still out there.

Use ubldr.bin from -r327351 or later.

===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-arm mailing list