Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 1 | From d9e403ce8669d9b0ac4e94a7c64cef91ad51dc80 Mon Sep 17 00:00:00 2001 |
| 2 | From: Adriana Kobylak <anoo@us.ibm.com> |
| 3 | Date: Wed, 9 Aug 2017 14:11:56 -0500 |
| 4 | Subject: [PATCH] config/ast-common: Add bootopts to support ubi and mtd partitioning |
| 5 | |
| 6 | Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> |
| 7 | --- |
Adriana Kobylak | 2c7c8d1 | 2017-08-21 11:00:56 -0500 | [diff] [blame] | 8 | include/configs/ast-common.h | 19 +++++++++++++++++-- |
| 9 | 1 file changed, 17 insertions(+), 2 deletions(-) |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 10 | |
| 11 | diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h |
Adriana Kobylak | 6b7e2de | 2017-08-24 09:33:35 -0500 | [diff] [blame] | 12 | index 8dfaff7..8150265 100644 |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 13 | --- a/include/configs/ast-common.h |
| 14 | +++ b/include/configs/ast-common.h |
Adriana Kobylak | 6b7e2de | 2017-08-24 09:33:35 -0500 | [diff] [blame] | 15 | @@ -85,6 +85,12 @@ |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 16 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 17 | |
Adriana Kobylak | 6b7e2de | 2017-08-24 09:33:35 -0500 | [diff] [blame] | 18 | /* |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 19 | + * 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 Kobylak | 6b7e2de | 2017-08-24 09:33:35 -0500 | [diff] [blame] | 24 | +/* |
| 25 | * Optional MTD and UBI support |
| 26 | */ |
| 27 | #ifdef MTDPARTS_DEFAULT |
| 28 | @@ -99,7 +105,7 @@ |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 29 | #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 Kobylak | 6b7e2de | 2017-08-24 09:33:35 -0500 | [diff] [blame] | 37 | @@ -108,6 +114,7 @@ |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 38 | #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 Kobylak | 6b7e2de | 2017-08-24 09:33:35 -0500 | [diff] [blame] | 45 | @@ -121,12 +128,20 @@ |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 46 | " 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 Kobylak | 48c8fa3 | 2017-08-19 09:32:18 -0500 | [diff] [blame] | 52 | |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 53 | #define ASPEED_ENV_SETTINGS \ |
| 54 | + "ubiblock=0,1 \0" \ |
| 55 | + "root=/dev/ubiblock0_1 \0" \ |
Adriana Kobylak | 2c7c8d1 | 2017-08-21 11:00:56 -0500 | [diff] [blame] | 56 | + "kernelname=kernel-0 \0" \ |
Adriana Kobylak | 48c8fa3 | 2017-08-19 09:32:18 -0500 | [diff] [blame] | 57 | + "loadaddr=" __stringify(CONFIG_LOADADDR) "\0" \ |
| 58 | + "set_bootargs=setenv bootargs " CONFIG_BOOTARGS " ubi.block=\${ubiblock} root=\${root} \0" \ |
Adriana Kobylak | 3749f52 | 2017-08-09 17:17:25 -0500 | [diff] [blame] | 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 | -- |
| 68 | 1.8.2.2 |
| 69 | |