]> git.sur5r.net Git - u-boot/commitdiff
ARM: uniphier: allow DDR function to return more precise error code
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 16 Dec 2015 01:50:26 +0000 (10:50 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 22 Dec 2015 15:08:27 +0000 (00:08 +0900)
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>
arch/arm/mach-uniphier/ddrphy/ddrphy-training.c

index b4d369a824ae8db45be217fdf1500b32771103fc..4852f2dec81f4f74f4dd2db1f38810ada3b56ed8 100644 (file)
@@ -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;
                }
        }