Hello Eivind,
In the TFA boot flow, DDR initialization is not required in U-Boot. DDR initialization is a part of TFA.
DDR init code can be added to <atf_dir>/plat/nxp/soc-<soc-name>/<soc-name>ardb/ddr_init.c.
Please customize the following configuration for your custom board in packages/firmware/atf/plat/nxp/soc-ls1012/ls1012ardb/ddr_init.c.
static const struct fsl_mmdc_info mparam = {
.mdctl = 0x05180000,
.mdpdc = 0x00030035,
.mdotc = 0x12554000,
.mdcfg0 = 0xbabf7954,
.mdcfg1 = 0xdb328f64,
.mdcfg2 = 0x01ff00db,
.mdmisc = 0x00001680,
.mdref = 0x0f3c8000,
.mdrwd = 0x00002000,
.mdor = 0x00bf1023,
.mdasp = 0x0000003f,
.mpodtctrl = 0x0000022a,
.mpzqhwctrl = 0xa1390003,
};
In atf/plat/nxp/soc-ls1012/ls1012ardb/platform_def.h
define DDRC_NUM_CS 1 /* use 1 chip-select */
#define PLAT_DEF_DRAM0_SIZE 0x40000000 /* 1G */
Please customize RCW file in packages/firmware/rcw/ls1012ardb/R_SPNH_3508/ for you custom board.
Then regenerate ATF images.
Thanks,
Yiping