diff mbox series

[2/2] configs: dragonboard410c: Save environment data on eMMC

Message ID 1509974198-14831-2-git-send-email-jorge.ramirez-ortiz@linaro.org
State Accepted
Commit 9a16153834d09372a5768ba499e5411f12801bda
Headers show
Series [1/2] env: Save environment at the end of an MMC partition | expand

Commit Message

Jorge Ramirez-Ortiz Nov. 6, 2017, 1:16 p.m. UTC
Save the environment data at the end of the boot partition on emmc

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
---
 arch/arm/dts/dragonboard410c-uboot.dtsi | 7 +++++++
 configs/dragonboard410c_defconfig       | 2 ++
 include/configs/dragonboard410c.h       | 1 +
 3 files changed, 10 insertions(+)

Comments

Tom Rini Nov. 7, 2017, 10:50 p.m. UTC | #1
On Mon, Nov 06, 2017 at 02:16:38PM +0100, Jorge Ramirez-Ortiz wrote:

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

> 

> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

> ---

>  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.

-- 
Tom
Jorge Ramirez-Ortiz Nov. 8, 2017, 7:49 a.m. UTC | #2
On 11/07/2017 11:50 PM, Tom Rini wrote:
> On Mon, Nov 06, 2017 at 02:16:38PM +0100, Jorge Ramirez-Ortiz wrote:
>
>> Save the environment data at the end of the boot partition on emmc
>>
>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>> ---
>>   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.

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?











>
Tom Rini Nov. 9, 2017, 1:58 a.m. UTC | #3
On Wed, Nov 08, 2017 at 08:49:09AM +0100, Jorge Ramirez wrote:
> On 11/07/2017 11:50 PM, Tom Rini wrote:

> >On Mon, Nov 06, 2017 at 02:16:38PM +0100, Jorge Ramirez-Ortiz wrote:

> >

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

> >>

> >>Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

> >>---

> >>  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.

> 

> 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?


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!

-- 
Tom
Jorge Ramirez-Ortiz Nov. 9, 2017, 8:35 a.m. UTC | #4
On 11/09/2017 02:58 AM, Tom Rini wrote:
> On Wed, Nov 08, 2017 at 08:49:09AM +0100, Jorge Ramirez wrote:
>> On 11/07/2017 11:50 PM, Tom Rini wrote:
>>> On Mon, Nov 06, 2017 at 02:16:38PM +0100, Jorge Ramirez-Ortiz wrote:
>>>
>>>> Save the environment data at the end of the boot partition on emmc
>>>>
>>>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>>>> ---
>>>>   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.
>> 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?
> 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

>
Jorge Ramirez-Ortiz Nov. 13, 2017, 4:09 p.m. UTC | #5
On 11/06/2017 02:16 PM, Jorge Ramirez-Ortiz wrote:
> 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
Tom Rini Nov. 17, 2017, 3:45 p.m. UTC | #6
On Mon, Nov 06, 2017 at 02:16:38PM +0100, Jorge Ramirez-Ortiz wrote:

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

> 

> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/arch/arm/dts/dragonboard410c-uboot.dtsi b/arch/arm/dts/dragonboard410c-uboot.dtsi
index cc2c175..c3475c4 100644
--- a/arch/arm/dts/dragonboard410c-uboot.dtsi
+++ b/arch/arm/dts/dragonboard410c-uboot.dtsi
@@ -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>;
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index a85aa74..4c04544 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -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
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index 6b5d59d..d2447b2 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -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 */