Validation vehicle
The vehicle (tools/vehicle/) runs the firmware on a real board in a loop,
without a boot medium and without anyone pressing buttons: it builds signed
first-stage images, pushes them through the BootROM’s USB download mode (FDL),
captures the UART, and resets the board back into FDL by software for the next
run (Test platform, logsRefs/README.md).
build-vehicle.sh --> signed FSBL --fastboot stage/continue--> board (BootROM FDL)
| UART
fdl_run.py <------------ log, summary <--------------------------+
| answers the reset prompt (PMIC / watchdog) --> board back in FDL
+- optional: ymodem U-Boot proper, commands at the U-Boot prompt
extract_log.py --> one summary per log
Components
file |
kind |
role |
|---|---|---|
|
shell |
builds the firmware, a patched U-Boot SPL and the signed FSBL |
|
U-Boot patch |
validation hooks in |
|
Python 3 + pyserial |
loads FSBLs through fastboot, captures the UART, drives resets and the U-Boot prompt |
|
Python 3 |
minimal YMODEM sender used by |
|
Python 3 + pyserial |
drives the eMMC monitor built into the |
|
Python 3 |
summarizes vehicle logs |
build-vehicle.sh
Required environment: UBOOT (mainline checkout, copied and patched, not
modified in place), VENDOR_UBOOT (the FSBL signing tool and keys, only
executed on a copy of its configuration), OPENSBI (MODE=uboot only),
DDR_FW (MODE=retrain only), WORK (scratch dir), CROSS_COMPILE.
|
DDR firmware in the SPL, then |
output |
|---|---|---|
|
proprietary |
|
|
open firmware from power-on, DRAM checks around one re-train round |
|
|
as |
|
|
as |
|
Options: EXP=K1_EXP_… (an error-injection image,
Testing), RATE=<MT/s> (override data_rate),
CS=1 or CS=2 (override cs_num),
LAT=1 (DRAM latency meter), TIMING=1 (fp2 timing-byte sweep,
MC timing: accepted ranges and optima), RESET= (no software reset at the end).
The U-Boot validation patch
Applies to mainline board/spacemit/k1; everything compiles only when the
matching make variable is set, so a normal build is unaffected. It is
GPL-2.0-or-later like U-Boot. The spl.c changes it adds are the minimal way
to honour the firmware’s return value (mainline ignores it, Role of the SPL):
K1_DDR_GPL_FULL: callddr_initwithputs, printK1DDRT: ddr_init rc <rc>, and on failure printDDR is not readyand skip the magic-word write and the re-train test;K1_DDR_GPL_TEST: after the magic-word test, runk1_ddr_gpl_retrain_test(fills DRAM probes from the CS map, calls the re-train entry at offset 4 a few times, and reportskept-errors/fresh-errorsper probe);K1_VEHICLE_RATE,K1_VEHICLE_CS,K1_VEHICLE_UART(boot U-Boot proper over ymodem),K1_EMMC_TOOL,K1_VEHICLE_RESET(software reset; on a 16 GiB BPI-F3 with GNU on eMMC, PMICpboots eMMC, not BootROM FDL — hold the FDL button). OpenSSL 4 host tools needHOSTCFLAGS=-DOPENSSL_ENGINE_STUBS(build-vehicle.shsets it).
fdl_run.py
Loops over one or more FSBLs: waits for the fastboot device, fastboot stage
+ fastboot continue, waits for a marker on the UART (K1DDRT-DONE),
optionally sends U-Boot proper by ymodem and runs commands at the prompt,
otherwise answers the K1VEH: reset? prompt (p / w / h). p
(PMIC P1 SW_RST) and w (SoC watchdog, clearing 0xd4282d10) return to
BootROM FDL when no valid FSBL is on eMMC (tools/vehicle/u-boot/): with a
valid eMMC image that is GNU, not FDL. After
each run it prints a one-line summary (ddr_init rc, the first fp2 result,
DRAM errors, whether a U-Boot prompt was reached, mtest errors).
The BootROM download that fastboot stage uses enumerates as 361c:1001
(DFU USB download gadget, serial dfu-device, manufacturer DFU).
361c:0008 is ADB (Linux, or the ROM ADB face) and is not that download.
U-Boot proper can also present 361c:1001 with manufacturer U-Boot and
an empty serial — that is not BootROM FDL. After --reset h, a leftover
gadget may still list in fastboot devices and then fail
Write to device failed.
Log prefixes
The firmware’s own prefixes are in Acceptance and logging.
The vehicle adds: K1DDRT: / K1DDRT-DONE (the validation hook),
K1VEH: (the reset prompt) and K1EMMC> (the eMMC monitor).
extract_log.py parses exactly these lines, so changing a firmware format
string means updating that script and fdl_run.py’s summary too.
Result on the reference boards
[measured] on both BPI-F3 8 GiB Samsung and BPI-F3 16 GiB Micron (2 ranks,
x8, LPDDR4X): full open-firmware bring-up runs from power-on across 1066, 1200,
≈1333, 2400 and 2666 MT/s with independent data-eye verification and clean DRAM
probes/PI retrain (logsRefs/014–027); 16 GiB stock 2666 MT/s also boots
Linux 6.6.36 cleanly through U-Boot proper with mtest 0 errors and clean
1–2 process memory soaks (logsRefs/040-linux-stock-2666-16gib/readme.md,
logsRefs/041-linux-stock-2666-16gib-soak/readme.md).