blob: 6bf9bb79865b40bc177448abf23fe24005b0e11e [file] [log] [blame]
Joel Stanleyc5bb61e2018-02-20 16:17:22 +10301From 878651bbaa8a7da203fafccb164ca7b32287b8f9 Mon Sep 17 00:00:00 2001
Edward A. Jamesa1cb3232017-11-09 16:03:14 -06002From: "Edward A. James" <eajames@us.ibm.com>
3Date: Thu, 9 Nov 2017 11:39:10 -0600
Joel Stanleyc5bb61e2018-02-20 16:17:22 +10304Subject: [PATCH 4/4] config/ast-common: Add conditional factory reset command
Edward A. Jamesa1cb3232017-11-09 16:03:14 -06005
6Factory reset (removing persistant rwfs) has to occur before we've
7mounted the rwfs. However, the variable to determine whether or not to
8do the reset is stored in the u-boot env. This is tricky to access
9before rwfs is mounted except in u-boot. So, check it before every boot.
10
11Signed-off-by: Edward A. James <eajames@us.ibm.com>
12---
13 include/configs/ast-common.h | 6 +++++-
14 1 file changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
Joel Stanleyc5bb61e2018-02-20 16:17:22 +103017index 14191e4ab0..aaa5155e00 100644
Edward A. Jamesa1cb3232017-11-09 16:03:14 -060018--- a/include/configs/ast-common.h
19+++ b/include/configs/ast-common.h
20@@ -121,6 +121,8 @@
21 #define CONFIG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
22 #define CONFIG_ENV_SIZE_REDUND 0x10000
23
Adriana Kobylakb7059982018-02-14 16:35:30 -060024+#define CONFIG_RWFS_SIZE 0x600000
Edward A. Jamesa1cb3232017-11-09 16:03:14 -060025+
Joel Stanleyc5bb61e2018-02-20 16:17:22 +103026 #define CONFIG_BOOTCOMMAND "run set_bootargs; run obmc_bootcmd"
27 #define CONFIG_ENV_OVERWRITE
28
29@@ -130,11 +132,13 @@
Edward A. Jamesa1cb3232017-11-09 16:03:14 -060030 "kernelname=kernel-0 \0" \
31 "loadaddr=" __stringify(CONFIG_LOADADDR) "\0" \
32 "set_bootargs=setenv bootargs " CONFIG_BOOTARGS " ubi.block=\${ubiblock} root=\${root} \0" \
33- "obmc_bootcmd=ubi part obmc-ubi; ubi read ${loadaddr} ${kernelname}; bootm ${loadaddr} \0" \
34+ "obmc_bootcmd=ubi part obmc-ubi; run do_rwreset; ubi read ${loadaddr} ${kernelname}; bootm ${loadaddr} \0" \
35 "verify=yes\0" \
36 "spi_dma=yes\0" \
37 "mtdids=" MTDIDS_DEFAULT "\0" \
38 "mtdparts=" MTDPARTS_DEFAULT "\0" \
39+ "rwfs_size=" __stringify(CONFIG_RWFS_SIZE) "\0" \
40+ "do_rwreset=if test \"\${rwreset}\" = \"true\"; then ubi remove rwfs; ubi create rwfs \${rwfs_size}; fi \0" \
41 ""
42
43 #endif /* __AST_COMMON_CONFIG_H */
44--
Joel Stanleyc5bb61e2018-02-20 16:17:22 +1030452.14.3
Edward A. Jamesa1cb3232017-11-09 16:03:14 -060046