Architecture
The K1 DDR subsystem is one 32-bit LPDDR4/4X channel built from two 16-bit JEDEC
channels, driven by a memory controller (MC) with a PHY and a PI training engine,
clocked by two DDR PLLs in the APMU. Register offsets and constants are defined
in src/lib/k1_ddrt_regs.h; this page maps the blocks the firmware touches
and the hardware evidence in logsRefs/.
Blocks and bases
block |
base |
role |
|---|---|---|
MC |
|
memory controller: command ports, STATUS, four per-frequency timing banks,
address map (Memory controller, |
PHY |
|
four 16 KiB register slices (one per frequency point), per-byte taps, gate codes, analog COMMON blocks, training status and harvest (PHY) |
PI engine |
inside the MC |
the training sequencer: commands, done bits, |
APMU (DDR part) |
|
DDR PLL1/PLL2, clock mux, lock bits, SW-FC and HW-DFC kicks, MC reset (Clocks and PMU) |
DFC window |
|
the window the hardware frequency-change table is written through
(DFC engine, aliases MC in |
Frequency points
The MC holds four timing banks and the PHY four register slices, indexed by the
frequency point fp (0..3; also pp or boot_pp in a training
context). slice(fp) = phy + (fp << 14). The banks are selected on the live
MC by CTL_FREQ[31:28] and switched at run time by the hardware DFC engine
([measured] across fp0, fp1 and fp2 in logsRefs/020-eeprom-cs-num-16gib/readme.md
and logsRefs/021-eeprom-cs-num-8gib/readme.md).
The LPDDR4X boot uses fp0, fp1 and fp2 (LPDDR4 adds fp3, [open],
docsClean/configurations); which one is left running depends on the requested rate
(The boot interface).
Reference hardware
All [measured] facts come from two Banana Pi BPI-F3 boards: an 8 GiB Samsung
K4UCE3Q4AA-MGCL (2 ranks, x8 dies, 8 Gb/die; MR5 0x01 MR8 0x52,
logsRefs/021-eeprom-cs-num-8gib/readme.md) and a 16 GiB Micron
MT53E4G32D8 (2 ranks, x8 dies, 16 Gb/die; MR5 0xff MR8 0x58,
logsRefs/020-eeprom-cs-num-16gib/readme.md), both LPDDR4X
(Test platform). Confidence labels used throughout the documentation —
[measured], [required], [inferred], [design], [open] — are
defined in SpacemiT K1 — free LPDDR4/4X DDR init: documentation.
Conventions
all registers are 32-bit, little-endian, aligned words;
addresses are always
base + offset;ddr+0x3b4andpmu+0x3b4are different registers;rank-selecting command fields use a CS mask (bit 0 = CS0, bit 1 = CS1);
data rates are in MT/s (the data rate, not the clock frequency).