Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2022 11:00:45 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Johan Henselmans <johan@netsense.nl>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: BeagleBone uboot: BeagleBone Green Gateway not defined in uboot?
Message-ID:  <85E7A48D-89DB-49C5-B2A1-501CF7C125DE@yahoo.com>
In-Reply-To: <1D4FD611-7420-4E52-9414-67F282DDA4C6@netsense.nl>
References:  <0EDDBAEA-CA91-4A64-BB93-BCB5D067BE00@netsense.nl> <467642CD-DF11-448C-AACA-43F7FB4DB572@yahoo.com> <50347B94-0B6D-463C-9B87-499EBEA537D7@yahoo.com> <1D4FD611-7420-4E52-9414-67F282DDA4C6@netsense.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-Oct-25, at 00:25, Johan Henselmans <johan@netsense.nl> wrote:

> I made some comments in between on both mails.
>=20
>>>=20
>>> . . .
>>>=20
>>> # more /usr/ports/sysutils/u-boot-beaglebone/pkg-descr
>>> U-Boot loader for BeagleBone and BeagleBone Black.
>>>=20
>>> To install this bootloader, copy the files MLO and bb-uboot.img to =
the FAT
>>> partition on an SD card or the eMMC.  Normally this is partition 1, =
but
>>> different partitions can be set with U-Boot environment variables.
>>>=20
>>> This version is patched so that:
>>> * API features are enabled.
>>> * A boot.scr (U-Boot scripts ) that loads ubldr.bin and execute it =
is included
>>>=20
>>> For information about running FreeBSD on BeagleBone or BeagleBone =
Black, see
>>> https://wiki.freebsd.org/FreeBSD/arm/BeagleBone

Looks like that should be(?): =
https://wiki.freebsd.org/arm/BeagleBoneBlack

>>> You were not explicit. Did you do as described with MLO
>>> and bb-uboot.img ?
>>>=20
>=20
>=20
> Yes I did. Only thing I did not know how to do was where to put the =
boot.scr that the READMe mentions.
>=20
> That is why I reran the script on a Beaglebone, hoping that would =
install the script. Mind you, I am not a
> pkg specialist. I do not know how to find out how this script is =
created and where it is supposed to put.
> I looked in /usr/port/sysutils/u-boot-master and =
/usr/port/sysutils/u-boot-beaglebone, but could not understand
> where this boot.scr was supposed to go

I'll note that FreeBSD 12 still has images for a beaglebone.
For example:

=
http://ftp3.freebsd.org/pub/FreeBSD/snapshots/ISO-IMAGES/12.4/FreeBSD-12.4=
-PRERELEASE-arm-armv7-BEAGLEBONE-20221014-r372617.img.xz

=46rom that you can see some of what goes where in the msdosfs
on the boot media, for example:

# mdconfig -u md0 -f =
~/FreeBSD-12.4-PRERELEASE-arm-armv7-BEAGLEBONE-20221014-r372617.img
# mount -onoatime -tmsdosfs /dev/md0s1 /mnt
# ls -Tld /mnt/*
drwxr-xr-x  1 root  wheel     4096 Oct 13 23:56:24 2022 /mnt/EFI
-rwxr-xr-x  1 root  wheel   103876 Oct 13 20:17:38 2022 /mnt/MLO
drwxr-xr-x  1 root  wheel     8192 Oct 13 23:56:24 2022 /mnt/dtb
-rwxr-xr-x  1 root  wheel  1163404 Oct 13 20:17:38 2022 /mnt/u-boot.img
-r-xr-xr-x  1 root  wheel   386104 Oct 13 23:47:42 2022 /mnt/ubldr.bin

This makes it look like bb-uboot.img is renamed during
the copy into the msdosfs, if it is ever named bb-uboot.img
anyway. (Again, I'm not familiar with any beaglebone
specifics.)

The lack of boot.scr is interesting. My expectation is
that boot.src goes in same directory with u-boot.img and
ubldr.bin : u-boot.img reads boot.scr and follows the
instructions that are there in order to load ubldr.bin .
Looking elsewhere for boot.scr would seem odd.

(But, I'll note that I know nothing of MLO or its
implications.)

I'll note that there is:

# find /mnt/ -print | grep am335x
/mnt/dtb/am335x-bone.dtb
/mnt/dtb/am335x-boneblack.dtb
/mnt/dtb/am335x-boneblack-wireless.dtb
/mnt/dtb/am335x-bonegreen.dtb
/mnt/dtb/am335x-bonegreen-wireless.dtb
/mnt/dtb/am335x-boneblue.dtb
/mnt/dtb/am335x-pocketbeagle.dtb

That suggests one place were the .dtb might need
to go. I've no clue if that is the only place
vs. needing a copy someplace in UFS/ZFS space for
FreeBSD to directly access.

>>>> That resulted in the message that there was no device tree:
>>>> =3D=3D=3D=3D=3D
>>>> Loading Environment from EXT4...
>>>> ** Unable to use mmc 0:1 for loading the env **
>>>> Board: BeagleBone Black
>>>> <ethaddr> not set. Validating first E-fuse MAC
>>>> BeagleBone Black:
>>>> Model: SeeedStudio BeagleBone Green Gateway:
>>>> BeagleBone: cape eeprom: i2c_probe: 0x54:
>>>> BeagleBone: cape eeprom: i2c_probe: 0x55:
>>>> BeagleBone: cape eeprom: i2c_probe: 0x56:
>>>> BeagleBone: cape eeprom: i2c_probe: 0x57:
>>>> Net:   eth0: MII MODE
>>>> cpsw, usb_ether
>>>> Press SPACE to abort autoboot in 0 seconds
>>>> board_name=3D[A335BNLT] ...
>>>> board_rev=3D[GG1A] ...
>>>> switch to partitions #0, OK
>>>> mmc0 is current device
>>>> SD/MMC found on device 0
>>>> switch to partitions #0, OK
>>>> mmc0 is current device
>>>> Scanning mmc 0:1...
>>>> Found EFI removable media binary efi/boot/bootarm.efi
>>>> libfdt fdt_check_header(): FDT_ERR_BADMAGIC
>>>>=20
>>>> <snip>
>>>> No valid device tree blob found!
>>>> WARNING! Trying to fire up the kernel, but no device tree blob =
found!
>>>> =3D=3D=3D=3D=3D
>>>>=20
>>>>=20
>>>> How can I add a  device tree blob for the BeagleBone Green Gateway?
>>>>=20
>>>=20
>>> Note: I've no experience with any BeagleBone variant.
>>> My comments are rather generic.
>>>=20
>>=20
>> Hmm, I do not see am335x-bonegreen-gateway.dts in any
>> of the source code trees I've got for releng/13.0 ,
>> releng/13.1 , stable/13 , or main [so: 14] :
>>=20
>> /usr/13_0R-src/sys/contrib/device-tree/src/arm/am335x-bone.dts
>> =
/usr/13_0R-src/sys/contrib/device-tree/src/arm/am335x-boneblack-wireless.d=
ts
>> /usr/13_0R-src/sys/contrib/device-tree/src/arm/am335x-boneblack.dts
>> /usr/13_0R-src/sys/contrib/device-tree/src/arm/am335x-boneblue.dts
>> =
/usr/13_0R-src/sys/contrib/device-tree/src/arm/am335x-bonegreen-wireless.d=
ts
>> /usr/13_0R-src/sys/contrib/device-tree/src/arm/am335x-bonegreen.dts
>>=20
>> /usr/13_1R-src/sys/contrib/device-tree/src/arm/am335x-bone.dts
>> =
/usr/13_1R-src/sys/contrib/device-tree/src/arm/am335x-boneblack-wireless.d=
ts
>> /usr/13_1R-src/sys/contrib/device-tree/src/arm/am335x-boneblack.dts
>> /usr/13_1R-src/sys/contrib/device-tree/src/arm/am335x-boneblue.dts
>> =
/usr/13_1R-src/sys/contrib/device-tree/src/arm/am335x-bonegreen-wireless.d=
ts
>> /usr/13_1R-src/sys/contrib/device-tree/src/arm/am335x-bonegreen.dts
>>=20
>> /usr/13S-src/sys/contrib/device-tree/src/arm/am335x-bone.dts
>> =
/usr/13S-src/sys/contrib/device-tree/src/arm/am335x-boneblack-wireless.dts=

>> /usr/13S-src/sys/contrib/device-tree/src/arm/am335x-boneblack.dts
>> /usr/13S-src/sys/contrib/device-tree/src/arm/am335x-boneblue.dts
>> =
/usr/13S-src/sys/contrib/device-tree/src/arm/am335x-bonegreen-wireless.dts=

>> /usr/13S-src/sys/contrib/device-tree/src/arm/am335x-bonegreen.dts
>>=20
>> /usr/main-src/sys/contrib/device-tree/src/arm/am335x-bone.dts
>> =
/usr/main-src/sys/contrib/device-tree/src/arm/am335x-boneblack-wireless.dt=
s
>> /usr/main-src/sys/contrib/device-tree/src/arm/am335x-boneblack.dts
>> /usr/main-src/sys/contrib/device-tree/src/arm/am335x-boneblue.dts
>> =
/usr/main-src/sys/contrib/device-tree/src/arm/am335x-bonegreen-wireless.dt=
s
>> /usr/main-src/sys/contrib/device-tree/src/arm/am335x-bonegreen.dts
>>=20
>> Looks like you would have to establish am335x-bonegreen-gateway.dtb
>> another way as things are.
>>=20
>> I also did not find am335x-bonegreen-gateway.dtb in:
>>=20
>> https://github.com/torvalds/linux/tree/master/arch/arm/boot/dts/
>>=20
>> so it would likely be some time before it shows up there for FreeBSD
>> to later import.
>>=20
>> =3D=3D=3D
>> Mark Millard
>> marklmi at yahoo.com
>>=20
>>=20
>=20
> It seems the Beaglebne stuf is located at =
https://github.com/beagleboard/BeagleBoard-DeviceTrees/
>=20
> There is a am335x-bonegreen-gateway.dts available over there. I =
don=E2=80=99t know why that stuff is not in torvalds tree.
> I know that the debian version is created from =
https://github.com/RobertCNelson/omap-image-builder
>=20
> So my question would be then revolve around: how can I add that =
version to FreeBSD arm? Is there some procedure
> documented somehwere how I should do this?

I've no clue if anyone supporting code for armv7 on
FreeBSD would be willing to add and support .dts
files that do not come from importing from the
mainline linux tree (and any related files). They
might require a port instead, sort of like how RPi*
firmware is dealt with (including the .dtb files,
that happen to be used directly, not via dts
compiles).

The .dts history visible via:

=
https://github.com/beagleboard/BeagleBoard-DeviceTrees/commits/v4.19.x-ti-=
overlays/src/arm/am335x-bonegreen-gateway.dts

and shows that the .dts was last updated on 2021-Dec-23.


=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?85E7A48D-89DB-49C5-B2A1-501CF7C125DE>