summaryrefslogtreecommitdiff
path: root/drivers/ddr/marvell/a38x/mv_ddr_spd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ddr/marvell/a38x/mv_ddr_spd.c')
-rw-r--r--drivers/ddr/marvell/a38x/mv_ddr_spd.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/ddr/marvell/a38x/mv_ddr_spd.c b/drivers/ddr/marvell/a38x/mv_ddr_spd.c
index e9e7f18098..04dbfe94d6 100644
--- a/drivers/ddr/marvell/a38x/mv_ddr_spd.c
+++ b/drivers/ddr/marvell/a38x/mv_ddr_spd.c
@@ -81,9 +81,6 @@ int mv_ddr_spd_timing_calc(union mv_ddr_spd_data *spd_data, unsigned int timing_
timing_data[MV_DDR_TWR_MIN] = (spd_data->byte_fields.byte_42 +
(spd_data->byte_fields.byte_41.bit_fields.t_wr_min_msn << MV_DDR_SPD_MSB_OFFS)) *
MV_DDR_SPD_DATA_MTB;
- /* FIXME: wa: set twr to a default value, if it's unset on spd */
- if (timing_data[MV_DDR_TWR_MIN] == 0)
- timing_data[MV_DDR_TWR_MIN] = 15000;
/* t rcd min, ps */
calc_val = spd_data->byte_fields.byte_25 * MV_DDR_SPD_DATA_MTB +
@@ -127,6 +124,13 @@ int mv_ddr_spd_timing_calc(union mv_ddr_spd_data *spd_data, unsigned int timing_
return 1;
timing_data[MV_DDR_TRRD_L_MIN] = calc_val;
+ /* t ccd l min, ps */
+ calc_val = spd_data->byte_fields.byte_40 * MV_DDR_SPD_DATA_MTB +
+ (signed char)spd_data->byte_fields.byte_117 * MV_DDR_SPD_DATA_FTB;
+ if (calc_val < 0)
+ return 1;
+ timing_data[MV_DDR_TCCD_L_MIN] = calc_val;
+
/* t faw min, ps */
timing_data[MV_DDR_TFAW_MIN] = (spd_data->byte_fields.byte_37 +
(spd_data->byte_fields.byte_36.bit_fields.t_faw_min_msn << MV_DDR_SPD_MSB_OFFS)) *
@@ -136,17 +140,11 @@ int mv_ddr_spd_timing_calc(union mv_ddr_spd_data *spd_data, unsigned int timing_
timing_data[MV_DDR_TWTR_S_MIN] = (spd_data->byte_fields.byte_44 +
(spd_data->byte_fields.byte_43.bit_fields.t_wtr_s_min_msn << MV_DDR_SPD_MSB_OFFS)) *
MV_DDR_SPD_DATA_MTB;
- /* FIXME: wa: set twtr_s to a default value, if it's unset on spd */
- if (timing_data[MV_DDR_TWTR_S_MIN] == 0)
- timing_data[MV_DDR_TWTR_S_MIN] = 2500;
/* t wtr l min, ps */
timing_data[MV_DDR_TWTR_L_MIN] = (spd_data->byte_fields.byte_45 +
(spd_data->byte_fields.byte_43.bit_fields.t_wtr_l_min_msn << MV_DDR_SPD_MSB_OFFS)) *
MV_DDR_SPD_DATA_MTB;
- /* FIXME: wa: set twtr_l to a default value, if it's unset on spd */
- if (timing_data[MV_DDR_TWTR_L_MIN] == 0)
- timing_data[MV_DDR_TWTR_L_MIN] = 7500;
return 0;
}