[u-boot] configs/ast: Add redundnant env
diff mbox

Message ID 1500053800-3923-1-git-send-email-eajames@linux.vnet.ibm.com
State Deferred
Headers show

Commit Message

Eddie James July 14, 2017, 5:36 p.m. UTC
From: "Edward A. James" <eajames@us.ibm.com>

Configure ast chips to run redundant u-boot environments.

Signed-off-by: Edward A. James <eajames@us.ibm.com>
---
 include/configs/ast-common.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Eddie James July 18, 2017, 6:06 p.m. UTC | #1
On 07/14/2017 12:36 PM, Eddie James wrote:
> From: "Edward A. James" <eajames@us.ibm.com>
>
> Configure ast chips to run redundant u-boot environments.

This will need some userspace changes to work properly. The BMC will 
still boot if this is merged by itself, but there might be trouble 
updating environment variables without a serial connection (of 
particular concern would be the MAC address...). fw_setenv may update 
the flash without the correct "valid" byte that exists for redundant 
environments, and so u-boot will probably consider the updated flash 
invalid and switch to the other copy every time you reboot.

Thanks,
Eddie

>
> Signed-off-by: Edward A. James <eajames@us.ibm.com>
> ---
>   include/configs/ast-common.h | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
> index 110c780..15e1db4 100644
> --- a/include/configs/ast-common.h
> +++ b/include/configs/ast-common.h
> @@ -92,9 +92,12 @@
>   #define CONFIG_SYS_MAX_FLASH_SECT	(8192)		/* max number of sectors on one chip */
>   #define CONFIG_ENV_IS_IN_FLASH		1
>   #define CONFIG_ENV_ADDR			(AST_FMC_CS0_BASE + 0x60000)
> +#define CONFIG_ENV_ADDR_REDUND		(AST_FMC_CS0_BASE + 0x70000)
>
>   #define CONFIG_ENV_OFFSET		0x60000	/* environment starts here  */
> -#define CONFIG_ENV_SIZE			0x20000	/* Total Size of Environment Sector */
> +#define CONFIG_ENV_OFFSET_REDUND	0x70000
> +#define CONFIG_ENV_SIZE			0x10000	/* Total Size of Environment Sector */
> +#define CONFIG_ENV_SIZE_REDUND		0x10000
>
>   #define CONFIG_BOOTCOMMAND	\
>   	"fdt addr 20080000; " \
Joel Stanley July 19, 2017, 9:12 a.m. UTC | #2
On Wed, Jul 19, 2017 at 3:36 AM, Eddie James <eajames@linux.vnet.ibm.com> wrote:
>
>
> On 07/14/2017 12:36 PM, Eddie James wrote:
>>
>> From: "Edward A. James" <eajames@us.ibm.com>
>>
>> Configure ast chips to run redundant u-boot environments.
>
>
> This will need some userspace changes to work properly. The BMC will still
> boot if this is merged by itself, but there might be trouble updating
> environment variables without a serial connection (of particular concern
> would be the MAC address...). fw_setenv may update the flash without the
> correct "valid" byte that exists for redundant environments, and so u-boot
> will probably consider the updated flash invalid and switch to the other
> copy every time you reboot.

Thanks. I will hold off until the userspace change is ready to go.

Cheers,

Joel

Patch
diff mbox

diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
index 110c780..15e1db4 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -92,9 +92,12 @@ 
 #define CONFIG_SYS_MAX_FLASH_SECT	(8192)		/* max number of sectors on one chip */
 #define CONFIG_ENV_IS_IN_FLASH		1
 #define CONFIG_ENV_ADDR			(AST_FMC_CS0_BASE + 0x60000)
+#define CONFIG_ENV_ADDR_REDUND		(AST_FMC_CS0_BASE + 0x70000)
 
 #define CONFIG_ENV_OFFSET		0x60000	/* environment starts here  */
-#define CONFIG_ENV_SIZE			0x20000	/* Total Size of Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND	0x70000
+#define CONFIG_ENV_SIZE			0x10000	/* Total Size of Environment Sector */
+#define CONFIG_ENV_SIZE_REDUND		0x10000
 
 #define CONFIG_BOOTCOMMAND	\
 	"fdt addr 20080000; " \