cmd: Split 'bootz' and 'booti' out from 'bootm'
Subsystems (4)
PATCH v3 1/3 cmd: Split 'bootz' and 'booti' out from 'bootm'
The bootz and booti commands rely on common functionality that is found in common/bootm.c and common/bootm_os.c. They do not however rely on the rest of cmd/bootm.c to be implemented so split them into their own files. Have various Makefiles include the required infrastructure for CONFIG_CMD_BOOT[IZ] as well as CONFIG_CMD_BOOTM. Move the declaration of 'images' over to common/bootm.c.
---
Changes in v3:
- Fix a number of problems found when Masahiro pointed out that this patch didn't allow for BOOTZ+!BOOTM to build
--- arch/arm/lib/Makefile | 3 +- arch/sandbox/lib/Makefile | 1 + cmd/Makefile | 2 + cmd/booti.c | 161 +++++++++++++++++++++++++++++ cmd/bootm.c | 250 ---------------------------------------------- cmd/bootz.c | 106 ++++++++++++++++++++ common/Makefile | 2 + common/bootm.c | 2 + 8 files changed, 276 insertions(+), 251 deletions(-) create mode 100644 cmd/booti.c create mode 100644 cmd/bootz.c
arch/arm/lib/Makefile +2 -1
@@ -26,8 +26,9 @@ endif obj-$(CONFIG_CPU_V7M) += cmd_boot.o obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o +obj-$(CONFIG_CMD_BOOTI) += bootm.o obj-$(CONFIG_CMD_BOOTM) += bootm.o -obj-$(CONFIG_CMD_BOOTM) += zimage.o +obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
arch/sandbox/lib/Makefile +1 -0
@@ -12,3 +12,4 @@ ifndef CONFIG_SPL_BUILD obj-$(CONFIG_PCI) += pci_io.o endif obj-$(CONFIG_CMD_BOOTM) += bootm.o +obj-$(CONFIG_CMD_BOOTZ) += bootm.o
cmd/Makefile +2 -0
@@ -26,6 +26,8 @@ obj-$(CONFIG_CMD_BOOTEFI) += bootefi.o obj-$(CONFIG_CMD_BOOTMENU) += bootmenu.o obj-$(CONFIG_CMD_BOOTLDR) += bootldr.o obj-$(CONFIG_CMD_BOOTSTAGE) += bootstage.o +obj-$(CONFIG_CMD_BOOTZ) += bootz.o +obj-$(CONFIG_CMD_BOOTI) += booti.o obj-$(CONFIG_CMD_CACHE) += cache.o obj-$(CONFIG_CMD_CBFS) += cbfs.o obj-$(CONFIG_CMD_CLK) += clk.o
cmd/booti.c new file +161 -0
161 lines not on this page · raw message
cmd/bootm.c +0 -250
268 lines not on this page · raw message
cmd/bootz.c new file +106 -0
106 lines not on this page · raw message
common/Makefile +2 -0
@@ -26,6 +26,8 @@ obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o obj-$(CONFIG_DISPLAY_BOARDINFO_LATE) += board_info.o obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o +obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o +obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o # environment obj-y += env_attr.o
common/bootm.c +2 -0
@@ -41,6 +41,8 @@DECLARE_GLOBAL_DATA_PTR ; +bootm_headers_t images;/* pointers to os/initrd/fdt images */ +static const void *boot_get_kernel (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[],bootm_headers_t *images,ulong *os_data,ulong *os_len);
Signature · 1 line
1.9.1
PATCH v3 1/3 cmd: Split 'bootz' and 'booti' out from 'bootm'
Quoted 9 lines · Tom Rini
The bootz and booti commands rely on common functionality that is found in
common/bootm.candcommon/bootm_os.c. They do not however rely on the rest ofcmd/bootm.cto be implemented so split them into their own files. Have various Makefiles include the required infrastructure for CONFIG_CMD_BOOT[IZ] as well asCONFIG_CMD_BOOTM. Move the declaration of 'images' over tocommon/bootm.c.Cc Masahiro Yamada <[email protected]>Signed-off-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/8ae0d13e/attachment.sig>
PATCH v3 2/3 cmd: booti: move CONFIG_CMD_BOOTI to Kconfig
In reply to Tom RiniFrom: Masahiro Yamada <[email protected]>
This command is used to boot ARM64 Linux.
I made DISTRO_DEFAULTS select this option for ARM64 to respect include/config_distro_defaults.h.
---
Changes in v3:
- None
Changes in v2:
- Move to default y so this isn't in the defconfig files
- Reword help text slightly
--- Kconfig | 1 + cmd/Kconfig | 7 +++++++ include/config_distro_defaults.h | 3 --- include/configs/uniphier.h | 1 - include/configs/vexpress_aemv8a.h | 1 - include/configs/xilinx_zynqmp.h | 1 - 6 files changed, 8 insertions(+), 6 deletions(-)
Kconfig +1 -0
@@ -58,6 +58,7 @@ config DISTRO_DEFAULTS default y if ARCH_SUNXI default n select CMD_BOOTZ + select CMD_BOOTI if ARM64 select CMD_DHCP select CMD_EXT2 select CMD_EXT4
cmd/Kconfig +7 -0
@@ -165,6 +165,13 @@ config CMD_BOOTZ help Boot the Linux zImage +config CMD_BOOTI + bool "booti" + depends on ARM64 + default y + help + Boot an AArch64 Linux Kernel image from memory. + config CMD_BOOTEFI bool "bootefi" depends on EFI_LOADER
include/config_distro_defaults.h +0 -3
@@ -20,9 +20,6 @@#define CONFIG_BOOTP_PXE #define CONFIG_BOOTP_SUBNETMASK -#ifdef CONFIG_ARM64 -#define CONFIG_CMD_BOOTI -#endif #define CONFIG_CMD_PXE #define CONFIG_CMDLINE_EDITING
include/configs/uniphier.h +0 -1
@@ -189,7 +189,6 @@ "__nfsboot=run tftpboot\0"#else #ifdef CONFIG_ARM64 -#define CONFIG_CMD_BOOTI #define CONFIG_BOOTFILE "Image"#define LINUXBOOT_CMD "booti"#define KERNEL_ADDR_R "kernel_addr_r=0x80080000\0"
include/configs/vexpress_aemv8a.h +0 -1
@@ -133,7 +133,6 @@/* Command line configuration */ #define CONFIG_MENU /*#define CONFIG_MENU_SHOW*/ -#define CONFIG_CMD_BOOTI #define CONFIG_CMD_UNZIP #define CONFIG_CMD_PXE #define CONFIG_CMD_ENV
include/configs/xilinx_zynqmp.h +0 -1
@@ -205,7 +205,6 @@#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) -#define CONFIG_CMD_BOOTI #define CONFIG_CMD_UNZIP #define CONFIG_BOARD_EARLY_INIT_R
Signature · 1 line
1.9.1
PATCH v3 2/3 cmd: booti: move CONFIG_CMD_BOOTI to Kconfig
Quoted 9 lines · Tom Rini
From: Masahiro Yamada <[email protected]>
This command is used to boot ARM64 Linux.
I made
DISTRO_DEFAULTSselect this option for ARM64 to respectinclude/config_distro_defaults.h.Signed-off-by Masahiro Yamada <[email protected]>Signed-off-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/a11302da/attachment.sig>
PATCH v3 3/3 Kconfig: DISTRO_DEFAULTS: Only enable CMD_BOOTZ for ARM
In reply to Tom RiniThe 'bootz' command is really only for ARM32 Linux Kernel 'zImage' files but has also been adapted for testing with sandbox. Given that sandbox is a test platform, don't add that logic under DISTRO_DEFAULTS.
---
Changes in v3:
- New patch
--- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Kconfig +1 -1
@@ -57,7 +57,7 @@ config DISTRO_DEFAULTS bool "Select defaults suitable for booting general purpose Linux distributions" default y if ARCH_SUNXI default n - select CMD_BOOTZ + select CMD_BOOTZ if ARM && !ARM64 select CMD_BOOTI if ARM64 select CMD_DHCP select CMD_EXT2
Signature · 1 line
1.9.1
PATCH v3 3/3 Kconfig: DISTRO_DEFAULTS: Only enable CMD_BOOTZ for ARM
Quoted 6 lines · Tom Rini
The 'bootz' command is really only for ARM32 Linux Kernel 'zImage' files but has also been adapted for testing with sandbox. Given that sandbox is a test platform, don't add that logic under
DISTRO_DEFAULTS.Cc Hans de Goede <[email protected]>Signed-off-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/cd1b001b/attachment.sig>