arch/*/lib/bootm.c is for the boot Linux commands, not just for
bootm command.

This commit makes CONFIG_BOOTM_LINUX selected by the boot Linux
commands and arch/*/lib/bootm.c will be built if enabled
CONFIG_BOOTM_LINUX.

Signed-off-by: Rover Mo <myz...@126.com>
---
 arch/arc/lib/Makefile        | 2 +-
 arch/arm/lib/Makefile        | 6 +++---
 arch/m68k/lib/Makefile       | 2 +-
 arch/microblaze/lib/Makefile | 2 +-
 arch/mips/lib/Makefile       | 2 +-
 arch/nios2/lib/Makefile      | 2 +-
 arch/powerpc/lib/Makefile    | 2 +-
 arch/riscv/lib/Makefile      | 4 ++--
 arch/sandbox/lib/Makefile    | 3 +--
 arch/sh/lib/Makefile         | 2 +-
 arch/x86/lib/Makefile        | 2 +-
 arch/xtensa/lib/Makefile     | 2 +-
 cmd/Kconfig                  | 3 +++
 13 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index 0eb44bcf33..777380b36d 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -12,6 +12,6 @@ obj-y += reset.o
 obj-y += ints_low.o
 obj-y += init_helpers.o
 
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 
 lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _millicodethunk.o libgcc2.o
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index c603fe61bc..c446219b4b 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -30,9 +30,9 @@ endif
 
 obj-$(CONFIG_CPU_V7M) += cmd_boot.o
 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
-obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
-obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
+obj-$(CONFIG_CMD_BOOTI) += image.o
+obj-$(CONFIG_CMD_BOOTZ) += zimage.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 else
 obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index b66d66afd2..7fdedf6ad8 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -8,7 +8,7 @@
 lib-$(CONFIG_USE_PRIVATE_LIBGCC) += lshrdi3.o muldi3.o ashldi3.o
 
 obj-y  += bdinfo.o
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-y  += cache.o
 obj-y  += interrupts.o
 obj-y  += time.o
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index 05f447abba..b523d18a78 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -3,5 +3,5 @@
 # (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-y  += muldi3.o
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 9ee1fcb5c7..0fc66f1c49 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -10,7 +10,7 @@ obj-y += reloc.o
 obj-y  += stack.o
 obj-y  += traps.o
 
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-$(CONFIG_CMD_GO) += boot.o
 obj-$(CONFIG_SPL_BUILD) += spl.o
 
diff --git a/arch/nios2/lib/Makefile b/arch/nios2/lib/Makefile
index a9f3c7100e..fdd671a3b8 100644
--- a/arch/nios2/lib/Makefile
+++ b/arch/nios2/lib/Makefile
@@ -4,5 +4,5 @@
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 
 obj-y  += cache.o
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-y  += libgcc.o
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 2782740bf5..16374e33fb 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -33,7 +33,7 @@ endif
 obj-y  += reloc.o
 
 obj-$(CONFIG_BAT_RW) += bat_rw.o
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-y  += cache.o
 obj-y  += extable.o
 obj-y  += interrupts.o
diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile
index 06020fcc2a..48d6366136 100644
--- a/arch/riscv/lib/Makefile
+++ b/arch/riscv/lib/Makefile
@@ -6,8 +6,8 @@
 # Copyright (C) 2017 Andes Technology Corporation
 # Rick Chen, Andes Technology Corporation <r...@andestech.com>
 
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
-obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
+obj-$(CONFIG_CMD_BOOTI) += image.o
 obj-$(CONFIG_CMD_GO) += boot.o
 obj-y  += cache.o
 obj-$(CONFIG_SIFIVE_CACHE) += sifive_cache.o
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index a2bc5a7ee6..a0eedf0273 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -7,5 +7,4 @@
 
 obj-y  += fdt_fixup.o interrupts.o sections.o
 obj-$(CONFIG_PCI)      += pci_io.o
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
-obj-$(CONFIG_CMD_BOOTZ) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile
index e7520a328d..840edf2942 100644
--- a/arch/sh/lib/Makefile
+++ b/arch/sh/lib/Makefile
@@ -6,7 +6,7 @@
 extra-y        += start.o
 
 obj-y  += board.o
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 obj-y  += time.o
 obj-$(CONFIG_CMD_SH_ZIMAGEBOOT) += zimageboot.o
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index a6f2244147..9f99b78679 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -13,7 +13,7 @@ endif
 obj-y += string.o
 endif
 ifndef CONFIG_SPL_BUILD
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 endif
 obj-y  += cmd_boot.o
 obj-$(CONFIG_$(SPL_)COREBOOT_SYSINFO)  += coreboot/
diff --git a/arch/xtensa/lib/Makefile b/arch/xtensa/lib/Makefile
index ad4fe32cb6..4c54b845e2 100644
--- a/arch/xtensa/lib/Makefile
+++ b/arch/xtensa/lib/Makefile
@@ -3,6 +3,6 @@
 # (C) Copyright 2007 - 2013 Tensilica Inc.
 # (C) Copyright 2014 - 2016 Cadence Design Systems Inc.
 
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTM_LINUX) += bootm.o
 
 obj-y  += cache.o misc.o relocate.o time.o
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 6baa85bfdd..46291b3b07 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -197,6 +197,7 @@ config CMD_BOOTD
 
 config CMD_BOOTM
        bool "bootm"
+       select BOOTM_LINUX
        default y
        help
          Boot an application image from the memory.
@@ -259,6 +260,7 @@ config BOOTM_EFI
 
 config CMD_BOOTZ
        bool "bootz"
+       select BOOTM_LINUX
        default y if !FIT_SIGNATURE && !EFI_SECURE_BOOT
        help
          Boot the Linux zImage
@@ -268,6 +270,7 @@ config CMD_BOOTZ
 
 config CMD_BOOTI
        bool "booti"
+       select BOOTM_LINUX
        depends on ARM64 || RISCV
        default y if !FIT_SIGNATURE && !EFI_SECURE_BOOT
        help
-- 
2.25.1

Reply via email to