ARM: remove obsolete Makefile.boot infrastructure
authorArnd Bergmann <arnd@arndb.de>
Wed, 27 Jul 2022 07:26:45 +0000 (09:26 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 18 Aug 2022 14:44:59 +0000 (16:44 +0200)
There are a number of old Makefile.boot files that remain from the
multiplatform conversion, and three that are still in use.

These provide the "ZRELADDR", "PARAMS_PHYS" and "INITRD_PHYS" values
that are platform specific. It turns out that we can generally just
derive this from information that is available elsewhere:

- ZRELADDR is normally detected at runtime with the
  CONFIG_AUTO_ZRELADDR flag, but also needed to be passed to
  for 'make uImage'. In a multiplatform kernel, one always has
  to pass this as the $(LOADADDR) variable, but in the StrongARM
  kernels we can derive it from the sum of $(CONFIG_PHYS_OFFSET)
  and $(TEXT_OFFSET) that are already known.

- PARAMS_PHYS and INITRD_PHYS are only used for bootpImage, which
  in turn is only used for the pre-ATAGS 'param_struct' based boot
  interface on StrongARM based machines with old boot loaders.
  They can both be derived from CONFIG_PHYS_OFFSET and a machine
  specific offset for the initrd, so all of the logic for these
  can be part of arch/arm/boot/bootp/Makefile.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
20 files changed:
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/Makefile
arch/arm/boot/bootp/Makefile
arch/arm/mach-at91/Makefile.boot [deleted file]
arch/arm/mach-davinci/Makefile.boot [deleted file]
arch/arm/mach-dove/Makefile.boot [deleted file]
arch/arm/mach-ep93xx/Makefile.boot [deleted file]
arch/arm/mach-footbridge/Makefile.boot [deleted file]
arch/arm/mach-imx/Makefile.boot [deleted file]
arch/arm/mach-iop32x/Makefile.boot [deleted file]
arch/arm/mach-lpc18xx/Makefile.boot [deleted file]
arch/arm/mach-lpc32xx/Makefile.boot [deleted file]
arch/arm/mach-omap1/Makefile.boot [deleted file]
arch/arm/mach-rpc/Makefile.boot [deleted file]
arch/arm/mach-s3c/Makefile.boot [deleted file]
arch/arm/mach-sa1100/Makefile.boot [deleted file]
arch/arm/mach-stm32/Makefile.boot [deleted file]
arch/arm/mach-versatile/Makefile.boot [deleted file]
arch/arm/mach-vt8500/Makefile.boot [deleted file]

index 87badea..6894b47 100644 (file)
@@ -274,7 +274,7 @@ config NEED_MACH_MEMORY_H
 
 config PHYS_OFFSET
        hex "Physical address of main memory" if MMU
-       depends on !ARM_PATCH_PHYS_VIRT
+       depends on !ARM_PATCH_PHYS_VIRT || !AUTO_ZRELADDR
        default DRAM_BASE if !MMU
        default 0x00000000 if ARCH_FOOTBRIDGE
        default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
index 56f655d..369490d 100644 (file)
@@ -310,7 +310,7 @@ bootpImage uImage: zImage
 zImage: Image
 
 $(BOOT_TARGETS): vmlinux
-       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
+       $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
        @$(kecho) '  Kernel: $(boot)/$@ is ready'
 
 $(INSTALL_TARGETS): KBUILD_IMAGE = $(boot)/$(patsubst %install,%Image,$@)
@@ -324,7 +324,7 @@ ifeq ($(CONFIG_VDSO),y)
 endif
 
 # My testing targets (bypasses dependencies)
-bp:;   $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage
+bp:;   $(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage
 
 
 define archhelp
index 54a09f9..abd6a28 100644 (file)
 #
 # Copyright (C) 1995-2002 Russell King
 #
-
 OBJCOPYFLAGS   :=-O binary -R .comment -S
 
-ifneq ($(MACHINE),)
-include $(MACHINE)/Makefile.boot
-endif
-
-# Note: the following conditions must always be true:
 #   ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
-#   PARAMS_PHYS must be within 4MB of ZRELADDR
-#   INITRD_PHYS must be in RAM
-ZRELADDR    := $(zreladdr-y)
-PARAMS_PHYS := $(params_phys-y)
-INITRD_PHYS := $(initrd_phys-y)
+ifdef CONFIG_PHYS_OFFSET
+add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
+ZRELADDR    := $(call add_hex, $(CONFIG_PHYS_OFFSET), $(TEXT_OFFSET))
+endif
 
-export ZRELADDR INITRD_PHYS PARAMS_PHYS
+PHYS_OFFSET := $(CONFIG_PHYS_OFFSET)
+export ZRELADDR PARAMS_PHYS PHYS_OFFSET
 
 targets := Image zImage xipImage bootpImage uImage
 
@@ -90,17 +84,10 @@ $(obj)/uImage:      $(obj)/zImage FORCE
        @$(check_for_multiple_loadaddr)
        $(call if_changed,uimage)
 
-$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
+$(obj)/bootp/bootp: $(obj)/zImage FORCE
        $(Q)$(MAKE) $(build)=$(obj)/bootp $@
 
 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
        $(call if_changed,objcopy)
 
-PHONY += initrd
-initrd:
-       @test "$(INITRD_PHYS)" != "" || \
-       (echo This machine does not support INITRD; exit -1)
-       @test "$(INITRD)" != "" || \
-       (echo You must specify INITRD; exit -1)
-
 subdir-            := bootp compressed dts
index 981a8d0..a2934e6 100644 (file)
@@ -5,9 +5,40 @@
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies.
 #
-
 GCOV_PROFILE   := n
 
+ifdef PHYS_OFFSET
+add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
+
+# If PHYS_OFFSET is set, INITRD_PHYS and PARAMS_PHYS can be derived,
+# otherwise they must be passed on the command line.
+#
+# Note: the following conditions must always be true:
+#   PARAMS_PHYS must be within 4MB of ZRELADDR
+#   INITRD_PHYS must be in RAM
+
+PARAMS_PHYS := $(call add_hex, $(PHYS_OFFSET), 0x100)
+
+# guess an initrd location if possible
+initrd_offset-$(CONFIG_ARCH_FOOTBRIDGE)        += 0x00800000
+initrd_offset-$(CONFIG_ARCH_SA1100)    += 0x00800000
+initrd_offset-$(CONFIG_ARCH_RPC)       += 0x08000000
+INITRD_OFFSET := $(initrd_offset-y)
+ifdef INITRD_OFFSET
+INITRD_PHYS := $(call add_hex, $(PHYS_OFFSET), $(INITRD_OFFSET))
+endif
+
+endif
+
+PHONY += initrd
+initrd:
+       @test "$(PARAMS_PHYS)" != "" || \
+       (echo bootpImage: You must specify PHYS_OFFSET of PARAMS_PHYS ; exit -1)
+       @test "$(INITRD_PHYS)" != "" || \
+       (echo bootpImage: You must specify INITRD_OFFSET or INITRD_PHYS ; exit -1)
+       @test "$(INITRD)" != "" || \
+       (echo bootpImage: You must specify INITRD; exit -1)
+
 LDFLAGS_bootp  := --no-undefined -X \
                 --defsym initrd_phys=$(INITRD_PHYS) \
                 --defsym params_phys=$(PARAMS_PHYS) -T
@@ -24,6 +55,6 @@ $(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FOR
 
 $(obj)/kernel.o: arch/arm/boot/zImage FORCE
 
-$(obj)/initrd.o: $(INITRD) FORCE
+$(obj)/initrd.o: initrd $(INITRD) FORCE
 
 PHONY += $(INITRD)
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot
deleted file mode 100644 (file)
index 5dde732..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-# Empty file waiting for deletion once Makefile.boot isn't needed any more.
-# Patch waits for application at
-# https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-davinci/Makefile.boot b/arch/arm/mach-davinci/Makefile.boot
deleted file mode 100644 (file)
index d36b251..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-zreladdr-$(CONFIG_ARCH_DAVINCI_DA8XX)          += 0xc0008000
-params_phys-$(CONFIG_ARCH_DAVINCI_DA8XX)       := 0xc0000100
-initrd_phys-$(CONFIG_ARCH_DAVINCI_DA8XX)       := 0xc0800000
-
-zreladdr-$(CONFIG_ARCH_DAVINCI_DMx)            += 0x80008000
-params_phys-$(CONFIG_ARCH_DAVINCI_DMx)         := 0x80000100
-initrd_phys-$(CONFIG_ARCH_DAVINCI_DMx)         := 0x80800000
diff --git a/arch/arm/mach-dove/Makefile.boot b/arch/arm/mach-dove/Makefile.boot
deleted file mode 100644 (file)
index e4dd1d2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y  += 0x00008000
-params_phys-y  := 0x00000100
-initrd_phys-y  := 0x00800000
diff --git a/arch/arm/mach-ep93xx/Makefile.boot b/arch/arm/mach-ep93xx/Makefile.boot
deleted file mode 100644 (file)
index 4c0a039..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-# Empty file waiting for deletion once Makefile.boot isn't needed any more.
diff --git a/arch/arm/mach-footbridge/Makefile.boot b/arch/arm/mach-footbridge/Makefile.boot
deleted file mode 100644 (file)
index e4313e9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y  += 0x00008000
-params_phys-y  := 0x00000100
-initrd_phys-y  := 0x00800000
-
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/arch/arm/mach-iop32x/Makefile.boot b/arch/arm/mach-iop32x/Makefile.boot
deleted file mode 100644 (file)
index 5c3af01..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y  += 0xa0008000
-params_phys-y  := 0xa0000100
-initrd_phys-y  := 0xa0800000
diff --git a/arch/arm/mach-lpc18xx/Makefile.boot b/arch/arm/mach-lpc18xx/Makefile.boot
deleted file mode 100644 (file)
index cec195d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-# Empty file waiting for deletion once Makefile.boot isn't needed any more.
-# Patch waits for application at
-# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-lpc32xx/Makefile.boot b/arch/arm/mach-lpc32xx/Makefile.boot
deleted file mode 100644 (file)
index 37d09dd..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y  += 0x80008000
-params_phys-y  := 0x80000100
-initrd_phys-y  := 0x82000000
diff --git a/arch/arm/mach-omap1/Makefile.boot b/arch/arm/mach-omap1/Makefile.boot
deleted file mode 100644 (file)
index 2c77151..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y          += 0x10008000
-params_phys-y          := 0x10000100
-initrd_phys-y          := 0x10800000
diff --git a/arch/arm/mach-rpc/Makefile.boot b/arch/arm/mach-rpc/Makefile.boot
deleted file mode 100644 (file)
index 0ed8e8f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y  += 0x10008000
-params_phys-y  := 0x10000100
-initrd_phys-y  := 0x18000000
-
diff --git a/arch/arm/mach-s3c/Makefile.boot b/arch/arm/mach-s3c/Makefile.boot
deleted file mode 100644 (file)
index 7f19e22..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-ifeq ($(CONFIG_PM_H1940),y)
-       zreladdr-y      += 0x30108000
-       params_phys-y   := 0x30100100
-else
-       zreladdr-y      += 0x30008000
-       params_phys-y   := 0x30000100
-endif
diff --git a/arch/arm/mach-sa1100/Makefile.boot b/arch/arm/mach-sa1100/Makefile.boot
deleted file mode 100644 (file)
index 9d8246f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-ifeq ($(CONFIG_SA1111),y)
-   zreladdr-y  += 0xc0208000
-else
-   zreladdr-y  += 0xc0008000
-endif
-params_phys-y  := 0xc0000100
-initrd_phys-y  := 0xc0800000
-
diff --git a/arch/arm/mach-stm32/Makefile.boot b/arch/arm/mach-stm32/Makefile.boot
deleted file mode 100644 (file)
index 5dde732..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-# Empty file waiting for deletion once Makefile.boot isn't needed any more.
-# Patch waits for application at
-# https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-versatile/Makefile.boot b/arch/arm/mach-versatile/Makefile.boot
deleted file mode 100644 (file)
index cec195d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-# Empty file waiting for deletion once Makefile.boot isn't needed any more.
-# Patch waits for application at
-# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-vt8500/Makefile.boot b/arch/arm/mach-vt8500/Makefile.boot
deleted file mode 100644 (file)
index 883985f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-   zreladdr-y  += 0x00008000
-params_phys-y  := 0x00000100
-initrd_phys-y  := 0x01000000