summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/env_nand.c7
-rw-r--r--common/spl/spl_mmc.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index 9c9bb82..92e0e05 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -233,6 +233,12 @@ int saveenv(void)
}
#endif /* CMD_SAVEENV */
+#if defined(CONFIG_SPL_BUILD)
+static int readenv(size_t offset, u_char *buf)
+{
+ return nand_spl_load_image(offset, CONFIG_ENV_SIZE, buf);
+}
+#else
static int readenv(size_t offset, u_char *buf)
{
size_t end = offset + CONFIG_ENV_RANGE;
@@ -266,6 +272,7 @@ static int readenv(size_t offset, u_char *buf)
return 0;
}
+#endif /* #if defined(CONFIG_SPL_BUILD) */
#ifdef CONFIG_ENV_OFFSET_OOB
int get_nand_env_oob(nand_info_t *nand, unsigned long *result)
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 5d688d6..c96345e 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -76,7 +76,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
(void *)CONFIG_SYS_SPL_ARGS_ADDR);
- if (err) {
+ if (err == 0) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: mmc block read error\n");
#endif