summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-16 10:50:26 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-23 00:08:27 +0900
commit6a9f6ba0f9aec784d748d9c30dcee5cd4c2eadd5 (patch)
tree4f1476b5311f2aaaeef80d607d3b6089abd7e3b4
parent11d6effeae2c0fc40af61fb17ae387c91ebda82a (diff)
downloadu-boot-imx-6a9f6ba0f9aec784d748d9c30dcee5cd4c2eadd5.zip
u-boot-imx-6a9f6ba0f9aec784d748d9c30dcee5cd4c2eadd5.tar.gz
u-boot-imx-6a9f6ba0f9aec784d748d9c30dcee5cd4c2eadd5.tar.bz2
ARM: uniphier: allow DDR function to return more precise error code
Return different error code depending on the reason so that the caller can know the cause of the failure. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--arch/arm/mach-uniphier/ddrphy/ddrphy-training.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c b/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c
index b4d369a..4852f2d 100644
--- a/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c
+++ b/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <linux/err.h>
#include <linux/io.h>
#include <mach/ddrphy-regs.h>
@@ -117,7 +118,7 @@ int ddrphy_training(struct ddrphy __iomem *phy)
if (--timeout < 0) {
printf("%s: error: timeout during DDR training\n",
__func__);
- return -1;
+ return -ETIMEDOUT;
}
udelay(1);
pgsr0 = readl(&phy->pgsr[0]);
@@ -127,7 +128,7 @@ int ddrphy_training(struct ddrphy __iomem *phy)
if (pgsr0 & init_sequence[i].err_flag) {
printf("%s: error: %s failed\n", __func__,
init_sequence[i].description);
- return -1;
+ return -EIO;
}
}