SpacemiT_K1_DDR

← Previous: The Complete ddr_init Sequence Index Next: Acceptance Criteria and Reference Measurements →

Configurations: Byte Mode, Rank Count, Capacity, Rates, LPDDR4

The measured hardware configurations are LPDDR4X, 2 ranks, x8 byte-mode dies, 8 GiB (BPI-F3, Samsung K4UCE3Q4AA-MGCL) and 16 GiB (BPI-F3, Micron MT53E4G32D8). Final rates measured on both boards: 1066, 1200, 1333, 2400 and 2666 MT/s; 1333 is fp0 with the 2666 VCO. Everything else in this file is derived from public BSP tables, command formats, encodings and JEDEC, and is marked as such.

x8 byte mode (measured)

MR8[7:6] != 0 ⇒ x8 dies. After the first fp0 pass, out of SR:

  1. MC reset: pmu+0xb0 bit 21 low ≈100 µs, high ≈100 µs. The PLLs stay locked; do not repeat the PLL sequence. The PHY returns to its post-reset state (PHY_INIT reads 0x100, taps 0xf).
  2. Device_Init again, with the x8 overlays written in every bank after its timings and before fp0 is selected in CTL_FREQ.

Overlays (select the bank with CTL_FREQ, then write both words):

fp CTL_FREQ ddr+0x13e4 ddr+0x3b4
3 0xF0800400 0x19000A02 0x08001400
2 0xA0800400 0x15000802 0x08001000
1 0x50800400 0x0c000402 0x08000A00
0 0x00800400 0x0c000402 0x08000A00

The x16 values these replace are in the timing table of device-init.md (fp2: 0x13000802 / 0x08000e00, …).

Effect (measured): the second fp0 pass gate drops from ≈105–118 to ≈32–40 taps.

x16 dies

MR8[7:6] == 0: no MC reset, no overlays, no second Device_Init. The second fp0 pass still exists (after the map adjustment and the DFC table). Not measured on hardware.

One rank (typical 4 GiB SKUs) — not measured

16 GiB (2 ranks × 8 GiB, x8 16 Gb dies) — measured

Confirmed and characterised end to end on a 16 GiB BPI-F3 booting from the SD card:

Final rates (measured)

Final rate fp Clock Notes
1066 1 PLL2 / 2 Highest eye margin
1200 0 PLL1 / 2, 2400 VCO  
1333 0 PLL1 / 2, 2666 VCO Same fp0 bank and DFC entry as 1200; not a data_rate table entry
2400 2 PLL1 / 1, 2400 VCO  
2666 2 PLL1 / 1, 2666 VCO SoC maximum
2133 3 on LPDDR4; fp0 on LPDDR4X (fallback) PLL2 / 1 (fp3) LPDDR4X has no fp3; the final DFC returns to fp0

2666 MT/s (measured)

Only the PLL1 VCO changes (0x203c5555 / 0x50dd6538, clocks-and-pmu.md). Nothing changes in the MC banks, IO table, RL/WL or DFC table; fp2 is the same slice and bank. fp0 then runs at ≈1333 MT/s — the same VCO + fp0 is the 1333 final-rate configuration below. Training margins at fp2 are 8–9 instead of 10 (11 % shorter UI). 2666 is the SoC ceiling.

1333 MT/s (measured)

There is no 1333 entry in the data_rate table; a plain request for 1333 is treated as 1200 (the ABI has no way to distinguish it). The hardware reaches ≈1333 by programming PLL1 with the 2666 VCO and finishing at fp0 (clksel 0x3b50, CTL_FREQ 0x00800400). No MC bank, IO table, RL/WL or DFC-table change; only the PLL1 VCO differs from the 1200 configuration. Measured: RX window 20/32, TX 17/48; Linux 4.20 GB/s write / 3.23 GB/s read (1 process), 337 ns; 4 processes 4.30/4.55 GB/s. An image that wants 1333 must special-case it.

Rates above 2666 MT/s — not supported

No PLL1 setting, no MC bank, no RL/WL or MR2 value and no DFC flow exists for 2700–3200 MT/s. The DRAM’s speed bin (4266 MT/s for the reference part) does not lift the K1 PHY limit. Any other data_rate is treated as 1200; the only exception is a 1333 request handled by an image that selects the 2666 VCO + fp0 (above).

2133 MT/s

LPDDR4 only (fp3 = PLL2/1, clksel 0x3b00). On LPDDR4X there is no fp3: the request falls back to 1200 (measured: the final DFC from fp2 back to fp0 completes).

LPDDR4 (non-X) — derived, not measured

Needs a separate image: the ABI does not pass the memory type and nothing in the silicon reveals it (boot-interface.md).

Differences in Device_Init:

Item LPDDR4X LPDDR4
CA Vref (ddr+0x30c[31:24]) 0x9D 0xB2
Tx Vref seed (ddr+0x30c[23:16]) 0x19 0xA7
SoC ODT (ddr+0x30c[15:12]) 60 Ω (4) 80 Ω (3)
DRAM Tx ODT (+0x310/314[22:20]) 80 Ω (3) 120 Ω (2)
DRAM Rx drive (+0x310/314[19:16]) 60 Ω (4) 60 Ω (4)
PHY Tx drive p/n (COMMON+0xc[15:8]) 40/40 Ω (0xD8) 48/60 Ω (0xB0)
PHY Rx ODT 60 Ω 120 Ω
PHY Rx Vref (COMMON+0x4) 0x55 0x33
VOH (ddr+0x2c8[17]) 0.6 V 0.6 V
PHY supply (pmu+0x398) [11:10] = 3 [11:10] = 2, [13:12] = 3 (LDO ≈0.88 V)
WDQS (ddr+0x400, per bank) not written fp3 0x80001e06, fp2 0x80001b04, fp1 0x80001500, fp0 0x80001500
Trained points fp0, fp1, fp2 fp0, fp1, fp3, fp2

WDQS encoding (inferred): bit 31 | (n << 8) | m, e.g. fp3 0x80000000 | (0x1E << 8) | 6.

Orchestration:

PLL, SW-FC fp0
Device_Init(fp0)
train(pp0)                 cold, read MR8
[MC reset + Device_Init if x8]
adjust map
fill DFC table
train(pp0)
DFC(1); train(pp1)         1066
DFC(3); train(pp3)         2133 — after pp1, before pp2
DFC(2); train(pp2)
DFC(final)

Training differences:

Tx ODT on other LPDDR4X SKUs

Default 80 Ω for LPDDR4X, 120 Ω for LPDDR4. An EEPROM may specify another value for another 4X SKU, but the 4-argument ABI does not pass it: an image for the mainline slot can only tie the Tx ODT 1:1 to the type it is built for.

Hynix x8, 2-rank LPDDR4X SKU (H9HCNNNFAMMLXR-NEE, 8 GiB) — derived from BSP, not measured

In addition to the x8 overlays, the public BSP defines a CA drive / CA ODT configuration table (combinations 0..6) and selects combination 2 for the 8 GiB Hynix H9HCNNNFAMMLXR-NEE (x8, 2-CS) LPDDR4X part:

For completeness, the 7 combinations defined in the BSP for (ca_pdrv, ca_ndrv, ca_odt, ca_vref) are:

Combination ca_pdrv / ca_ndrv (COMMON+0x8[15:8]) ca_odt (+0x310/314[30:28], bit 23 = 1) ca_vref (+0x30c[31:24])
0 6 / 6 (0xD8, 40/40 Ω) 4 (60 Ω) 0x52
1 6 / 6 (0xD8, 40/40 Ω) 3 (80 Ω) 0x2d
2 (Hynix x8 2-CS) 6 / 6 (0xD8, 40/40 Ω) 2 (120 Ω) 0x19
3 6 / 6 (0xD8, 40/40 Ω) 1 (240 Ω) 0x15
4 5 / 5 (0xB4, 48/48 Ω) 3 (80 Ω) 0x20
5 5 / 5 (0xB4, 48/48 Ω) 2 (120 Ω) 0x13
6 5 / 5 (0xB4, 48/48 Ω) 1 (240 Ω) 0x10

The reference board is Samsung (K4UCE3Q4AA-MGCL): do not apply this there.

Gaps

These are the gaps with the highest practical impact: each one blocks a class of boards.

Gap Blocks How it could be closed
LPDDR4 (non-X): correct MR14 sweep (range bit 6, absolute values), acceptance ranges, whether CA training is needed Any LPDDR4 board Bring-up on an LPDDR4 K1 board through FDL, using the IO table and the fp3 ordering above
One rank / x16 dies (4 GiB): SR mask 0x04, map, DFC flows with rank byte 0x11 4 GiB SKUs Repeat the measurements of reference-measurements.md on a one-rank board
16 GiB (x8 16 Gb dies): meaning of bit 7 in the MR21 command (0x13020095) Meaning of MR21 bit 7 Size code 0x11, ROW_18, MR5/MR8, MR21 insertion in both DFC flows, and all four training passes are confirmed on the 16 GiB Micron board; only the semantics of bit 7 in the MR21 command (0x80 \| 21) remain open
DRAM vendors other than Samsung and Micron, including the Hynix x8 CA-ODT variant Vendor-specific IO tuning Both the 8 GiB Samsung (K4UCE3Q4AA-MGCL) and 16 GiB Micron (MT53E4G32D8) boards are characterised end to end and share the standard LPDDR4X IO settings (with 60–120 Ω Tx ODT safe on both at 2666 MT/s). The Hynix CA-ODT SKU and other vendors remain untested on hardware
A SKU that needs a different Tx ODT or the Hynix CA ODT cannot be identified through the current ABI One binary for all boards Needs an SPL change or a dedicated binary per SKU (boot-interface.md)

← Previous: The Complete ddr_init Sequence Index Next: Acceptance Criteria and Reference Measurements →