Joel Stanley | c5bb61e | 2018-02-20 16:17:22 +1030 | [diff] [blame] | 1 | From 878651bbaa8a7da203fafccb164ca7b32287b8f9 Mon Sep 17 00:00:00 2001 |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 2 | From: "Edward A. James" <eajames@us.ibm.com> |
| 3 | Date: Thu, 9 Nov 2017 11:39:10 -0600 |
Joel Stanley | c5bb61e | 2018-02-20 16:17:22 +1030 | [diff] [blame] | 4 | Subject: [PATCH 4/4] config/ast-common: Add conditional factory reset command |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 5 | |
Gunnar Mills | 38f2711 | 2018-08-31 12:39:15 -0500 | [diff] [blame] | 6 | Factory reset (removing persistent rwfs) has to occur before we've |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 7 | mounted the rwfs. However, the variable to determine whether or not to |
| 8 | do the reset is stored in the u-boot env. This is tricky to access |
| 9 | before rwfs is mounted except in u-boot. So, check it before every boot. |
| 10 | |
| 11 | Signed-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 | |
| 16 | diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h |
Joel Stanley | c5bb61e | 2018-02-20 16:17:22 +1030 | [diff] [blame] | 17 | index 14191e4ab0..aaa5155e00 100644 |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 18 | --- 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 Kobylak | b705998 | 2018-02-14 16:35:30 -0600 | [diff] [blame] | 24 | +#define CONFIG_RWFS_SIZE 0x600000 |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 25 | + |
Joel Stanley | c5bb61e | 2018-02-20 16:17:22 +1030 | [diff] [blame] | 26 | #define CONFIG_BOOTCOMMAND "run set_bootargs; run obmc_bootcmd" |
| 27 | #define CONFIG_ENV_OVERWRITE |
| 28 | |
| 29 | @@ -130,11 +132,13 @@ |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 30 | "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 Stanley | c5bb61e | 2018-02-20 16:17:22 +1030 | [diff] [blame] | 45 | 2.14.3 |
Edward A. James | a1cb323 | 2017-11-09 16:03:14 -0600 | [diff] [blame] | 46 | |