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