ARM: remove obsolete Makefile.boot infrastructure

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>
This commit is contained in:
Arnd Bergmann 2022-07-27 09:26:45 +02:00
parent 568035b01c
commit 92481c7d14
20 changed files with 43 additions and 99 deletions

View 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

View 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

View File

@ -10,22 +10,16 @@
#
# Copyright (C) 1995-2002 Russell King
#
OBJCOPYFLAGS :=-O binary -R .comment -S
ifneq ($(MACHINE),)
include $(MACHINE)/Makefile.boot
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
ifdef CONFIG_PHYS_OFFSET
add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
ZRELADDR := $(call add_hex, $(CONFIG_PHYS_OFFSET), $(TEXT_OFFSET))
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)
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

View 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)

View File

@ -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 .

View File

@ -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

View File

@ -1,4 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0x00008000
params_phys-y := 0x00000100
initrd_phys-y := 0x00800000

View File

@ -1,2 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
# Empty file waiting for deletion once Makefile.boot isn't needed any more.

View File

@ -1,5 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0x00008000
params_phys-y := 0x00000100
initrd_phys-y := 0x00800000

View File

@ -1,4 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0xa0008000
params_phys-y := 0xa0000100
initrd_phys-y := 0xa0800000

View File

@ -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 .

View File

@ -1,4 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0x80008000
params_phys-y := 0x80000100
initrd_phys-y := 0x82000000

View File

@ -1,4 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0x10008000
params_phys-y := 0x10000100
initrd_phys-y := 0x10800000

View File

@ -1,5 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0x10008000
params_phys-y := 0x10000100
initrd_phys-y := 0x18000000

View File

@ -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

View File

@ -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

View File

@ -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 .

View File

@ -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 .

View File

@ -1,4 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
zreladdr-y += 0x00008000
params_phys-y := 0x00000100
initrd_phys-y := 0x01000000