aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDylan Hung <dylan_hung@aspeedtech.com>2022-11-11 15:30:06 +0800
committerTom Rini <trini@konsulko.com>2022-11-24 16:25:54 -0500
commit581df347dbc3f5b528be8b36a62372c0aadde30a (patch)
tree6b863adff5c739099b2b63d7eb66496148a7efa2 /drivers
parentc246d69f31f49d9ab7667ac2e42f0bdc3f212207 (diff)
downloadu-boot-581df347dbc3f5b528be8b36a62372c0aadde30a.zip
u-boot-581df347dbc3f5b528be8b36a62372c0aadde30a.tar.gz
u-boot-581df347dbc3f5b528be8b36a62372c0aadde30a.tar.bz2
ram: ast2600: Fix incorrect statement of the register polling
The condition "~data" in the if-statement is a typo. The original intention is to poll if SDRAM_PHYCTRL0_INIT bit equals to 0. So use "data == 0" for instead. Besides, the bit[1] of "phy_status" register is hardwired to SDRAM_PHYCTRL0_INIT (with inverse logic). Since SDRAM_PHYCTRL0_INIT has already done, remove the unnecessary checking of phy_status[1]. Fixes: fde93143469f ("ram: aspeed: Add AST2600 DRAM control support") Review-by: Ryan Chen <ryan_chen@aspeedtech.com> Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ram/aspeed/sdram_ast2600.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/ram/aspeed/sdram_ast2600.c b/drivers/ram/aspeed/sdram_ast2600.c
index 9ad398d..b09232a 100644
--- a/drivers/ram/aspeed/sdram_ast2600.c
+++ b/drivers/ram/aspeed/sdram_ast2600.c
@@ -449,7 +449,7 @@ static void ast2600_sdramphy_kick_training(struct dram_info *info)
while (1) {
data = readl(&regs->phy_ctrl[0]) & SDRAM_PHYCTRL0_INIT;
- if (~data)
+ if (data == 0)
break;
}
}
@@ -984,11 +984,6 @@ static int ast2600_sdrammc_probe(struct udevice *dev)
L_ast2600_sdramphy_train:
ast2600_sdrammc_init_ddr4(priv);
- /* make sure DDR-PHY is ready before access */
- do {
- reg = readl(priv->phy_status) & BIT(1);
- } while (reg == 0);
-
if (ast2600_sdramphy_check_status(priv) != 0) {
printf("DDR4 PHY training fail, retrain\n");
goto L_ast2600_sdramphy_train;