1From 0c77be343fc4781719dcc0748bc29a26ea83e0a3 Mon Sep 17 00:00:00 2001
2From: Adriana Kobylak <anoo@us.ibm.com>
3Date: Wed, 9 Aug 2017 14:11:56 -0500
4Subject: [PATCH 3/4] config/ast-common: Add bootopts to support ubi and mtd
5 partitioning
6
7Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
8---
9 include/configs/ast-common.h | 19 +++++++++++++++++--
10 1 file changed, 17 insertions(+), 2 deletions(-)
11
12diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
13index 7ddba62298..14191e4ab0 100644
14--- a/include/configs/ast-common.h
15+++ b/include/configs/ast-common.h
16@@ -84,6 +84,12 @@
17 #define CONFIG_SYS_MAXARGS		16
18 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
19
20+/*
21+ * Dynamic MTD Partition support
22+ */
23+#define MTDIDS_DEFAULT		"nor0=bmc"
24+#define MTDPARTS_DEFAULT	"mtdparts=bmc:384k(u-boot),128k(u-boot-env),-(obmc-ubi)"
25+
26 /*
27  * Optional MTD and UBI support
28  */
29@@ -99,7 +105,7 @@
30 #if 0
31 #define CONFIG_BOOTARGS			"console=ttyS4,115200n8 root=/dev/ram rw"
32 #endif
33-#define CONFIG_BOOTARGS                         "console=ttyS4,115200n8 root=/dev/mtdblock4 ro"
34+#define CONFIG_BOOTARGS			"console=ttyS4,115200n8 ubi.mtd=obmc-ubi,0,0,0 ubi.mtd=alt-obmc-ubi,0,0,4 ro rootfstype=squashfs"
35
36 #define CONFIG_AST_SPI_NOR    /* AST SPI NOR Flash */
37 #define CONFIG_FMC_CS			1
38@@ -108,18 +114,27 @@
39 #define CONFIG_ENV_IS_IN_FLASH		1
40 #define CONFIG_ENV_ADDR			(AST_FMC_CS0_BASE + 0x60000)
41 #define CONFIG_ENV_ADDR_REDUND		(AST_FMC_CS0_BASE + 0x70000)
42+#define CONFIG_LOADADDR			80800000
43
44 #define CONFIG_ENV_OFFSET		0x60000	/* environment starts here  */
45 #define CONFIG_ENV_OFFSET_REDUND	0x70000
46 #define CONFIG_ENV_SIZE			0x10000	/* Total Size of Environment Sector */
47 #define CONFIG_ENV_SIZE_REDUND		0x10000
48
49-#define CONFIG_BOOTCOMMAND		"bootm 20080000"
50+#define CONFIG_BOOTCOMMAND		"run set_bootargs; run obmc_bootcmd"
51 #define CONFIG_ENV_OVERWRITE
52
53 #define ASPEED_ENV_SETTINGS \
54+	"ubiblock=0,1 \0" \
55+	"root=/dev/ubiblock0_1 \0" \
56+	"kernelname=kernel-0 \0" \
57+	"loadaddr=" __stringify(CONFIG_LOADADDR) "\0" \
58+	"set_bootargs=setenv bootargs " CONFIG_BOOTARGS " ubi.block=\${ubiblock} root=\${root} \0" \
59+	"obmc_bootcmd=ubi part obmc-ubi; ubi read ${loadaddr} ${kernelname}; bootm ${loadaddr} \0" \
60 	"verify=yes\0"	\
61 	"spi_dma=yes\0" \
62+	"mtdids=" MTDIDS_DEFAULT "\0" \
63+	"mtdparts=" MTDPARTS_DEFAULT "\0" \
64 	""
65
66 #endif	/* __AST_COMMON_CONFIG_H */
67--
682.14.3
69
70