According repeated tests, I found that not every time BL2 loads image successfully. It always stops at loading image. I change the DDR configuration to CONFIG_STATIC_DDR and modify the register value, this problem no longer exists. I think it is maybe the DDR configuration problem. And now I want to know how to configure DDR according to modify ddr_raw_timing parameters, especially caslat_x?
Our product has two DDR4 chips on board. The type of DDR is MT40A512M16LY-062 IT:E, and the following is my configuration.
/* DDR model number: MT40A512M16LY-062 IT:E */
struct dimm_params ddr_raw_timing = {
.n_ranks = 1,
.rank_density = 2147483648u,
.capacity = 2147483648u,
.primary_sdram_width = 32,
.rdimm = 0,
.mirrored_dimm = 0,
.n_row_addr = 16,
.n_col_addr = 10,
.bank_addr_bits = 0,
.bank_group_bits = 1,
.burst_lengths_bitmask = 0x0c,
.tckmin_x_ps = 625,
.tckmax_ps = 1500,
.caslat_x = 0x0001FFE00,
.taa_ps = 15000,
.trcd_ps = 15000,
.trp_ps = 15000,
.tras_ps = 32000,
.trc_ps = 47000,
.twr_ps = 15000,
.trfc1_ps = 350000,
.trfc2_ps = 260000,
.trfc4_ps = 160000,
.tfaw_ps = 30000,
.trrds_ps = 5300,
.trrdl_ps = 6400,
.tccdl_ps = 5000,
.refresh_rate_ps = 7800000,
.dq_mapping[0] = 0x0,
.dq_mapping[1] = 0x0,
.dq_mapping[2] = 0x0,
.dq_mapping[3] = 0x0,
.dq_mapping[4] = 0x0,
.dq_mapping_ors = 0,
.rc = 0x1f,
};