ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 4 Jun 2013 15:05:39 +0000 (15:05 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 6 Jun 2013 13:45:42 +0000 (15:45 +0200)
When running the "save" command several times on a mx6qsabresd we see:

U-Boot > save
Saving Environment to MMC...
Writing to MMC(1)... done
U-Boot > save
Saving Environment to MMC...
MMC partition switch failed
U-Boot > save
Saving Environment to MMC...
Writing to MMC(1)... done
U-Boot > save
Saving Environment to MMC...
MMC partition switch failed
U-Boot > save
Saving Environment to MMC...
Writing to MMC(1)... done
U-Boot > save
Saving Environment to MMC...
MMC partition switch failed

This issue is caused by the incorrect usage of CONFIG_SYS_MMC_ENV_PART.

CONFIG_SYS_MMC_ENV_PART should be used to specify the mmc partition that stores
the environment variables.

On some imx boards it is been incorrectly used to pass the partition of kernel
and dtb files for the 'mmcpart' script variable.

Remove the CONFIG_SYS_MMC_ENV_PART usage and configure the 'mmcpart' variable
directly.

Reported-by: Jason Liu <r64343@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Jason Liu <r64343@freescale.com>
include/configs/mx53ard.h
include/configs/mx6qsabre_common.h
include/configs/mx6qsabreauto.h
include/configs/mx6qsabresd.h
include/configs/wandboard.h

index 41974b12628a99786250486f86d896c8a9591379..b0a965fbba490bf9da460cb49986350202673e77 100644 (file)
        "boot_fdt=try\0" \
        "ip_dyn=yes\0" \
        "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
-       "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \
+       "mmcpart=2\0" \
        "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
        "update_sd_firmware_filename=u-boot.imx\0" \
        "update_sd_firmware=" \
 #define CONFIG_ENV_SIZE        (8 * 1024)
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
-#define CONFIG_SYS_MMC_ENV_PART        2
 
 #define CONFIG_OF_LIBFDT
 
index 7298a7692e9d849dd74e4ba3fa8da1cda82659e1..bfaa420ed0179a364fd6eca1f059709c2ae3f874 100644 (file)
@@ -97,7 +97,7 @@
        "fdt_high=0xffffffff\0"   \
        "initrd_high=0xffffffff\0" \
        "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
-       "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \
+       "mmcpart=1\0" \
        "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
        "update_sd_firmware=" \
                "if test ${ip_dyn} = yes; then " \
index 947ea600940d17111860fc22bbd168ef6fc928d7..76f7812069057b1daf69663d36f574ee9377b460 100644 (file)
@@ -35,7 +35,6 @@
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #if defined(CONFIG_ENV_IS_IN_MMC)
 #define CONFIG_SYS_MMC_ENV_DEV         0
-#define CONFIG_SYS_MMC_ENV_PART                1       /* Boot partition 1 */
 #endif
 
 /* I2C Configs */
index 3b8d752eed86d20c04da31c82de36c812bc4498c..44f07cbe45a658d87faafedd97fdd7c285aac221 100644 (file)
@@ -29,7 +29,6 @@
 #define CONFIG_SYS_FSL_USDHC_NUM       3
 #if defined(CONFIG_ENV_IS_IN_MMC)
 #define CONFIG_SYS_MMC_ENV_DEV         1       /* SDHC3 */
-#define CONFIG_SYS_MMC_ENV_PART                1       /* Boot partition 1 */
 #endif
 
 #endif                         /* __MX6QSABRESD_CONFIG_H */
index 823e17b4dd9c1c4a66c676e9f037fb0270c5c284..5593f1c533a69090ec5be75600ea491920ec498f 100644 (file)
        "boot_fdt=try\0" \
        "ip_dyn=yes\0" \
        "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
-       "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \
+       "mmcpart=2\0" \
        "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
        "update_sd_firmware_filename=u-boot.imx\0" \
        "update_sd_firmware=" \
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_ENV_OFFSET              (6 * 64 * 1024)
 #define CONFIG_SYS_MMC_ENV_DEV         0
-#define CONFIG_SYS_MMC_ENV_PART                2
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ