Login
cleave-binman
Login

A Crystal replacement for the parts of U-Boot's Python binman that TI K3 boards and the x86 QEMU ROM use, so BQ2 (no Python) can build the BeagleY-AI boot chain and U-Boot's qemu-x86_64 u-boot.rom.

shards build                 # bin/cleave-binman
crystal spec                 # unit specs
CLEAVE_REFERENCE=... CLEAVE_UBOOT=... crystal spec   # also compare with binman

Use in a U-Boot build

U-Boot's Makefile ends its build by running $(srctree)/tools/binman/binman build .... cleave-binman accepts that command line, so put it at that path before make:

ln -sf "$(command -v cleave-binman)" tools/binman/binman

Then build the R5 and A53 passes as listed in bsp/beagley-ai/manifest.md. U-Boot's own tools/mkimage is not needed for these images.

What it covers

binman feature Crystal
reading the /binman node, multiple-images, insert-template src/cleave/binman.cr
ti-board-config (YAML + schema.yaml → binary, combined headers) src/cleave/ti_board_config.cr
ti-secure, ti-secure-rom (combined and plain) x509 certificates src/cleave/ti_x509.cr, src/cleave/rsa_key.cr (libcrypto)
fit with embedded data, hash nodes (crc32, sha1, sha256), timestamp src/cleave/binman.cr, src/cleave/fdt.cr
blobs: blob, blob-ext, u-boot*, atf-bl31, tee-os, ti-dm, entry args -a NAME-path= src/cleave/binman.cr
layout: offset, size, pad-before, pad-after, min-size, pad-byte, sort-by-offset, skip-at-start, end-at-4gb, with binman's overlap and size errors src/cleave/binman.cr
x86: u-boot(-spl,-tpl)-with-ucode-ptr (without microcode), u-boot-dtb-with-ucode, x86-start16*, x86-reset16*, files (no matches) src/cleave/binman.cr
fdtmap, image-header, and -u: offset, size and image-pos written into U-Boot's device tree as libfdt writes them src/cleave/binman.cr, src/cleave/fdt_edit.cr
_binman_* symbols written into SPL, TPL and VPL from their ELF (__image_copy_start as base) src/cleave/binman.cr, src/cleave/elf.cr

These are refused with an error rather than silently mishandled: align*, overlap, extend-size, offset-unset, write-symbols, compression, FIT signing and encryption, microcode (an ELF with _dt_ucode_base_size), files entries that match files, and any other entry type.

The K3 images are unchanged by all this. Their entries carry no layout properties, so they are still concatenated in order; the R5 SPL's ELF has no __image_copy_start, so binman writes no symbols there; and FIT contents are built before symbols are written, as in binman. With -u on two local BeagleY-AI builds, tiboot3.bin, tispl.bin and u-boot.img came out byte-identical to the previous cleave-binman.

Differences from binman output

Checked against binman

Armbian's linux-u-boot-beagley-ai-vendor_26.8.3 holds tiboot3.bin, tispl.bin and u-boot.img built by binman from beagleboard/u-boot v2025.07-am6232-pocketbeagle2. With their payloads as inputs: