aspeed: Use FIT-provided ramdisk if available
cover aspeed: Use FIT-provided ramdisk if available
Changes the default boot command on Aspeed SoCs to use a ramdisk from the kernel's FIT image, if available, and fallback to loading a separate ramdisk image from a fixed flash location if not. Supporting both allows for an upgrade path while the ramdisk location is changed.
Rick Altherr (2):
aspeed: Use HUSH shell
aspeed: use FIT-provided ramdisk if available
configs/ast_g4_ncsi_defconfig | 1 + configs/ast_g4_phy_defconfig | 1 + configs/ast_g5_ncsi_defconfig | 1 + configs/ast_g5_phy_defconfig | 1 + include/configs/ast-common.h | 6 +++++- 5 files changed, 9 insertions(+), 1 deletion(-)
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog
PATCH 1/2 aspeed: Use HUSH shell
HUSH is the newer command-line interface that provides scripting capabilities. Those are needed for an boot command that can boot either a FIT image that includes a ramdisk or a separate kernel and ramdisk.
---
configs/ast_g4_ncsi_defconfig | 1 + configs/ast_g4_phy_defconfig | 1 + configs/ast_g5_ncsi_defconfig | 1 + configs/ast_g5_phy_defconfig | 1 + 4 files changed, 4 insertions(+)
configs/ast_g4_ncsi_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=y
configs/ast_g4_phy_defconfig +1 -0
@@ -8,6 +8,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=y
configs/ast_g5_ncsi_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=y
configs/ast_g5_phy_defconfig +1 -0
@@ -8,6 +8,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=y
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog
Re: [U-Boot,1/2] aspeed: Use HUSH shell
Hi Rick,
Quoted 3 lines · Rick Altherr
HUSH is the newer command-line interface that provides scripting capabilities. Those are needed for an boot command that can boot either a FIT image that includes a ramdisk or a separate kernel and ramdisk.
For some reason this patch didn't arrive in my mailbox. I found it on patchwork.
I took at look at the code size change with enabling this:
$ size u-boot && ls -la u-boot.bin text data bss dec hex filename 215567 7152 71048 293767 47b87 u-boot -rw-r--r-- 1 joel joel 222536 Dec 8 12:03 u-boot.bin
$ size u-boot && ls -la u-boot.bin text data bss dec hex filename 227643 7448 71448 306539 4ad6b u-boot -rw-r--r-- 1 joel joel 234908 Jan 16 08:30 u-boot.bin
We go up by 5.6%, or 12KB. We're still well within the 384KB partition size, so there is no issue there.
I've merged it into our u-boot tree.
Cheers,
Joel
Quoted 59 lines
Signed-off-by Rick Altherr <[email protected]>---
configs/ast_g4_ncsi_defconfig | 1 + configs/ast_g4_phy_defconfig | 1 + configs/ast_g5_ncsi_defconfig | 1 + configs/ast_g5_phy_defconfig | 1 + 4 files changed, 4 insertions(+)configs/ast_g4_ncsi_defconfig +1
-0@@ -7,6 +7,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=yconfigs/ast_g4_phy_defconfig +1
-0@@ -8,6 +8,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=yconfigs/ast_g5_ncsi_defconfig +1
-0@@ -7,6 +7,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=yconfigs/ast_g5_phy_defconfig +1
-0@@ -8,6 +8,7 @@ CONFIG_CMD_PING=y CONFIG_EFI_LOADER=n CONFIG_FIT=y CONFIG_FIT_VERBOSE=y +CONFIG_HUSH_PARSER=y CONFIG_OF_LIBFDT=y CONFIG_SPI_FLASH=y CONFIG_SYS_NS16550=y
PATCH 2/2 aspeed: use FIT-provided ramdisk if available
In reply to Rick AltherrIf the kernel FIT specifies a ramdisk, use it. Otherwise, expect a ramdisk at 0x20300000.
---
include/configs/ast-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/configs/ast-common.h +5 -1
@@ -96,7 +96,11 @@#define CONFIG_ENV_OFFSET 0x60000/* environment starts here */ #define CONFIG_ENV_SIZE 0x20000/* Total Size of Environment Sector */ -#define CONFIG_BOOTCOMMAND "bootm 20080000 20300000" +#define CONFIG_BOOTCOMMAND \ + "fdt addr 20080000; " \ + "if fdt get value ramdisk_conf /configurations/conf@1 ramdisk; then " \ + " bootm 20080000; else bootm 20080000 20300000; " \ + "fi"#define CONFIG_ENV_OVERWRITE #define ASPEED_ENV_SETTINGS \
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog
Re: [U-Boot,2/2] aspeed: use FIT-provided ramdisk if available
Quoted 14 lines · Rick Altherr
If the kernel FIT specifies a ramdisk, use it. Otherwise, expect a ramdisk at
0x20300000.Signed-off-by Rick Altherr <[email protected]>---
include/configs/ast-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/configs/ast-common.h +0
-0
include/configs/ast-common.h line 103
Quoted 9 lines
include/configs/ast-common.h +5
-1@@ -96,7 +96,11 @@#define CONFIG_ENV_OFFSET 0x60000/* environment starts here */ #define CONFIG_ENV_SIZE 0x20000/* Total Size of Environment Sector */ -#define CONFIG_BOOTCOMMAND "bootm 20080000 20300000" +#define CONFIG_BOOTCOMMAND \ + "fdt addr 20080000; " \ + "if fdt get value ramdisk_conf /configurations/conf@1 ramdisk; then " \ + " bootm 20080000; else bootm 20080000 20300000; " \ + "fi"
This feels a little clunky. Is this the method upstream suggests to solve this problem?
Cheers,
Joel
Re: [U-Boot,2/2] aspeed: use FIT-provided ramdisk if available
I couldn't find any prior examples. I'll ask upstream what they think.
Quoted 35 lines · Joel Stanley
Quoted 14 lines · Rick Altherr
If the kernel FIT specifies a ramdisk, use it. Otherwise, expect a ramdisk at
0x20300000.Signed-off-by Rick Altherr <[email protected]>---
include/configs/ast-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/configs/ast-common.h +0
-0include/configs/ast-common.h line 96
Quoted 1 line
include/configs/ast-common.h +0
-0@@ -96,7 +96,11 @@#define CONFIG_ENV_OFFSET 0x60000/* environment starts here */
include/configs/ast-common.h line 97
Quoted 1 line
include/configs/ast-common.h +0
-0#define CONFIG_ENV_SIZE 0x20000/* Total Size of Environment Sector */
include/configs/ast-common.h
Quoted 5 lines
include/configs/ast-common.h +3
-1-#define CONFIG_BOOTCOMMAND "bootm 20080000 20300000" +#define CONFIG_BOOTCOMMAND \ + "fdt addr 20080000; " \ + "if fdt get value ramdisk_conf /configurations/conf@1 ramdisk;then " \
include/configs/ast-common.h line 103
Quoted 2 lines
include/configs/ast-common.h +2
-0+" bootm 20080000; else bootm 20080000 20300000; " \ +"fi" This feels a little clunky. Is this the method upstream suggests to solve this problem?
Cheers,
Joel
Simon Glass
Reviewed-byRe: [U-Boot,2/2] aspeed: use FIT-provided ramdisk if available
Quoted 35 lines · Rick Altherr
I couldn't find any prior examples. I'll ask upstream what they think.
Quoted 32 lines · Joel Stanley
Quoted 24 lines · Rick Altherr
If the kernel FIT specifies a ramdisk, use it. Otherwise, expect a ramdisk at
0x20300000.Signed-off-by Rick Altherr <[email protected]>---
include/configs/ast-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/configs/ast-common.h +0
-0@@ -96,7 +96,11 @@#define CONFIG_ENV_OFFSET 0x60000/* environment starts here */
#defineCONFIG_ENV_SIZE0x20000/* Total Size of
Environment Sector */include/configs/ast-common.h +3
-1-#define CONFIG_BOOTCOMMAND "bootm 20080000 20300000" +#define CONFIG_BOOTCOMMAND \ + "fdt addr 20080000; " \ + "if fdt get value ramdisk_conf /configurations/conf@1 ramdisk;then " \
include/configs/ast-common.h line 103
Quoted 2 lines
include/configs/ast-common.h +2
-0+" bootm 20080000; else bootm 20080000 20300000; " \ +"fi" This feels a little clunky. Is this the method upstream suggests to solve this problem?
Clunky, but it works. In general people don't mind too much what you put in your own board scripts.
Regards,
Simon