| Index | Next: Glossary → |
The work follows a clean-room split between two roles.
Analyst. Investigates the hardware and existing boot software (including
SpacemiT’s public GPL-2.0+ U-Boot BSP sources in drivers/ddr/spacemit/k1x/,
static analysis of the training binary, and active hardware probing on the
reference board) and writes the specification. Every fact enters the
specification as either
A fact is never written as “the other firmware does X”, nor as “our code does X”, and software-internal artifacts (function names, control-flow quirks, compiler bit-packing, stack layouts) are stripped out. Opaque values needed by the hardware (for example the PI sequencer parameters) are listed as engine parameters — reset value X, the hardware needs Y — without claiming to know what the bits mean.
Implementer. Whoever writes DDR firmware from this specification uses only
The implementer does not read listings, decompilations, linker maps, strings or source code of the proprietary training binary that originally initialised this SoC, and does not transcribe function names, log strings, stack layouts or code addresses of another program. Programming the silicon’s registers described here is not copying: it is the hardware.
Rules derived from this:
The K1 BootROM has a USB download mode (FDL, firmware download). When the boot media fail, or when the FDL button is held at reset, the BootROM exposes a fastboot-compatible USB device that accepts a signed first-stage image, places it in SRAM and runs it. This is the tool that made the reverse engineering possible without any boot medium and without risk of bricking the board.
The experimental loop:
ddr_fw.bin slot) that programs the registers under test and dumps the
resulting state over the UART.fastboot stage <image> then
fastboot continue.Do not confuse FDL with flashing. The BootROM’s fastboot
flashcommand reportsOKAYbut thefsblpartition it exposes has size 0: the image is only downloaded to SRAM, not written to the SD card or eMMC.continuethen runs that SPL in download mode, where it tries to fetch the next stage over fastboot (SPL load error: bootdev=12) and stops. To change the boot medium image, boot Linux from another medium (for the reference board, the eMMC, with the SD card removed), insert the SD card while it runs (the SD host has a card-detect GPIO and accepts hot-plug) and write the partition withdd.
Kinds of experiments that produced the facts in this specification:
CTL_FREQ,
PI_CFG, PI_STATUS, PHY status, taps, Vref words, mode registers).mtime).Used throughout the documents (see also the README):
| Label | Meaning |
|---|---|
| measured | Observed on the reference board. |
| required | Needed by the hardware: omitting it was observed to break the initialisation, or the hardware was only observed to reach a working state with it. |
| inferred | Consistent with all observations and with JEDEC, but not isolated by a dedicated measurement. |
| opaque | Value known and required; meaning of the bits unknown. Write it as given. |
| unknown | Not established. Preserve hardware values; do not invent. |
byte+0x24, DQS read
gate delay in byte0+0x64[4:0], RX Vref + DQ delays, and TX MR14 + DQ/DM
delays).ddr_init are measured and documented instead.K4UCE3Q4AA-MGCL, LPDDR4X x8, 2 CS) and BPI-F3 16 GiB (Micron
MT53E4G32D8, LPDDR4X 16 Gb x8 dies, 2 CS). On both boards the address map,
MR5/MR8, the four training passes, all five final rates, the PI and
independent Rx/Tx/WL windows (including per-lane centring and the per-rank
CPU address boundary), ODT/IO sweeps and 15-minute memory soaks were measured.
Other configurations (1 CS, x16, LPDDR4 non-X, Hynix H9HCNNNFAMMLXR-NEE x8
CA-ODT SKU, and other DRAM vendors) are derived from public BSP tables,
command formats and JEDEC encodings, and are marked as not measured on
hardware.fsbl) and booted from it into Linux.
Only the second path exercises the full production boot; FDL is used for rapid
iteration without touching the boot medium.| Index | Next: Glossary → |