mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 14:12:51 +00:00
92481c7d14
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>
61 lines
1.8 KiB
Makefile
61 lines
1.8 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# linux/arch/arm/boot/bootp/Makefile
|
|
#
|
|
# 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
|
|
AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
|
|
|
|
targets := bootp init.o kernel.o initrd.o
|
|
|
|
# Note that bootp.lds picks up kernel.o and initrd.o
|
|
$(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE
|
|
$(call if_changed,ld)
|
|
|
|
# kernel.o and initrd.o includes a binary image using
|
|
# .incbin, a dependency which is not tracked automatically
|
|
|
|
$(obj)/kernel.o: arch/arm/boot/zImage FORCE
|
|
|
|
$(obj)/initrd.o: initrd $(INITRD) FORCE
|
|
|
|
PHONY += $(INITRD)
|