Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/u-boot/pi2/README

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Raspberry Pi firmware extracted from:
	http://downloads.raspberrypi.org/raspbian/images/raspbian-2019-07-12/

To extract firmware, first download the image archive and issue:

	% unzip -f 2019-07-10-raspbian-buster.zip
	% disk/partfs -r 2019-07-10-raspbian-buster.img
	% readparts /dev/sdXX
	% dossrv -f /dev/sdXX/dos
	% mount /srv/dos /n/dos /dev/sdXX/dos
	% cp -x /n/dos/^(bootcode.bin fixup.dat start.elf) /cfg/$sysname/dos

To clean up, issue:

	% unmount /n/dos && rm -f /srv/dos
	% kill partfs | rc

Das U-Boot (u-boot.bin) was built from source using a relatively
recent version (v2019.01) on a Fedora 31 workstation with a
cross-compiled ARM GCC 9.2.1 provided by the distribution located in
PATH.

Newer versions of Das U-Boot contain a change to restrict writes to
ATAG via TFTP, which breaks loading configuration over the network.
This was introduced after v2019.01 and there does not appear to be an
easy way to bypass this new behavior; see: https://patchwork.ozlabs.org/patch/1024795/.

To build u-boot.bin from source, issue:

	$ git clone -b v2019.01 --depth 1 https://gitlab.denx.de/u-boot/u-boot.git && cd ...
	$ CROSS_COMPILE=arm-linux-gnu- make rpi_2_defconfig
	$ CROSS_COMPILE=arm-linux-gnu- make -j8

Once finished, u-boot.bin may then be copied to /cfg/$sysname/dos.

On first boot, autoboot should be interrupted and the following
commands issued to initialize the U-Boot environment:

	> env default -a
	> setenv confaddr 0x80000100
	> setenv bootargs "console=0 b115200
	..."
	> setenv bootcmd "bootp; bootm"
	> saveenv

If loading configuration via TFTP (cf. /cfg/pxe) rather than bootargs
is desired, bootargs should remain unset and bootcmd adjusted as
follows:

	> setenv bootargs
	> setenv bootcmd "bootp $confaddr %C; bootp; bootm"
	> saveenv

If loading configuration via the FAT filesystem rather than bootargs
is desired, bootargs should remain unset and bootcmd adjusted as
follows:

	> setenv bootargs
	> setenv bootcmd "fatload mmc 0 $confaddr plan9.ini; bootp; bootm"
	> saveenv

Ater the environment has been saved, the system may then be booted
using the boot command or reset if autoboot is desired.

Steven Stallion
December 2019

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].