Add initial SPL support for LPDDR5 initialization on the SpacemiT K3
SoC.
The DDR driver follows the vendor initialization sequence, selects a
memory profile using the DDR part number read from the board's EEPROM,
and configures both DDR controllers and PHYs to perform LPDDR5 training.
Loading the next boot stage is not implemented yet. SPL currently
returns BOOT_DEVICE_NONE and stops with "Unsupported Boot Device!"
after successful DRAM initialization. No LPDDR4X boards are currently
available for testing, so LPDDR4X support will be added in a separate
series in the future.
Tested on 8 GiB and 16 GiB Pico-ITX boards and an 8 GiB COM260 board by
entering BootROM USB download mode and running:
fastboot stage spl/u-boot-spl-mkimage.bin && fastboot continue
---
Junhui Liu (5):
ram: spacemit: Add DDR driver for K3 SoC
riscv: spacemit: k3: Add SPL initialization support
riscv: dts: spacemit: k3: Add SPL device and image descriptions
configs: spacemit: k3: Enable SPL support
doc: spacemit: k3: Add SPL build instructions
arch/riscv/cpu/k3/Kconfig | 6 +-
arch/riscv/cpu/k3/Makefile | 1 +
arch/riscv/cpu/k3/spl.c | 52 +
arch/riscv/dts/spacemit-k3-binman.dtsi | 24 +
arch/riscv/dts/spacemit-k3-u-boot.dtsi | 54 +
arch/riscv/include/asm/arch-k3/csr.h | 20 +
arch/riscv/include/asm/arch-k3/spl.h | 11 +
board/spacemit/k3/Makefile | 5 +
board/spacemit/k3/spl.c | 127 ++
configs/spacemit_k3_defconfig | 22 +
doc/board/spacemit/spacemit-pico-itx.rst | 12 +-
drivers/ram/Kconfig | 1 +
drivers/ram/Makefile | 1 +
drivers/ram/spacemit/Kconfig | 6 +
drivers/ram/spacemit/Makefile | 3 +
drivers/ram/spacemit/k3/Makefile | 9 +
drivers/ram/spacemit/k3/k3_ddr.c | 134 ++
drivers/ram/spacemit/k3/k3_ddr.h | 169 +++
drivers/ram/spacemit/k3/k3_ddr_ctrl.c | 73 ++
drivers/ram/spacemit/k3/k3_ddr_lpddr5.c | 538 ++++++++
drivers/ram/spacemit/k3/k3_ddr_lpddr5_tables.c | 1668 ++++++++++++++++++++++++
drivers/ram/spacemit/k3/k3_ddr_phy.c | 149 +++
drivers/ram/spacemit/k3/k3_ddr_profile.c | 54 +
include/configs/spacemit-k3.h | 3 +
include/soc/spacemit/k3-ddr.h | 13 +
25 files changed, 3150 insertions(+), 5 deletions(-)
---
base-commit: d1d45c926a571fb6c1e6d7105c280833646915ea
change-id: 20261104-k3-ddr-85685cac0f02
Best regards,
--
Junhui Liu <[email protected]>