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>
*/
#include <common.h>
+#include <linux/err.h>
#include <linux/io.h>
#include <mach/ddrphy-regs.h>
if (--timeout < 0) {
printf("%s: error: timeout during DDR training\n",
__func__);
- return -1;
+ return -ETIMEDOUT;
}
udelay(1);
pgsr0 = readl(&phy->pgsr[0]);
if (pgsr0 & init_sequence[i].err_flag) {
printf("%s: error: %s failed\n", __func__,
init_sequence[i].description);
- return -1;
+ return -EIO;
}
}