mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 08:59:33 +00:00
ddr: altera: Clean up rw_mgr_mem_calibrate_read_test() part 1
Clean up the debug output handling at the end of the function and factor out common function call from the condition. Signed-off-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
96df60364d
commit
3853d65e20
1 changed files with 16 additions and 13 deletions
|
@ -1189,6 +1189,8 @@ static uint32_t rw_mgr_mem_calibrate_read_test(uint32_t rank_bgn, uint32_t group
|
||||||
*bit_chk = param->read_correct_mask;
|
*bit_chk = param->read_correct_mask;
|
||||||
correct_mask_vg = param->read_correct_mask_vg;
|
correct_mask_vg = param->read_correct_mask_vg;
|
||||||
|
|
||||||
|
int ret;
|
||||||
|
|
||||||
uint32_t quick_read_mode = (((STATIC_CALIB_STEPS) &
|
uint32_t quick_read_mode = (((STATIC_CALIB_STEPS) &
|
||||||
CALIB_SKIP_DELAY_SWEEPS) && ENABLE_SUPER_QUICK_CALIBRATION);
|
CALIB_SKIP_DELAY_SWEEPS) && ENABLE_SUPER_QUICK_CALIBRATION);
|
||||||
|
|
||||||
|
@ -1260,22 +1262,23 @@ static uint32_t rw_mgr_mem_calibrate_read_test(uint32_t rank_bgn, uint32_t group
|
||||||
addr = SDR_PHYGRP_RWMGRGRP_ADDRESS | RW_MGR_RUN_SINGLE_GROUP_OFFSET;
|
addr = SDR_PHYGRP_RWMGRGRP_ADDRESS | RW_MGR_RUN_SINGLE_GROUP_OFFSET;
|
||||||
writel(RW_MGR_CLEAR_DQS_ENABLE, addr + (group << 2));
|
writel(RW_MGR_CLEAR_DQS_ENABLE, addr + (group << 2));
|
||||||
|
|
||||||
|
set_rank_and_odt_mask(0, RW_MGR_ODT_MODE_OFF);
|
||||||
|
|
||||||
if (all_correct) {
|
if (all_correct) {
|
||||||
set_rank_and_odt_mask(0, RW_MGR_ODT_MODE_OFF);
|
ret = (*bit_chk == param->read_correct_mask);
|
||||||
debug_cond(DLEVEL == 2, "%s:%d read_test(%u,ALL,%u) =>\
|
debug_cond(DLEVEL == 2,
|
||||||
(%u == %u) => %lu", __func__, __LINE__, group,
|
"%s:%d read_test(%u,ALL,%u) => (%u == %u) => %i\n",
|
||||||
all_groups, *bit_chk, param->read_correct_mask,
|
__func__, __LINE__, group, all_groups, *bit_chk,
|
||||||
(long unsigned int)(*bit_chk ==
|
param->read_correct_mask, ret);
|
||||||
param->read_correct_mask));
|
|
||||||
return *bit_chk == param->read_correct_mask;
|
|
||||||
} else {
|
} else {
|
||||||
set_rank_and_odt_mask(0, RW_MGR_ODT_MODE_OFF);
|
ret = (*bit_chk != 0x00);
|
||||||
debug_cond(DLEVEL == 2, "%s:%d read_test(%u,ONE,%u) =>\
|
debug_cond(DLEVEL == 2,
|
||||||
(%u != %lu) => %lu\n", __func__, __LINE__,
|
"%s:%d read_test(%u,ONE,%u) => (%u != %u) => %i\n",
|
||||||
group, all_groups, *bit_chk, (long unsigned int)0,
|
__func__, __LINE__, group, all_groups, *bit_chk,
|
||||||
(long unsigned int)(*bit_chk != 0x00));
|
0, ret);
|
||||||
return *bit_chk != 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue