Commit 6a9f6ba0 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 11d6effe
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
#include <common.h> #include <common.h>
#include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <mach/ddrphy-regs.h> #include <mach/ddrphy-regs.h>
...@@ -117,7 +118,7 @@ int ddrphy_training(struct ddrphy __iomem *phy) ...@@ -117,7 +118,7 @@ int ddrphy_training(struct ddrphy __iomem *phy)
if (--timeout < 0) { if (--timeout < 0) {
printf("%s: error: timeout during DDR training\n", printf("%s: error: timeout during DDR training\n",
__func__); __func__);
return -1; return -ETIMEDOUT;
} }
udelay(1); udelay(1);
pgsr0 = readl(&phy->pgsr[0]); pgsr0 = readl(&phy->pgsr[0]);
...@@ -127,7 +128,7 @@ int ddrphy_training(struct ddrphy __iomem *phy) ...@@ -127,7 +128,7 @@ int ddrphy_training(struct ddrphy __iomem *phy)
if (pgsr0 & init_sequence[i].err_flag) { if (pgsr0 & init_sequence[i].err_flag) {
printf("%s: error: %s failed\n", __func__, printf("%s: error: %s failed\n", __func__,
init_sequence[i].description); init_sequence[i].description);
return -1; return -EIO;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment