X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=env%2Fmmc.c;h=a8b661db80af45766811d7620c1b5b5d6dca23e7;hb=1b6ae82a5abb4cbedb0d6cb262526173f4efa486;hp=9f1878def13a63d29cf9ba7e11dfd6f1686fe5ff;hpb=60f38d82c45fef55ac04ee52b234e6dd07e31935;p=oweals%2Fu-boot.git diff --git a/env/mmc.c b/env/mmc.c index 9f1878def1..a8b661db80 100644 --- a/env/mmc.c +++ b/env/mmc.c @@ -22,21 +22,12 @@ #define __STR(X) #X #define STR(X) __STR(X) -#if defined(CONFIG_ENV_SIZE_REDUND) && \ - (CONFIG_ENV_SIZE_REDUND != CONFIG_ENV_SIZE) -#error CONFIG_ENV_SIZE_REDUND should be the same as CONFIG_ENV_SIZE -#endif - DECLARE_GLOBAL_DATA_PTR; -#if !defined(CONFIG_ENV_OFFSET) -#define CONFIG_ENV_OFFSET 0 -#endif - #if CONFIG_IS_ENABLED(OF_CONTROL) static inline int mmc_offset_try_partition(const char *str, s64 *val) { - disk_partition_t info; + struct disk_partition info; struct blk_desc *desc; int len, i, ret; @@ -362,6 +353,7 @@ static int env_mmc_load(void) int ret; int dev = mmc_get_env_dev(); const char *errmsg; + env_t *ep = NULL; mmc = find_mmc_device(dev); @@ -383,6 +375,10 @@ static int env_mmc_load(void) } ret = env_import(buf, 1); + if (!ret) { + ep = (env_t *)buf; + gd->env_addr = (ulong)&ep->data; + } fini: fini_mmc_for_env(mmc);