Bug 230331 - BEAGLEBONE-20180802-r337160 fails to boot on BBG
Summary: BEAGLEBONE-20180802-r337160 fails to boot on BBG
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
Depends on:
Blocks: 228911
  Show dependency treegraph
Reported: 2018-08-03 15:27 UTC by Ed Maste
Modified: 2018-08-06 17:22 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2018-08-03 15:27:00 UTC
BBG: https://beagleboard.org/green
Image: FreeBSD-12.0-CURRENT-arm-armv7-BEAGLEBONE-20180802-r337160.img.xz
Boot fails ending with "WARNING! Trying to fire up the kernel, but no device tree blob found!"

Scanning disks on mmc...
MMC Device 2 not found
MMC Device 3 not found
Found 5 disks
WARNING: booting without device tree
493828 bytes read in 33 ms (14.3 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
WARNING: booting without device tree
## Starting EFI application at 82000000 ...
Consoles: EFI console  
FreeBSD/arm EFI loader, Revision 1.1
(Thu Aug  2 22:26:48 UTC 2018 root@releng3.nyi.freebsd.org)

   Command line arguments: l
   EFI version: 2.70
   EFI Firmware: Das U-Boot (rev 0.00)
   Console: efi (0)
   Load Path: /\efi\boot\bootarm.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USB(0x6,0x0)/HD(1,0x01,0,0x42f,0x18fa8)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USB(0x6,0x0)/HD(1,0x01,0,0x42f,0x18fa8)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USB(0x6,0x0)/HD(2,0x01,0,0x193d7,0x5e6c11)
Setting currdev to disk0p2:
Loading /boot/defaults/loader.conf
/boot/kernel/kernel text=0x87f1dc data=0x910b8+0x1ded48 syms=[0x4+0xa9a00+0x4+0x10e4b1]
/boot/kernel/umodem.ko text=0x1bf4 text=0x1320 data=0x1080+0xf88 syms=[0x4+0x1070+0x4+0xbcd]
loading required module 'ucom'
/boot/kernel/ucom.ko text=0x1f8c text=0x2e90 data=0x1080+0x17bc syms=[0x4+0x14f0+0x4+0xc5d]
efi-autoresizecons: Neither Graphics Output Protocol nor Universal Graphics Adapter present

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...               
No valid device tree blob found!
WARNING! Trying to fire up the kernel, but no device tree blob found!
Kernel entry at 0x95000180...
Kernel args: (null)
modulep: 0xc0cbb000
relocation_offset 0
Comment 1 Emmanuel Vadot freebsd_committer 2018-08-03 19:20:32 UTC
Is this the BBG wireless ?
It seems to use a different DTB that we don't copy.
Comment 2 Emmanuel Vadot freebsd_committer 2018-08-03 19:23:37 UTC
U-Boot env variable board_name should be 'BBG1' for the classic BeagleBone Green and 'BBGW' for the wireless version.
Comment 3 Ed Maste freebsd_committer 2018-08-03 19:30:20 UTC
Comment 4 Emmanuel Vadot freebsd_committer 2018-08-03 19:37:51 UTC
So the problem is that as TI use one u-boot for all Beaglebone variant they don't embed the DTB. I'll see how to fix that.
Comment 5 Ed Maste freebsd_committer 2018-08-03 19:38:20 UTC
Tried 'load -t dtb ..' on manu@'s suggestion and it works:

OK load -t dtb /boot/dtb/beaglebone-black.dtb
/boot/dtb/beaglebone-black.dtb size=0xc8fc
OK boot
Using DTB from loaded file '/boot/dtb/beaglebone-black.dtb'.
Kernel entry at 0x95000180...
Kernel args: (null)
modulep: 0xc0cd5000
relocation_offset 0
ARM Debug Architecture not supported
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2018 The FreeBSD Project.
Comment 6 Ed Maste freebsd_committer 2018-08-03 19:43:09 UTC
OK load -t dtb /boot/dtb/am335x-bonegreen.dtb

Copying /boot/dtb/am335x-bonegreen.dtb to /boot/mdsos/dtb did not work.
Comment 7 Ed Maste freebsd_committer 2018-08-03 19:59:22 UTC
Misunderstood the earlier suggestion; this worked:
root@generic:~ # mkdir /boot/msdos/dtb
root@generic:~ # cp /boot/dtb/am335x-bonegreen.dtb /boot/msdos/dtb/
Comment 8 Emmanuel Vadot freebsd_committer 2018-08-03 20:03:42 UTC
Follow up on IRC discussion:

EFI requires to have a dtb, its either embeded in u-boot (address in $fdtcontroladdr) or u-boot will try to load from thoses location :
efi_dtb_prefixes=/ /dtb/ /dtb/current/

So for the BBB family we need to install the DTB on the fat partition
Comment 9 Emmanuel Vadot freebsd_committer 2018-08-05 06:12:44 UTC
I've started a release build with a patch and will open a review once I've confirmed that everything is working.
Comment 10 Emmanuel Vadot freebsd_committer 2018-08-06 17:22:46 UTC
Fixed by 337383