mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 18:34:42 +00:00
ram: renesas: dbsc5: Fix JS1 index calculation
The JS1 index is calculated correctly, but the limiter cannot be the max() function because the index should be lower than JS1_USABLEC_SPEC_HI and the max() function would unconditionally override the JS1 index to JS1_USABLEC_SPEC_HI. Use clamp() to limit the JS1 index instead. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
parent
6c219e184f
commit
9a106f15fa
1 changed files with 1 additions and 1 deletions
|
@ -2192,7 +2192,7 @@ static void dbsc5_ddrtbl_calc(struct renesas_dbsc5_dram_priv *priv)
|
|||
if (js1[i].fx3 * 2 * priv->ddr_mbpsdiv >= priv->ddr_mbps * 3)
|
||||
break;
|
||||
|
||||
priv->js1_ind = max(i, JS1_USABLEC_SPEC_HI);
|
||||
priv->js1_ind = clamp(i, 0, JS1_USABLEC_SPEC_HI);
|
||||
|
||||
priv->RL = js1[priv->js1_ind].RLset1;
|
||||
priv->WL = js1[priv->js1_ind].WLsetA;
|
||||
|
|
Loading…
Add table
Reference in a new issue