MEM-2 DDR pin swap across bytes and other errors¶
| Severity | Status | Implementation |
|---|---|---|
| error | planned | hard, depends on NET-7, NET-10 |
Looks at. DDR controller and DRAM pin functions, the family's swap rules.
What it catches. A DDR data bit routed into another byte lane than its strobe (DQ12 of the controller to DQ3 of the DRAM while DQS1 goes to DQS1), DM or DQS mixed between lanes, swapped address or command lines on a memory type that forbids it, and swaps on the lanes a controller needs straight (LPDDR byte 0 on some SoCs).
Why it matters. Each byte lane is captured with its own strobe and trained (write levelling, read gate, DQ deskew) as a unit: a bit wired into a foreign lane is sampled against the wrong DQS and fails at speed, if at all. Bits within a byte may usually be swapped to ease routing, since data is just stored and read back in the same order. Address and command lines may not: mode registers are written over them, so a swapped A-line writes the wrong CAS latency or burst length into the DRAM. Some controllers read mode registers or run calibration patterns over byte 0 and forbid any swap there. The rules differ per family and controller, so a board copied from another SoC can be wrong while looking tidy.
Example. An STM32MP135 with one 16-bit LPDDR3: the layout person swaps DQ2 and DQ5 in byte 0 to save a via. AN5692 §5.1 says byte 0 of the LPDDR⅔ must go to byte 0 of the MP13 with no bit swap inside it, so the calibration fails at boot. The same swap on a DDR3L would have been fine (§4.1, "swappable bits in the same byte").
How to check. Map each controller DQ/DQS/DM pin to the DRAM pin it reaches (NET-10 through series resistors), group by lane (DQ0-7 with DQS0 and DM0, and so on), and flag a bit whose DRAM lane differs from its strobe's. Then apply the controller's own swap rules, kept as per-family part data: byte swaps allowed or not, bit swaps per lane, address mirroring.
Fix. Keep every DQ with its DQS and DM; swap only what the controller's hardware guide allows, and record deliberate swaps for the firmware (some controllers need the map in a register).
References. SPRABI1 §6.3.1.4 ("address lines cannot be swapped"), §6.3.1.6 (data bits within a byte lane may be swapped), Table 6-5 (byte lane grouping); AN5692 §4.1 (DDR3/3L: two swappable bytes, swappable bits), §5.1 (LPDDR⅔: byte 0 fixed, no bit swap); JESD79-3.