Skip to contentSkip to conversation

env: Save environment at the end of an MMC partition

PATCH New Jorge Ramirez-Ortiz 2 participants 9 messages Nov 6, 2017 – Nov 17, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 env: Save environment at the end of an MMC partition

Allow the platform to define a partition by name at the end of which the environment data will be located.

---
 doc/device-tree-bindings/config.txt |  9 ++++++
 env/mmc.c                           | 62 ++++++++++++++++++++++++++++++++++---
 2 files changed, 67 insertions(+), 4 deletions(-)
doc/device-tree-bindings/config.txt +9 -0
index fe0e04a..15e4349 100644
@@ -21,6 +21,15 @@ u-boot,efi-partition-entries-offset
 
 	This setting will override any values configured via Kconfig.
 
+u-boot,mmc-env-partition
+	if present, the environment shall be placed at the last
+	CONFIG_ENV_SIZE blocks of the partition on the
+	CONFIG_SYS_MMC_ENV_DEV.
+
+	if u-boot,mmc-env-offset* is present, this setting will take
+	precedence. In that case, only if the partition is not found,
+	mmc-env-offset* will be tried.
+
 u-boot,mmc-env-offset
 u-boot,mmc-env-offset-redundant
 	If present, the values of the 'u-boot,mmc-env-offset' and/or
env/mmc.c +58 -4

85 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

Save the environment data at the end of the boot partition on emmc

---
 arch/arm/dts/dragonboard410c-uboot.dtsi | 7 +++++++
 configs/dragonboard410c_defconfig       | 2 ++
 include/configs/dragonboard410c.h       | 1 +
 3 files changed, 10 insertions(+)
arch/arm/dts/dragonboard410c-uboot.dtsi +7 -0
index cc2c175..c3475c4 100644
@@ -6,6 +6,13 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+/ {
+	config {
+		u-boot,mmc-env-partition = "boot";
+	};
+};
+
+
 &pm8916_gpios {
 	usb_hub_reset_pm {
 		gpios = <&pm8916_gpios 2 0>;
configs/dragonboard410c_defconfig +2 -0
index a85aa74..4c04544 100644
@@ -43,3 +43,5 @@ CONFIG_USB_ETHER_ASIX88179=y
 CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_IS_IN_MMC=y
include/configs/dragonboard410c.h +1 -0
index 6b5d59d..d2447b2 100644
@@ -100,6 +100,7 @@ REFLASH(dragonboard/u-boot.img, 8)\
 	BOOTENV
 
 #define CONFIG_ENV_SIZE			0x2000
+#define CONFIG_SYS_MMC_ENV_DEV		0	/* mmc0 = emmc, mmc1 = sd */
 #define CONFIG_ENV_VARS_UBOOT_CONFIG
 
 /* Size of malloc() pool */
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

Quoted 8 lines · Jorge Ramirez-Ortiz

Save the environment data at the end of the boot partition on emmc

---
 arch/arm/dts/dragonboard410c-uboot.dtsi | 7 +++++++
 configs/dragonboard410c_defconfig       | 2 ++
 include/configs/dragonboard410c.h       | 1 +
 3 files changed, 10 insertions(+)

Implementation this seems fine. Is there a reason to do this vs ENV_IS_IN_FAT? Or ENV_IS_IN_EXT ? And have it be in a filesystem instead? That usually seems to be best for eval/dev/etc style boards.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171107/7765841b/attachment.sig>
#3 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

Quoted 10 lines · Tom Rini
Quoted 8 lines · Jorge Ramirez-Ortiz

Save the environment data at the end of the boot partition on emmc

---
  arch/arm/dts/dragonboard410c-uboot.dtsi | 7 +++++++
  configs/dragonboard410c_defconfig       | 2 ++
  include/configs/dragonboard410c.h       | 1 +
  3 files changed, 10 insertions(+)
Quoted 3 lines

Implementation this seems fine. Is there a reason to do this vs ENV_IS_IN_FAT? Or ENV_IS_IN_EXT ? And have it be in a filesystem instead? That usually seems to be best for eval/dev/etc style boards.

I think having it on a partition offset (a partition that typically just stores the uboot image) can be very convenient when having the filesystem on an NFS share.

It means that the user can completely ignore flashing and maintaining the filesystem until he is ready. The only issue I see is that it is up to the user - when he reprograms a new image or modifies the size of the environemnt- to make sure the environment and whatever image is in the partition dont overlap each other but I think that should be acceptable?

Quoted 1 line
#4 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

Quoted 19 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 8 lines · Jorge Ramirez-Ortiz

Save the environment data at the end of the boot partition on emmc

---
 arch/arm/dts/dragonboard410c-uboot.dtsi | 7 +++++++
 configs/dragonboard410c_defconfig       | 2 ++
 include/configs/dragonboard410c.h       | 1 +
 3 files changed, 10 insertions(+)
Quoted 3 lines

Implementation this seems fine. Is there a reason to do this vs ENV_IS_IN_FAT? Or ENV_IS_IN_EXT ? And have it be in a filesystem instead? That usually seems to be best for eval/dev/etc style boards.

I think having it on a partition offset (a partition that typically just stores the uboot image) can be very convenient when having the filesystem on an NFS share.

Quoted 5 lines

It means that the user can completely ignore flashing and maintaining the filesystem until he is ready. The only issue I see is that it is up to the user - when he reprograms a new image or modifies the size of the environemnt- to make sure the environment and whatever image is in the partition dont overlap each other but I think that should be acceptable?

Well, if you think environment in flash is best, that's fine. I just want to make sure the alternatives are known as I keep surprising people when I note that the env can be a file in FAT or similar. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171108/ed3f7f8e/attachment.sig>
#5 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

Quoted 19 lines · Tom Rini
Quoted 18 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 8 lines · Jorge Ramirez-Ortiz

Save the environment data at the end of the boot partition on emmc

---
  arch/arm/dts/dragonboard410c-uboot.dtsi | 7 +++++++
  configs/dragonboard410c_defconfig       | 2 ++
  include/configs/dragonboard410c.h       | 1 +
  3 files changed, 10 insertions(+)
Quoted 3 lines

Implementation this seems fine. Is there a reason to do this vs ENV_IS_IN_FAT? Or ENV_IS_IN_EXT ? And have it be in a filesystem instead? That usually seems to be best for eval/dev/etc style boards.

I think having it on a partition offset (a partition that typically just stores the uboot image) can be very convenient when having the filesystem on an NFS share.

Quoted 8 lines
Quoted 5 lines

It means that the user can completely ignore flashing and maintaining the filesystem until he is ready. The only issue I see is that it is up to the user - when he reprograms a new image or modifies the size of the environemnt- to make sure the environment and whatever image is in the partition dont overlap each other but I think that should be acceptable?

Well, if you think environment in flash is best, that's fine. I just want to make sure the alternatives are known as I keep surprising people when I note that the env can be a file in FAT or similar. Thanks!

cool. yes please, I think - in my experience with poplar and now the db410 this is a useful configuration to have

Quoted 1 line
#6 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

In reply to Jorge Ramirez-Ortiz
Quoted 1 line · Jorge Ramirez-Ortiz

Save the environment data at the end of the boot partition on emmc

any progress on this patchset?
the db410c emmc support remains broken on the dragonboard 410c.

TIA
Jorge

#7 lore raw

PATCH 2/2 configs: dragonboard410c: Save environment data on eMMC

In reply to Jorge Ramirez-Ortiz
Quoted 3 lines · Jorge Ramirez-Ortiz

Save the environment data at the end of the boot partition on emmc

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171117/d4c2e057/attachment.sig>
#8 lore raw

PATCH 1/2 env: Save environment at the end of an MMC partition

In reply to Jorge Ramirez-Ortiz
Quoted 4 lines · Jorge Ramirez-Ortiz

Allow the platform to define a partition by name at the end of which the environment data will be located.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171117/ce7b5726/attachment.sig>