mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-05 22:31:36 +00:00
ddr: altera: Clean up sdr_find_window_centre() part 3
Reorder the end of the function a little by moving the conditional debug output around a little. Rename the function from _centre() to _center(). Document the function in kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
cbb0b7e036
commit
0a13a0fb7a
1 changed files with 20 additions and 15 deletions
|
@ -1480,7 +1480,16 @@ static int sdr_nonworking_phase(uint32_t *grp, uint32_t *bit_chk,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sdr_find_window_centre(const u32 grp, const u32 work_bgn,
|
/**
|
||||||
|
* sdr_find_window_center() - Find center of the working DQS window.
|
||||||
|
* @grp: Read/Write group
|
||||||
|
* @work_bgn: First working settings
|
||||||
|
* @work_end: Last working settings
|
||||||
|
* @val: VFIFO value
|
||||||
|
*
|
||||||
|
* Find center of the working DQS enable window.
|
||||||
|
*/
|
||||||
|
static int sdr_find_window_center(const u32 grp, const u32 work_bgn,
|
||||||
const u32 work_end, const u32 val)
|
const u32 work_end, const u32 val)
|
||||||
{
|
{
|
||||||
u32 bit_chk, work_mid, v = val;
|
u32 bit_chk, work_mid, v = val;
|
||||||
|
@ -1525,23 +1534,19 @@ static int sdr_find_window_centre(const u32 grp, const u32 work_bgn,
|
||||||
if (rw_mgr_mem_calibrate_read_test_all_ranks(grp, 1,
|
if (rw_mgr_mem_calibrate_read_test_all_ranks(grp, 1,
|
||||||
PASS_ONE_BIT,
|
PASS_ONE_BIT,
|
||||||
&bit_chk, 0)) {
|
&bit_chk, 0)) {
|
||||||
break;
|
debug_cond(DLEVEL == 2,
|
||||||
|
"%s:%d center: found: vfifo=%u ptap=%u dtap=%u\n",
|
||||||
|
__func__, __LINE__, v, p, d);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fiddle with FIFO */
|
/* Fiddle with FIFO. */
|
||||||
rw_mgr_incr_vfifo(grp, &v);
|
rw_mgr_incr_vfifo(grp, &v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= VFIFO_SIZE) {
|
debug_cond(DLEVEL == 2, "%s:%d center: failed.\n",
|
||||||
debug_cond(DLEVEL == 2, "%s:%d center: failed.\n",
|
__func__, __LINE__);
|
||||||
__func__, __LINE__);
|
return -EINVAL;
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
debug_cond(DLEVEL == 2,
|
|
||||||
"%s:%d center: found: vfifo=%u ptap=%u dtap=%u\n",
|
|
||||||
__func__, __LINE__, v, p, d);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find a good dqs enable to use */
|
/* find a good dqs enable to use */
|
||||||
|
@ -1759,8 +1764,8 @@ static uint32_t rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase(uint32_t grp)
|
||||||
|
|
||||||
/* ******************************************** */
|
/* ******************************************** */
|
||||||
/* * step 6: Find the centre of the window * */
|
/* * step 6: Find the centre of the window * */
|
||||||
if (sdr_find_window_centre(grp, work_bgn, work_end, v) == 0)
|
if (sdr_find_window_centre(grp, work_bgn, work_end, v))
|
||||||
return 0;
|
return 0; /* FIXME: Old code, return 0 means failure :-( */
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue