Skip to contentSkip to conversation

ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART

PATCH New Fabio Estevam 3 participants 3 messages Jun 5, 2013 – Jun 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART

From: Fabio Estevam <[email protected]>

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.

---
Changes since v2:
- Fix in the config files by removing CONFIG_SYS_MMC_ENV_PART Changes since v1:
- Do the change inside the mmc core

 include/configs/mx53ard.h          | 3 +--
 include/configs/mx6qsabre_common.h | 2 +-
 include/configs/mx6qsabreauto.h    | 1 -
 include/configs/mx6qsabresd.h      | 1 -
 include/configs/wandboard.h        | 3 +--
 5 files changed, 3 insertions(+), 7 deletions(-)
include/configs/mx53ard.h +1 -2
index 41974b1..b0a965f 100644
@@ -118,7 +118,7 @@
 	"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=" \
@@ -240,7 +240,6 @@
 #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
 
include/configs/mx6qsabre_common.h +1 -1
index 7298a76..bfaa420 100644
@@ -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 " \
include/configs/mx6qsabreauto.h +0 -1
index 1583c11..f2ff3e1 100644
@@ -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
 
 #endif                         /* __MX6QSABREAUTO_CONFIG_H */
include/configs/mx6qsabresd.h +0 -1
index 3b8d752..44f07cb 100644
@@ -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 */
include/configs/wandboard.h +1 -2
index d4ac086..34a8f15 100644
@@ -116,7 +116,7 @@
 	"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=" \
@@ -230,7 +230,6 @@
 #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
Signature · 2 lines
1.8.1.2
ts
#1 lore raw

PATCH v3 1/1 ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART

Quoted 40 lines

-----Original Message-----
From: Fabio Estevam [mailto:festevam at gmail.com]
Sent: Wednesday, June 05, 2013 9:06 AM
To: sbabic at denx.de
Cc: Fleming Andy-AFLEMING; swarren at nvidia.com; Liu Hui-R64343; u- boot at lists.denx.de; Estevam Fabio-R49496
Subject: [PATCH v3] ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART

From: Fabio Estevam <[email protected]>

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.

Quoted 6 lines

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

---

Quoted 94 lines

Changes since v2:
- Fix in the config files by removing CONFIG_SYS_MMC_ENV_PART Changes since v1:
- Do the change inside the mmc core

include/configs/mx53ard.h          | 3 +--
include/configs/mx6qsabre_common.h | 2 +-
include/configs/mx6qsabreauto.h    | 1 -
include/configs/mx6qsabresd.h      | 1 -
include/configs/wandboard.h        | 3 +--
5 files changed, 3 insertions(+), 7 deletions(-)
include/configs/mx53ard.h index renamed from include/configs/mx53ard.h +0 -0

41974b1..b0a965f 100644

include/configs/mx53ard.h +1 -2
@@ -118,7 +118,7 @@
 	"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=" \
@@ -240,7 +240,6 @@
 #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
 
include/configs/mx6qsabre_common.h +1 -1
index 7298a76..bfaa420 100644
@@ -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 " \
(quoted diff) +0 -0

b/include/configs/mx6qsabreauto.h index 1583c11..f2ff3e1 100644

include/configs/mx6qsabreauto.h +0 -1
@@ -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
 
 #endif                         /* __MX6QSABREAUTO_CONFIG_H */
(quoted diff) +0 -0

b/include/configs/mx6qsabresd.h index 3b8d752..44f07cb 100644

include/configs/mx6qsabresd.h +0 -1
@@ -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 */
include/configs/wandboard.h +1 -3
index d4ac086..34a8f15 100644
@@ -116,7 +116,7 @@
 	"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=" \
@@ -230,7 +230,6 @@
 #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
--

1.8.1.2
ts

#2 lore raw

PATCH v3 1/1 ARM: imx: Fix incorrect usage of CONFIG_SYS_MMC_ENV_PART

In reply to Fabio Estevam
Quoted 31 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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.

Quoted 6 lines

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

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================