Hi,
we have a custom board designed based on LX2160ARDB with a discrete DDR on it.Our DDR4 RAM is of type K4A8G165WC-BCTD and has a max speed of 2666MT/s. Based on LSDK20.04 made below changes
flexbuild/packages/firmware/atf/plat/nxp/soc-lx2160/lx2160ardb/platform_def.h
#define CONFIG_DDR_NODIMM
flexbuild/packages/firmware/atf/plat/nxp/soc-lx2160/lx2160ardb/ddr_init.c
struct dimm_params ddr_raw_timing = {
.n_ranks = 1,
.rank_density = 2147483648u,
.capacity = 4294967296u,
.primary_sdram_width = 64,
.ec_sdram_width = 8,
.device_width = 16,
.die_density = 0x2,
.rdimm = 0,
.mirrored_dimm = 0,
.n_row_addr = 16,
.n_col_addr = 10,
.bank_addr_bits = 0,
.bank_group_bits = 1,
.edc_config = 2,
.burst_lengths_bitmask = 0x0c,
.tckmin_x_ps = 750,
.tckmax_ps = 1250,
.caslat_x = 0x000FF800,
.taa_ps = 13750,
.trcd_ps = 13750,
.trp_ps = 13750,
.tras_ps = 32000,
.trc_ps = 457500,
.twr_ps = 15000,
.trfc1_ps = 350000,
.trfc2_ps = 260000,
.trfc4_ps = 160000,
.tfaw_ps = 28000,
.trrds_ps = 6000,
.trrdl_ps = 7500,
.tccdl_ps = 5000,
.refresh_rate_ps = 7800000,
};
int ddr_get_ddr_params(struct dimm_params *pdimm, struct ddr_conf *conf)
{
static const char dimm_model[] = "Fixed DDR on board";
conf->dimm_in_use[0] = 1; /* Modify accordingly */
memcpy(pdimm, &ddr_raw_timing, sizeof(struct dimm_params));
memcpy(pdimm->mpart, dimm_model, sizeof(dimm_model) - 1);
/* valid DIMM mask, change accordingly, together with dimm_on_ctlr. */
return 0x5;
}
Timings are modified based on the attached datasheet of DDR4.I have attached the boot log which contains the error details.we are not able to find which is causing DDR initialization failure.
Can anyone please help on this?
Thanks.