diff options
author | Marek Vasut <marex@denx.de> | 2015-07-17 02:38:51 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-08-08 14:14:15 +0200 |
commit | 8213609e68e40bf5baf3d89d3378f24892f371d9 (patch) | |
tree | 2bccff6ce7465f66a0ed02db3c1388675b285fd6 /drivers/ddr | |
parent | 4ac21610145fc7a2100b33b885b93066cb825bbb (diff) | |
download | u-boot-imx-8213609e68e40bf5baf3d89d3378f24892f371d9.zip u-boot-imx-8213609e68e40bf5baf3d89d3378f24892f371d9.tar.gz u-boot-imx-8213609e68e40bf5baf3d89d3378f24892f371d9.tar.bz2 |
ddr: altera: Internal mem_calibrate() cleanup part 3
This is kind of microseries-within-series indent cleanup.
Rework the code for the third loop within the middle-loop
of the mega-loop to make it actually readable and not an
insane cryptic pile of indent failure.
It is likely that this patch has checkpatch warnings, but
for the sake of not breaking the code, these are ignored.
No functional change.
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/ddr')
-rw-r--r-- | drivers/ddr/altera/sequencer.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/ddr/altera/sequencer.c b/drivers/ddr/altera/sequencer.c index e2e7184..7384c16 100644 --- a/drivers/ddr/altera/sequencer.c +++ b/drivers/ddr/altera/sequencer.c @@ -3390,28 +3390,21 @@ static uint32_t mem_calibrate(void) } if (group_failed == 0) { - for (read_group = write_group * - RW_MGR_MEM_IF_READ_DQS_WIDTH / - RW_MGR_MEM_IF_WRITE_DQS_WIDTH, - read_test_bgn = 0; - read_group < (write_group + 1) - * RW_MGR_MEM_IF_READ_DQS_WIDTH - / RW_MGR_MEM_IF_WRITE_DQS_WIDTH && - group_failed == 0; - read_group++, read_test_bgn += - RW_MGR_MEM_DQ_PER_READ_DQS) { - if (!((STATIC_CALIB_STEPS) & - CALIB_SKIP_WRITES)) { - if (!rw_mgr_mem_calibrate_vfifo_end - (read_group, read_test_bgn)) { - group_failed = 1; - - if (!(gbl->phy_debug_mode_flags - & PHY_DEBUG_SWEEP_ALL_GROUPS)) { - return 0; - } - } - } + for (read_group = write_group * rwdqs_ratio, + read_test_bgn = 0; + read_group < (write_group + 1) * rwdqs_ratio && group_failed == 0; + read_group++, + read_test_bgn += RW_MGR_MEM_DQ_PER_READ_DQS) { + if (STATIC_CALIB_STEPS & CALIB_SKIP_WRITES) + continue; + + if (rw_mgr_mem_calibrate_vfifo_end(read_group, + read_test_bgn)) + continue; + + group_failed = 1; + if (!(gbl->phy_debug_mode_flags & PHY_DEBUG_SWEEP_ALL_GROUPS)) + return 0; } } |