Device_Init
Device_Init is the one-time programming that takes the MC and PHY from a
clocked-but-idle state to DRAM that is powered up and refreshing at fp0, ready
to train. The firmware implements it in Controller bring-up.
The timing-bank accepted ranges and isolated optima are
MC timing: accepted ranges and optima. k1_mc_timing is the programmed boot
table; the SKU intersection is not shipped.
Phases
MC programming. Write the frequency-independent globals and the four timing banks (with the IO rows computed from the memory type’s electrical configuration, and the x8 overlays for byte-mode parts), then select fp0 and write the refresh words. The
CTL0read-back confirms the MC is clocked.PHY analog. Program the per-slice COMMON blocks (drive, ODT, Vref) and the PHY bias/LDO in the PMU; arm the COMMON blocks (write 0 then 1); set the per-slice and global PHY init bits (PHY,
src/lib/k1_ddr_init.c).DRAM power-up. The DFI
init_starthandshake throughPI_CMD/PI_STATUS, then JEDEC init throughUSER_0waiting on STATUS, the first batch of mode-register writes, per-rank ZQ calibration (START, wait, LATCH, wait), and the second batch of mode-register writes (Mode registers).
Verification
After the three phases the controller reports fp0 selected
(CTL_FREQ == 0x00800400, PI_CFG[3:2] == 0) and PHY_INIT == 0x100
([measured] on both reference boards in
logsRefs/020-eeprom-cs-num-16gib/readme.md and
logsRefs/021-eeprom-cs-num-8gib/readme.md; a PHY_INIT mismatch is only
warned about). Wait masks and timeout budgets are defined in
src/lib/k1_ddr_init.c (and checked against tools/test/model.c); the
firmware’s checks and error steps (mc-program, dfi-init,
dram-init) are in Controller bring-up.
Byte mode (x8)
For x8 dies the sequence runs twice: a first Device_Init with x16 timings makes
MR8 readable, and after the geometry is known the MC is reset and Device_Init is
re-run with the x8 overlays applied to every bank ([measured]: the cold
x16 pass 0 reports gate bytes 0x6e–0x75 while the post-overlay pass 1
shifts to 0x1d–0x25 in logsRefs/020-eeprom-cs-num-16gib/readme.md
and logsRefs/021-eeprom-cs-num-8gib/readme.md;
Boot sequence).