summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward A. James <eajames@us.ibm.com>2017-08-15 14:18:12 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-08-18 16:16:00 +0000
commitfd6f07c2c85d2882c1384827305ad0a787f3c784 (patch)
treecb0c7f0b772da2d85fd70280ea793b219ecf51dd
parent3aa1ef696fd093d16b8c7472d1ffe0f199dc96e7 (diff)
downloadtalos-openbmc-fd6f07c2c85d2882c1384827305ad0a787f3c784.tar.gz
talos-openbmc-fd6f07c2c85d2882c1384827305ad0a787f3c784.zip
Add u-boot redundant environments
Update fw_env config with two sections. Update init script to handle redundant envs. Patch u-boot. Can be removed when openbmc/u-boot is updated and recipe bumped. Resolves openbmc/openbmc#1937 Change-Id: I15137f55d960381a0b3fbb58c53090bbd5b86482 Signed-off-by: Edward A. James <eajames@us.ibm.com>
-rw-r--r--meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/fw_env.config3
-rw-r--r--meta-openbmc-bsp/meta-aspeed/meta-ast2500/recipes-bsp/u-boot/files/fw_env.config3
-rw-r--r--meta-phosphor/common/recipes-bsp/u-boot/files/0001-configs-ast-Add-redundnant-env.patch33
-rw-r--r--meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc2
-rw-r--r--meta-phosphor/common/recipes-phosphor/initfs/files/obmc-init.sh2
5 files changed, 40 insertions, 3 deletions
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/fw_env.config b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/fw_env.config
index 78c946699..b30372249 100644
--- a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/fw_env.config
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/fw_env.config
@@ -13,7 +13,8 @@
# MTD SPI-dataflash example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd2 0x00000 0x20000
-/dev/mtd/u-boot-env 0x00000 0x20000
+/dev/mtd/u-boot-env 0x00000 0x10000
+/dev/mtd/u-boot-env 0x10000 0x10000
#/dev/mtd5 0x4200 0x4200
#/dev/mtd6 0x4200 0x4200
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2500/recipes-bsp/u-boot/files/fw_env.config b/meta-openbmc-bsp/meta-aspeed/meta-ast2500/recipes-bsp/u-boot/files/fw_env.config
index 78c946699..b30372249 100644
--- a/meta-openbmc-bsp/meta-aspeed/meta-ast2500/recipes-bsp/u-boot/files/fw_env.config
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2500/recipes-bsp/u-boot/files/fw_env.config
@@ -13,7 +13,8 @@
# MTD SPI-dataflash example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd2 0x00000 0x20000
-/dev/mtd/u-boot-env 0x00000 0x20000
+/dev/mtd/u-boot-env 0x00000 0x10000
+/dev/mtd/u-boot-env 0x10000 0x10000
#/dev/mtd5 0x4200 0x4200
#/dev/mtd6 0x4200 0x4200
diff --git a/meta-phosphor/common/recipes-bsp/u-boot/files/0001-configs-ast-Add-redundnant-env.patch b/meta-phosphor/common/recipes-bsp/u-boot/files/0001-configs-ast-Add-redundnant-env.patch
new file mode 100644
index 000000000..35337a3ba
--- /dev/null
+++ b/meta-phosphor/common/recipes-bsp/u-boot/files/0001-configs-ast-Add-redundnant-env.patch
@@ -0,0 +1,33 @@
+From ba7cf47befb92e2565bf6169ccc5b766647de222 Mon Sep 17 00:00:00 2001
+From: "Edward A. James" <eajames@us.ibm.com>
+Date: Thu, 13 Jul 2017 13:42:18 -0500
+Subject: [PATCH u-boot] configs/ast: Add redundnant env
+
+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(-)
+
+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; " \
+--
+1.8.3.1
+
diff --git a/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc b/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc
index 4c5e302a1..492e3f798 100644
--- a/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc
+++ b/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc
@@ -5,3 +5,5 @@ UBRANCH = "v2016.07-aspeed-openbmc"
SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https"
PV = "v2016.07+git${SRCPV}"
+
+SRC_URI += "file://0001-configs-ast-Add-redundnant-env.patch"
diff --git a/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-init.sh
index a402ecb31..afa8ac1e3 100644
--- a/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-init.sh
+++ b/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-init.sh
@@ -55,7 +55,7 @@ get_fw_env_var() {
# count non-blank non-comment lines
# copies=$(grep -v ^# /etc/fw_env.config | grep -c [::alnum::])
# ... we could if we had the fw_env.config in the initramfs
- copies=1
+ copies=2
# * Change \n to \r and \0 to \n
# * Skip to the 5th byte to skip over crc
OpenPOWER on IntegriCloud