Skip to contentSkip to conversation

cmd: Split 'bootz' and 'booti' out from 'bootm'

PATCH New Tom Rini 1 participant 6 messages Aug 12, 2016 – Aug 21, 2016

Subsystems (4)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

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.

Cc Masahiro Yamada <[email protected]>

---
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
index a8d155762937..caa62c635589 100644
@@ -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
index 7820c55c8554..2e7802feac8a 100644
@@ -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
index a1731be70127..a1ecf73ef314 100644
@@ -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
index e08cd3e74d7d..21619b304d0f 100644
@@ -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
index 9ed6428281b3..a4d22a6ec490 100644
@@ -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
author
#2 lore raw

PATCH v3 2/3 cmd: booti: move CONFIG_CMD_BOOTI to Kconfig

From: 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
index 1119b1971666..0bc06d859f75 100644
@@ -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
index d69b817c827b..e21924639fa5 100644
@@ -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
index 924468045262..b5efab5c3f9c 100644
@@ -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
index 950c5353d253..0f5b20ff48c4 100644
@@ -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
index 46cf83be02e0..9aca3936fb13 100644
@@ -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
index 297cc4d5f3dd..ca60e5d3d9cd 100644
@@ -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
author
#4 lore raw

PATCH v3 3/3 Kconfig: DISTRO_DEFAULTS: Only enable CMD_BOOTZ for ARM

In reply to 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]>

---
Changes in v3:
- New patch

---
 Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kconfig +1 -1
index 0bc06d859f75..423b877a6eaa 100644
@@ -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
author
#1 lore raw

PATCH v3 1/3 cmd: Split 'bootz' and 'booti' out from 'bootm'

In reply to Tom Rini
Quoted 9 lines · Tom Rini

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.

Cc Masahiro Yamada <[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>
author
#3 lore raw

PATCH v3 2/3 cmd: booti: move CONFIG_CMD_BOOTI to Kconfig

In reply to Tom Rini
Quoted 9 lines · Tom Rini

From: 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.

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>
author
#5 lore raw

PATCH v3 3/3 Kconfig: DISTRO_DEFAULTS: Only enable CMD_BOOTZ for ARM

In reply to Tom Rini
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]>

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>