Commit 7fb72c7979dd3e73a8ac75730e5eda5538dce8f2

Authored by Fabio Estevam
Committed by Stefano Babic
1 parent 9b75bad0b9

ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART

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>

Showing 5 changed files with 3 additions and 7 deletions Side-by-side Diff

include/configs/mx53ard.h
... ... @@ -118,7 +118,7 @@
118 118 "boot_fdt=try\0" \
119 119 "ip_dyn=yes\0" \
120 120 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
121   - "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \" \
  121 + "mmcpart=2\0" \" \
122 122 "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
123 123 "update_sd_firmware_filename=u-boot.imx\0" \
124 124 "update_sd_firmware=" \
... ... @@ -240,7 +240,6 @@
240 240 #define CONFIG_ENV_SIZE (8 * 1024)
241 241 #define CONFIG_ENV_IS_IN_MMC
242 242 #define CONFIG_SYS_MMC_ENV_DEV 0
243   -#define CONFIG_SYS_MMC_ENV_PART 2
244 243  
245 244 #define CONFIG_OF_LIBFDT
246 245  
include/configs/mx6qsabre_common.h
... ... @@ -97,7 +97,7 @@
97 97 "fdt_high=0xffffffff\0" \
98 98 "initrd_high=0xffffffff\0" \
99 99 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
100   - "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \" \
  100 + "mmcpart=1\0" \" \
101 101 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
102 102 "update_sd_firmware=" \
103 103 "if test ${ip_dyn} = yes; then " \
include/configs/mx6qsabreauto.h
... ... @@ -35,7 +35,6 @@
35 35 #define CONFIG_SYS_FSL_USDHC_NUM 2
36 36 #if defined(CONFIG_ENV_IS_IN_MMC)
37 37 #define CONFIG_SYS_MMC_ENV_DEV 0
38   -#define CONFIG_SYS_MMC_ENV_PART 1 /* Boot partition 1 */
39 38 #endif
40 39  
41 40 /* I2C Configs */
include/configs/mx6qsabresd.h
... ... @@ -29,7 +29,6 @@
29 29 #define CONFIG_SYS_FSL_USDHC_NUM 3
30 30 #if defined(CONFIG_ENV_IS_IN_MMC)
31 31 #define CONFIG_SYS_MMC_ENV_DEV 1 /* SDHC3 */
32   -#define CONFIG_SYS_MMC_ENV_PART 1 /* Boot partition 1 */
33 32 #endif
34 33  
35 34 #endif /* __MX6QSABRESD_CONFIG_H */
include/configs/wandboard.h
... ... @@ -118,7 +118,7 @@
118 118 "boot_fdt=try\0" \
119 119 "ip_dyn=yes\0" \
120 120 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
121   - "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \" \
  121 + "mmcpart=2\0" \" \
122 122 "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
123 123 "update_sd_firmware_filename=u-boot.imx\0" \
124 124 "update_sd_firmware=" \
... ... @@ -232,7 +232,6 @@
232 232 #define CONFIG_ENV_IS_IN_MMC
233 233 #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
234 234 #define CONFIG_SYS_MMC_ENV_DEV 0
235   -#define CONFIG_SYS_MMC_ENV_PART 2
236 235  
237 236 #define CONFIG_OF_LIBFDT
238 237 #define CONFIG_CMD_BOOTZ