BeagleBone AI-64: Distro Boot Overview

WIP - This is also a going to be a wiki page, so it will change over time…

2022-06-17: First boards are now being shipped to end users.

TI J721e_evm boot sequence:

U-boot v2022.07-rc4 j721e_evm.rst

BeagleBone AI-64 boot sequence:

Major boot sequence differences between BeagleBone AI-64 and TI j721e_evm

microSD = nothing

use sfdisk and create the first classic fat partition, we used 128MB, as we store linux image, overlays, and all boot files…

sfdisk: [1M,128M,0xC,*]
sfdisk: [129M,,,-]

tiboot3.bin (fat partition)tispl.bin (fat partition)u-boot.img (fat partition)

eMMC = (bbb.io: Kingston) vs (TI: Micron)

At the time of this design, the Kingston 16GB eMMC used, only supports a boot0 size of 4MB where as the TI EVM uses XYZ at 8MB. TI placed all U-Boot files into boot0, while initially we were able to shrink U-Boot down enough to match this. We eventually ran into other random space errors. So bbb.io is diverging a little bit from TI, and only placing tiboot3.bin into boot0, and loading everything else from the fat partition like a classic microSD…

From linux, using mmc-utils our eMMC configuration is:

#mmc extcsd read /dev/mmcblk0
mmc bootpart enable 1 2 /dev/mmcblk0
mmc bootbus set single_backward x1 x8 /dev/mmcblk0
mmc hwreset enable /dev/mmcblk0

Since the original shipment of boards use a pre-production image where we tired to do everything in boot0, it’s best to clear out any remnants:

echo '0' >> /sys/class/block/mmcblk0boot0/force_ro
dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k
dd if=./tiboot3.bin of=/dev/mmcblk0boot0 bs=128

Layout is the same as microSD:

sfdisk: [1M,128M,0xC,*]
sfdisk: [129M,,,-]

tiboot3.bin (boot0 eMMC)tispl.bin (fat partition)u-boot.img (fat partition)

Building U-Boot (2020-06-17)

Today, building U-boot for this target is a little complex, while TI is currently submitting patches to add these options to U-boot mainline…

Mainline RFC [PATCH RFC v3 00/11] Integration of tiboot3.bin, sysfw.itb and

#arm-trusted-firmware
ATF_TAG=bbb.io-08.01.00.006

#optee_os
TEE_TAG=08.01.00.005

#U-Boot
UB_TAG=v2021.01-ti-08.01.00.006
UB_CONFIG=j721e_evm_
UB_ATF=bl31.bin
UB_TEE=tee-pager_v2.bin
UB_DM=ipc_echo_testb_mcu1_0_release_strip.xer5f
mkdir -p /opt/u-boot/$(TARGETDIR)/
mkdir -p ./tmp/arm-trusted-firmware/
git clone -b $(ATF_TAG) https://git.beagleboard.org/beagleboard/arm-trusted-firmware.git --depth=1 ./tmp/arm-trusted-firmware/
cd ./tmp/arm-trusted-firmware/
make -j4 CROSS_COMPILE=aarch64-linux-gnu- CFLAGS= LDFLAGS= ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed all
cp -v ./tmp/arm-trusted-firmware/build/k3/generic/release/bl31.bin /opt/u-boot/$(TARGETDIR)/
mkdir -p ./tmp/optee_os/
git clone -b $(TEE_TAG) https://git.beagleboard.org/beagleboard/optee_os.git --depth=1 ./tmp/optee_os/
cd ./tmp/optee_os/
make -j4 CFLAGS= LDFLAGS= PLATFORM=k3-j721e CFG_ARM64_core=y
cp -v ./tmp/optee_os/out/arm-plat-k3/core/tee-pager_v2.bin /opt/u-boot/$(TARGETDIR)/
cp -v debian/ipc_echo_testb_mcu1_0_release_strip.xer5f /opt/u-boot/$(TARGETDIR)/
mkdir -p ./tmp/u-boot/
git clone -b $(UB_TAG) https://git.beagleboard.org/beagleboard/u-boot.git --depth=1 ./tmp/u-boot/
cd ./tmp/u-boot/
make CROSS_COMPILE=arm-linux-gnueabihf- $(UB_CONFIG)r5_defconfig O=../r5
make -j5 CROSS_COMPILE=arm-linux-gnueabihf- O=../r5
cd ./tmp/u-boot/
make CROSS_COMPILE=aarch64-linux-gnu- $(UB_CONFIG)a72_defconfig O=../a72
make -j5 CROSS_COMPILE=aarch64-linux-gnu- ATF=/opt/u-boot/$(TARGETDIR)/$(UB_ATF) TEE=/opt/u-boot/$(TARGETDIR)/$(UB_TEE) DM=/opt/u-boot/$(TARGETDIR)/$(UB_DM) O=../a72

partition layout and folder name…

Mounting the fat partition at /boot/firmware was used to better align with what Debian is doing for the Pi

This allows Debian to better control /boot/* and just cp our needed boot files to /boot/firmware in kernel post install scripts…

extlinux.conf configuration

why extlinux.conf? u-boot/README.distro at master · ARM-software/u-boot · GitHub

This is located under /boot/firmware/extlinux/extlinux.conf (from within u-boot’s context it’s the 1st partition /extlinux/extlinux.conf)

eMMC:

label Linux eMMC
    kernel /Image
    append console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait net.ifnames=0
    fdtdir /
    initrd /initrd.img

microSD

label Linux microSD
    kernel /Image
    append console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/mmcblk1p2 ro rootfstype=ext4 rootwait net.ifnames=0
    fdtdir /
    initrd /initrd.img

pxe “overlay” support was added very late (just a week or two before bbb.io announced this board…) in

    fdtoverlays /overlays/k3-j721e-beagleboneai64-RPi-7inch-panel.dtbo

Multiple overlays can be applied in order:

    fdtoverlays /overlays/first-overlay.dtbo /overlays/second-overlay.dtbo /overlays/third-overlay.dtbo

When working on overlays, make sure to use the serial debugger, when U-Boot fails to apply an overlay there is NO backup boot option, board will end up stuck in U-Boot, waiting for some user intervention.

Regards,

4 Likes

Looks like the only closed proprietary firmware needed to boot is the SYSFS image. Do you think it is feasible to replace it with open firmware?

Regards,
Dimitar

1 Like

That firmware “DM” comes from another TI git repo, i’m pretty sure it’s open source, just a pain to build…

to date, i’ve been copying it from TI’s SDK build… But now that the boards are out, we need to show how it’s built.

Regards,

Edit… @dinux oh fun, Free RTOS and a custom build system… processor-sdk/coresdk_rtos_releases - Unnamed repository; edit this file 'description' to name the repository.

Edit2 sysfw stuff here… [PATCH RFC v3 00/11] Integration of tiboot3.bin, sysfw.itb and

2 Likes

That’s great, thanks! I would love to use the board with fully free software stack.

I tried to download using repo, but the manifests seem to point to internal-only TI servers:

$ repo init -u https://git.ti.com/git/processor-sdk/coresdk_rtos_releases.git -m j721e/psdk.xml
$ repo sync
ssh: Could not resolve hostname bitbucket.itg.ti.com: Name or service not known