blob: 2c8dee01951ade4e0002cb6e294374b2591492e9 [file] [log] [blame]
Joel Stanley2fbe1fe2018-02-20 16:17:22 +10301From 0c77be343fc4781719dcc0748bc29a26ea83e0a3 Mon Sep 17 00:00:00 2001
Adriana Kobylakdd701532017-08-09 17:17:25 -05002From: Adriana Kobylak <anoo@us.ibm.com>
3Date: Wed, 9 Aug 2017 14:11:56 -0500
Joel Stanley2fbe1fe2018-02-20 16:17:22 +10304Subject: [PATCH 3/4] config/ast-common: Add bootopts to support ubi and mtd
5 partitioning
Adriana Kobylakdd701532017-08-09 17:17:25 -05006
7Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
8---
Adriana Kobylak4c2576a2017-08-21 11:00:56 -05009 include/configs/ast-common.h | 19 +++++++++++++++++--
10 1 file changed, 17 insertions(+), 2 deletions(-)
Adriana Kobylakdd701532017-08-09 17:17:25 -050011
12diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
Joel Stanley2fbe1fe2018-02-20 16:17:22 +103013index 7ddba62298..14191e4ab0 100644
Adriana Kobylakdd701532017-08-09 17:17:25 -050014--- a/include/configs/ast-common.h
15+++ b/include/configs/ast-common.h
Joel Stanley2fbe1fe2018-02-20 16:17:22 +103016@@ -84,6 +84,12 @@
17 #define CONFIG_SYS_MAXARGS 16
Adriana Kobylakdd701532017-08-09 17:17:25 -050018 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
19
Joel Stanley2fbe1fe2018-02-20 16:17:22 +103020+/*
Adriana Kobylakdd701532017-08-09 17:17:25 -050021+ * 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+
Joel Stanley2fbe1fe2018-02-20 16:17:22 +103026 /*
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050027 * Optional MTD and UBI support
28 */
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050029@@ -99,7 +105,7 @@
Adriana Kobylakdd701532017-08-09 17:17:25 -050030 #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
Joel Stanley2fbe1fe2018-02-20 16:17:22 +103038@@ -108,18 +114,27 @@
Adriana Kobylakdd701532017-08-09 17:17:25 -050039 #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
Joel Stanley2fbe1fe2018-02-20 16:17:22 +103046 #define CONFIG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
47 #define CONFIG_ENV_SIZE_REDUND 0x10000
48
49-#define CONFIG_BOOTCOMMAND "bootm 20080000"
Adriana Kobylakdd701532017-08-09 17:17:25 -050050+#define CONFIG_BOOTCOMMAND "run set_bootargs; run obmc_bootcmd"
51 #define CONFIG_ENV_OVERWRITE
Adriana Kobylak57ef7222017-08-19 09:32:18 -050052
Adriana Kobylakdd701532017-08-09 17:17:25 -050053 #define ASPEED_ENV_SETTINGS \
54+ "ubiblock=0,1 \0" \
55+ "root=/dev/ubiblock0_1 \0" \
Adriana Kobylak4c2576a2017-08-21 11:00:56 -050056+ "kernelname=kernel-0 \0" \
Adriana Kobylak57ef7222017-08-19 09:32:18 -050057+ "loadaddr=" __stringify(CONFIG_LOADADDR) "\0" \
58+ "set_bootargs=setenv bootargs " CONFIG_BOOTARGS " ubi.block=\${ubiblock} root=\${root} \0" \
Adriana Kobylakdd701532017-08-09 17:17:25 -050059+ "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--
Joel Stanley2fbe1fe2018-02-20 16:17:22 +1030682.14.3
Adriana Kobylakdd701532017-08-09 17:17:25 -050069