karo: tx28: fix build error with 'CONFIG_ENV_IS_IN_MMC'
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Sep 2014 08:23:34 +0000 (10:23 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Sep 2014 08:23:34 +0000 (10:23 +0200)
board/karo/common/mmc.c
include/configs/tx28.h

index f88e1cf..c6a7a3d 100644 (file)
@@ -93,6 +93,7 @@ static int karo_mmc_find_part(struct mmc *mmc, const char *part, int devno,
        int ret;
        block_dev_desc_t *mmc_dev;
 
+#if defined(CONFIG_SYS_DTB_OFFSET) && defined(CONFIG_SYS_MMC_ENV_PART)
        if (strcmp(part, "dtb") == 0) {
                const int partnum = CONFIG_SYS_MMC_ENV_PART;
 
@@ -104,10 +105,10 @@ static int karo_mmc_find_part(struct mmc *mmc, const char *part, int devno,
                        part_info->start + part_info->size - 1);
                return partnum;
        }
-
+#endif
        ret = find_partitions("mmc", devno, FS_TYPE_FAT, &mmc_dev, part_info);
        if (ret < 0) {
-               printf("No eMMC partition found: %d\n", ret);
+               printf("No (e)MMC partition found: %d\n", ret);
                return ret;
        }
        return 0;
@@ -118,7 +119,7 @@ int karo_load_mmc_part(const char *part, void *addr, size_t len)
        int ret;
        struct mmc *mmc;
        disk_partition_t part_info;
-       int devno = CONFIG_MMC_BOOT_DEV;
+       int devno = CONFIG_SYS_MMC_ENV_DEV;
        lbaint_t blk_cnt;
        int partnum;
 
index 5af01dc..6b892f8 100644 (file)
 #undef CONFIG_ENV_IS_IN_NAND
 #endif /* CONFIG_CMD_NAND */
 
+#ifdef CONFIG_ENV_IS_IN_NAND
 #define CONFIG_ENV_OFFSET              (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
 #define CONFIG_ENV_SIZE                        SZ_128K
 #define CONFIG_ENV_RANGE               (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
+#endif /* CONFIG_ENV_IS_IN_NAND */
+
 #ifdef CONFIG_ENV_OFFSET_REDUND
 #define CONFIG_SYS_ENV_PART_STR                xstr(CONFIG_SYS_ENV_PART_SIZE)  \
        "(env),"                                                        \
  */
 #ifdef CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV         0
-#undef CONFIG_ENV_OFFSET
-#undef CONFIG_ENV_SIZE
 /* Associated with the MMC layout defined in mmcops.c */
 #define CONFIG_ENV_OFFSET              SZ_1K
 #define CONFIG_ENV_SIZE                        (SZ_128K - CONFIG_ENV_OFFSET)