blob: d026e96200f5cc70ea8adf7673e7bde744703534 [file] [log] [blame]
Adriana Kobylakdd701532017-08-09 17:17:25 -05001From d9e403ce8669d9b0ac4e94a7c64cef91ad51dc80 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] config/ast-common: Add bootopts to support ubi and mtd partitioning
5
6Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
7---
Adriana Kobylak4c2576a2017-08-21 11:00:56 -05008 include/configs/ast-common.h | 19 +++++++++++++++++--
9 1 file changed, 17 insertions(+), 2 deletions(-)
Adriana Kobylakdd701532017-08-09 17:17:25 -050010
11diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050012index 8dfaff7..8150265 100644
Adriana Kobylakdd701532017-08-09 17:17:25 -050013--- a/include/configs/ast-common.h
14+++ b/include/configs/ast-common.h
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050015@@ -85,6 +85,12 @@
Adriana Kobylakdd701532017-08-09 17:17:25 -050016 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
17
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050018 /*
Adriana Kobylakdd701532017-08-09 17:17:25 -050019+ * Dynamic MTD Partition support
20+ */
21+#define MTDIDS_DEFAULT "nor0=bmc"
22+#define MTDPARTS_DEFAULT "mtdparts=bmc:384k(u-boot),128k(u-boot-env),-(obmc-ubi)"
23+
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050024+/*
25 * Optional MTD and UBI support
26 */
27 #ifdef MTDPARTS_DEFAULT
28@@ -99,7 +105,7 @@
Adriana Kobylakdd701532017-08-09 17:17:25 -050029 #if 0
30 #define CONFIG_BOOTARGS "console=ttyS4,115200n8 root=/dev/ram rw"
31 #endif
32-#define CONFIG_BOOTARGS "console=ttyS4,115200n8 root=/dev/mtdblock4 ro"
33+#define CONFIG_BOOTARGS "console=ttyS4,115200n8 ubi.mtd=obmc-ubi,0,0,0 ubi.mtd=alt-obmc-ubi,0,0,4 ro rootfstype=squashfs"
34
35 #define CONFIG_AST_SPI_NOR /* AST SPI NOR Flash */
36 #define CONFIG_FMC_CS 1
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050037@@ -108,6 +114,7 @@
Adriana Kobylakdd701532017-08-09 17:17:25 -050038 #define CONFIG_ENV_IS_IN_FLASH 1
39 #define CONFIG_ENV_ADDR (AST_FMC_CS0_BASE + 0x60000)
40 #define CONFIG_ENV_ADDR_REDUND (AST_FMC_CS0_BASE + 0x70000)
41+#define CONFIG_LOADADDR 80800000
42
43 #define CONFIG_ENV_OFFSET 0x60000 /* environment starts here */
44 #define CONFIG_ENV_OFFSET_REDUND 0x70000
Adriana Kobylak9ac92c42017-08-24 09:33:35 -050045@@ -121,12 +128,20 @@
Adriana Kobylakdd701532017-08-09 17:17:25 -050046 " bootm 20080000; else bootm 20080000 20300000; " \
47 "fi"
48 #endif
49-#define CONFIG_BOOTCOMMAND "fdt addr 20080000; bootm 20080000"
50+#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--
681.8.2.2
69