diff mbox

[U-Boot] arm: am57xx: Keep environment in eMMC

Message ID 20170609141256.27374-1-semen.protsenko@linaro.org
State Accepted
Commit 57ba8d6ddc5cbad29316fc34aa1a764cac6e7b89
Delegated to: Tom Rini
Headers show

Commit Message

Sam Protsenko June 9, 2017, 2:12 p.m. UTC
Use eMMC (instead of SD card) to store U-Boot environment. Use
"reserved" partition for U-Boot environment.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 include/configs/am57xx_evm.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Tom Rini June 9, 2017, 2:17 p.m. UTC | #1
On Fri, Jun 09, 2017 at 05:12:56PM +0300, Sam Protsenko wrote:

> Use eMMC (instead of SD card) to store U-Boot environment. Use
> "reserved" partition for U-Boot environment.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
>  include/configs/am57xx_evm.h | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
> index af19098727..7a42d79647 100644
> --- a/include/configs/am57xx_evm.h
> +++ b/include/configs/am57xx_evm.h
> @@ -13,6 +13,7 @@
>  #define __CONFIG_AM57XX_EVM_H
>  
>  #include <environment/ti/dfu.h>
> +#include <linux/sizes.h>
>  
>  #ifdef CONFIG_SPL_BUILD
>  #define CONFIG_IODELAY_RECALIBRATION
> @@ -20,11 +21,14 @@
>  
>  #define CONFIG_NR_DRAM_BANKS		2
>  
> -#define CONFIG_ENV_SIZE			(64 << 10)
> -#define CONFIG_ENV_IS_IN_FAT
> -#define FAT_ENV_INTERFACE		"mmc"
> -#define FAT_ENV_DEVICE_AND_PART		"0:1"
> -#define FAT_ENV_FILE			"uboot.env"
> +/* MMC ENV related defines */
> +#define CONFIG_ENV_IS_IN_MMC
> +#define CONFIG_SYS_MMC_ENV_DEV		1		/* eMMC */
> +#define CONFIG_SYS_MMC_ENV_PART		0
> +#define CONFIG_ENV_SIZE			SZ_128K
> +#define CONFIG_ENV_OFFSET		0x260000
> +#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
> +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

Why are we doing this?
Sam Protsenko June 9, 2017, 2:24 p.m. UTC | #2
On 9 June 2017 at 17:17, Tom Rini <trini@konsulko.com> wrote:
> On Fri, Jun 09, 2017 at 05:12:56PM +0300, Sam Protsenko wrote:
>
>> Use eMMC (instead of SD card) to store U-Boot environment. Use
>> "reserved" partition for U-Boot environment.
>>
>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>> ---
>>  include/configs/am57xx_evm.h | 14 +++++++++-----
>>  1 file changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
>> index af19098727..7a42d79647 100644
>> --- a/include/configs/am57xx_evm.h
>> +++ b/include/configs/am57xx_evm.h
>> @@ -13,6 +13,7 @@
>>  #define __CONFIG_AM57XX_EVM_H
>>
>>  #include <environment/ti/dfu.h>
>> +#include <linux/sizes.h>
>>
>>  #ifdef CONFIG_SPL_BUILD
>>  #define CONFIG_IODELAY_RECALIBRATION
>> @@ -20,11 +21,14 @@
>>
>>  #define CONFIG_NR_DRAM_BANKS         2
>>
>> -#define CONFIG_ENV_SIZE                      (64 << 10)
>> -#define CONFIG_ENV_IS_IN_FAT
>> -#define FAT_ENV_INTERFACE            "mmc"
>> -#define FAT_ENV_DEVICE_AND_PART              "0:1"
>> -#define FAT_ENV_FILE                 "uboot.env"
>> +/* MMC ENV related defines */
>> +#define CONFIG_ENV_IS_IN_MMC
>> +#define CONFIG_SYS_MMC_ENV_DEV               1               /* eMMC */
>> +#define CONFIG_SYS_MMC_ENV_PART              0
>> +#define CONFIG_ENV_SIZE                      SZ_128K
>> +#define CONFIG_ENV_OFFSET            0x260000
>> +#define CONFIG_ENV_OFFSET_REDUND     (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
>> +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>
> Why are we doing this?
>

This is exactly how it's done for DRA7 EVM board. And since those two
boards are basically the same family, we should stick to one way of
doing things here. And we agreed with Praneeth that this policy is
booting Android from eMMC.

> --
> Tom
Tom Rini June 9, 2017, 2:29 p.m. UTC | #3
On Fri, Jun 09, 2017 at 05:24:16PM +0300, Sam Protsenko wrote:
> On 9 June 2017 at 17:17, Tom Rini <trini@konsulko.com> wrote:
> > On Fri, Jun 09, 2017 at 05:12:56PM +0300, Sam Protsenko wrote:
> >
> >> Use eMMC (instead of SD card) to store U-Boot environment. Use
> >> "reserved" partition for U-Boot environment.
> >>
> >> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> >> ---
> >>  include/configs/am57xx_evm.h | 14 +++++++++-----
> >>  1 file changed, 9 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
> >> index af19098727..7a42d79647 100644
> >> --- a/include/configs/am57xx_evm.h
> >> +++ b/include/configs/am57xx_evm.h
> >> @@ -13,6 +13,7 @@
> >>  #define __CONFIG_AM57XX_EVM_H
> >>
> >>  #include <environment/ti/dfu.h>
> >> +#include <linux/sizes.h>
> >>
> >>  #ifdef CONFIG_SPL_BUILD
> >>  #define CONFIG_IODELAY_RECALIBRATION
> >> @@ -20,11 +21,14 @@
> >>
> >>  #define CONFIG_NR_DRAM_BANKS         2
> >>
> >> -#define CONFIG_ENV_SIZE                      (64 << 10)
> >> -#define CONFIG_ENV_IS_IN_FAT
> >> -#define FAT_ENV_INTERFACE            "mmc"
> >> -#define FAT_ENV_DEVICE_AND_PART              "0:1"
> >> -#define FAT_ENV_FILE                 "uboot.env"
> >> +/* MMC ENV related defines */
> >> +#define CONFIG_ENV_IS_IN_MMC
> >> +#define CONFIG_SYS_MMC_ENV_DEV               1               /* eMMC */
> >> +#define CONFIG_SYS_MMC_ENV_PART              0
> >> +#define CONFIG_ENV_SIZE                      SZ_128K
> >> +#define CONFIG_ENV_OFFSET            0x260000
> >> +#define CONFIG_ENV_OFFSET_REDUND     (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
> >> +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
> >
> > Why are we doing this?
> 
> This is exactly how it's done for DRA7 EVM board. And since those two
> boards are basically the same family, we should stick to one way of
> doing things here. And we agreed with Praneeth that this policy is
> booting Android from eMMC.

Right, but Android isn't the only use-case here.  If Lokesh acks it, I'm
fine with it.  But, to be clear, are there am57xx_evm targets that lack
eMMC?  I don't want to get into the case we used to have on am335x_evm
where we assume NAND for env, and run on many targets without NAND.
Sam Protsenko June 9, 2017, 2:32 p.m. UTC | #4
On 9 June 2017 at 17:29, Tom Rini <trini@konsulko.com> wrote:
> On Fri, Jun 09, 2017 at 05:24:16PM +0300, Sam Protsenko wrote:
>> On 9 June 2017 at 17:17, Tom Rini <trini@konsulko.com> wrote:
>> > On Fri, Jun 09, 2017 at 05:12:56PM +0300, Sam Protsenko wrote:
>> >
>> >> Use eMMC (instead of SD card) to store U-Boot environment. Use
>> >> "reserved" partition for U-Boot environment.
>> >>
>> >> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>> >> ---
>> >>  include/configs/am57xx_evm.h | 14 +++++++++-----
>> >>  1 file changed, 9 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
>> >> index af19098727..7a42d79647 100644
>> >> --- a/include/configs/am57xx_evm.h
>> >> +++ b/include/configs/am57xx_evm.h
>> >> @@ -13,6 +13,7 @@
>> >>  #define __CONFIG_AM57XX_EVM_H
>> >>
>> >>  #include <environment/ti/dfu.h>
>> >> +#include <linux/sizes.h>
>> >>
>> >>  #ifdef CONFIG_SPL_BUILD
>> >>  #define CONFIG_IODELAY_RECALIBRATION
>> >> @@ -20,11 +21,14 @@
>> >>
>> >>  #define CONFIG_NR_DRAM_BANKS         2
>> >>
>> >> -#define CONFIG_ENV_SIZE                      (64 << 10)
>> >> -#define CONFIG_ENV_IS_IN_FAT
>> >> -#define FAT_ENV_INTERFACE            "mmc"
>> >> -#define FAT_ENV_DEVICE_AND_PART              "0:1"
>> >> -#define FAT_ENV_FILE                 "uboot.env"
>> >> +/* MMC ENV related defines */
>> >> +#define CONFIG_ENV_IS_IN_MMC
>> >> +#define CONFIG_SYS_MMC_ENV_DEV               1               /* eMMC */
>> >> +#define CONFIG_SYS_MMC_ENV_PART              0
>> >> +#define CONFIG_ENV_SIZE                      SZ_128K
>> >> +#define CONFIG_ENV_OFFSET            0x260000
>> >> +#define CONFIG_ENV_OFFSET_REDUND     (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
>> >> +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>> >
>> > Why are we doing this?
>>
>> This is exactly how it's done for DRA7 EVM board. And since those two
>> boards are basically the same family, we should stick to one way of
>> doing things here. And we agreed with Praneeth that this policy is
>> booting Android from eMMC.
>
> Right, but Android isn't the only use-case here.  If Lokesh acks it, I'm
> fine with it.  But, to be clear, are there am57xx_evm targets that lack
> eMMC?  I don't want to get into the case we used to have on am335x_evm
> where we assume NAND for env, and run on many targets without NAND.
>

No, I don't think so. All AM57x EVM / X15 boards I've seen up to this
point do have eMMC on board. So there shouldn't be any problems here.

> --
> Tom
Lokesh Vutla June 10, 2017, 9:39 a.m. UTC | #5
On Friday 09 June 2017 07:59 PM, Tom Rini wrote:
> On Fri, Jun 09, 2017 at 05:24:16PM +0300, Sam Protsenko wrote:
>> On 9 June 2017 at 17:17, Tom Rini <trini@konsulko.com> wrote:
>>> On Fri, Jun 09, 2017 at 05:12:56PM +0300, Sam Protsenko wrote:
>>>
>>>> Use eMMC (instead of SD card) to store U-Boot environment. Use
>>>> "reserved" partition for U-Boot environment.
>>>>
>>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>>>> ---
>>>>  include/configs/am57xx_evm.h | 14 +++++++++-----
>>>>  1 file changed, 9 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
>>>> index af19098727..7a42d79647 100644
>>>> --- a/include/configs/am57xx_evm.h
>>>> +++ b/include/configs/am57xx_evm.h
>>>> @@ -13,6 +13,7 @@
>>>>  #define __CONFIG_AM57XX_EVM_H
>>>>
>>>>  #include <environment/ti/dfu.h>
>>>> +#include <linux/sizes.h>
>>>>
>>>>  #ifdef CONFIG_SPL_BUILD
>>>>  #define CONFIG_IODELAY_RECALIBRATION
>>>> @@ -20,11 +21,14 @@
>>>>
>>>>  #define CONFIG_NR_DRAM_BANKS         2
>>>>
>>>> -#define CONFIG_ENV_SIZE                      (64 << 10)
>>>> -#define CONFIG_ENV_IS_IN_FAT
>>>> -#define FAT_ENV_INTERFACE            "mmc"
>>>> -#define FAT_ENV_DEVICE_AND_PART              "0:1"
>>>> -#define FAT_ENV_FILE                 "uboot.env"
>>>> +/* MMC ENV related defines */
>>>> +#define CONFIG_ENV_IS_IN_MMC
>>>> +#define CONFIG_SYS_MMC_ENV_DEV               1               /* eMMC */
>>>> +#define CONFIG_SYS_MMC_ENV_PART              0
>>>> +#define CONFIG_ENV_SIZE                      SZ_128K
>>>> +#define CONFIG_ENV_OFFSET            0x260000
>>>> +#define CONFIG_ENV_OFFSET_REDUND     (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
>>>> +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>>>
>>> Why are we doing this?
>>
>> This is exactly how it's done for DRA7 EVM board. And since those two
>> boards are basically the same family, we should stick to one way of
>> doing things here. And we agreed with Praneeth that this policy is
>> booting Android from eMMC.
> 
> Right, but Android isn't the only use-case here.  If Lokesh acks it, I'm
> fine with it.  But, to be clear, are there am57xx_evm targets that lack
> eMMC?  I don't want to get into the case we used to have on am335x_evm
> where we assume NAND for env, and run on many targets without NAND.
> 

Yeah, I really like to keep env in FAT partition but because of android
usecases we will have to keep it in eMMC(I am still trying to find a
strong reason for not using it in eMMC and stick to FAT ;) ). As of now,
all am57x boards(am572-evm, beagle-x15, am572-idk, am571-idk has eMMC.)

Anyways,
Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com>

Thanks and regards,
Lokesh
Tom Rini June 12, 2017, 10:44 p.m. UTC | #6
On Fri, Jun 09, 2017 at 05:12:56PM +0300, Semen Protsenko wrote:

> Use eMMC (instead of SD card) to store U-Boot environment. Use
> "reserved" partition for U-Boot environment.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index af19098727..7a42d79647 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -13,6 +13,7 @@ 
 #define __CONFIG_AM57XX_EVM_H
 
 #include <environment/ti/dfu.h>
+#include <linux/sizes.h>
 
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_IODELAY_RECALIBRATION
@@ -20,11 +21,14 @@ 
 
 #define CONFIG_NR_DRAM_BANKS		2
 
-#define CONFIG_ENV_SIZE			(64 << 10)
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE		"mmc"
-#define FAT_ENV_DEVICE_AND_PART		"0:1"
-#define FAT_ENV_FILE			"uboot.env"
+/* MMC ENV related defines */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		1		/* eMMC */
+#define CONFIG_SYS_MMC_ENV_PART		0
+#define CONFIG_ENV_SIZE			SZ_128K
+#define CONFIG_ENV_OFFSET		0x260000
+#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 #define CONSOLEDEV			"ttyO2"
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */