summaryrefslogtreecommitdiff
path: root/drivers/ddr/imx/imx8m/ddrphy_utils.c
diff options
context:
space:
mode:
authorFrieder Schrempf <frieder.schrempf@kontron.de>2019-12-11 13:01:19 +0300
committerStefano Babic <sbabic@denx.de>2020-01-07 12:26:57 +0300
commit83083febf55679ee0fc68ba55e9af43add277b58 (patch)
treeb2495a3ed95c2ec411c67de34cccb125f4dbd2ba /drivers/ddr/imx/imx8m/ddrphy_utils.c
parent162c72c80445636ec73f8833b9e91f0128d21b8f (diff)
downloadu-boot-83083febf55679ee0fc68ba55e9af43add277b58.tar.xz
ddr: imx8m: Return error values from LPDDR4 training
In cases when the same SPL should run on boards with i.MX8MM, that differ in DDR configuration, it is necessary to try different parameters and check if the training done by the firmware suceeds or not. Therefore we return the DDR training/initialization success to the upper layer in order to be able to retry with different settings if necessary. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Diffstat (limited to 'drivers/ddr/imx/imx8m/ddrphy_utils.c')
-rw-r--r--drivers/ddr/imx/imx8m/ddrphy_utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ddr/imx/imx8m/ddrphy_utils.c b/drivers/ddr/imx/imx8m/ddrphy_utils.c
index e60503309e..863fb43897 100644
--- a/drivers/ddr/imx/imx8m/ddrphy_utils.c
+++ b/drivers/ddr/imx/imx8m/ddrphy_utils.c
@@ -84,7 +84,7 @@ static inline void decode_streaming_message(void)
debug("\n");
}
-void wait_ddrphy_training_complete(void)
+int wait_ddrphy_training_complete(void)
{
unsigned int mail;
@@ -95,10 +95,10 @@ void wait_ddrphy_training_complete(void)
decode_streaming_message();
} else if (mail == 0x07) {
debug("Training PASS\n");
- break;
+ return 0;
} else if (mail == 0xff) {
- printf("Training FAILED\n");
- break;
+ debug("Training FAILED\n");
+ return -1;
}
}
}