1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 21da177e4SLinus Torvalds# 31da177e4SLinus Torvalds# linux/arch/arm/boot/bootp/Makefile 41da177e4SLinus Torvalds# 54f193362SPaul Smith# This file is included by the global makefile so that you can add your own 64f193362SPaul Smith# architecture-specific flags and dependencies. 74f193362SPaul Smith# 875c34906SVincent Sanders 9*92481c7dSArnd Bergmannifdef PHYS_OFFSET 10*92481c7dSArnd Bergmannadd_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) ) 11*92481c7dSArnd Bergmann 12*92481c7dSArnd Bergmann# If PHYS_OFFSET is set, INITRD_PHYS and PARAMS_PHYS can be derived, 13*92481c7dSArnd Bergmann# otherwise they must be passed on the command line. 14*92481c7dSArnd Bergmann# 15*92481c7dSArnd Bergmann# Note: the following conditions must always be true: 16*92481c7dSArnd Bergmann# PARAMS_PHYS must be within 4MB of ZRELADDR 17*92481c7dSArnd Bergmann# INITRD_PHYS must be in RAM 18*92481c7dSArnd Bergmann 19*92481c7dSArnd BergmannPARAMS_PHYS := $(call add_hex, $(PHYS_OFFSET), 0x100) 20*92481c7dSArnd Bergmann 21*92481c7dSArnd Bergmann# guess an initrd location if possible 22*92481c7dSArnd Bergmanninitrd_offset-$(CONFIG_ARCH_FOOTBRIDGE) += 0x00800000 23*92481c7dSArnd Bergmanninitrd_offset-$(CONFIG_ARCH_SA1100) += 0x00800000 24*92481c7dSArnd Bergmanninitrd_offset-$(CONFIG_ARCH_RPC) += 0x08000000 25*92481c7dSArnd BergmannINITRD_OFFSET := $(initrd_offset-y) 26*92481c7dSArnd Bergmannifdef INITRD_OFFSET 27*92481c7dSArnd BergmannINITRD_PHYS := $(call add_hex, $(PHYS_OFFSET), $(INITRD_OFFSET)) 28*92481c7dSArnd Bergmannendif 29*92481c7dSArnd Bergmann 30*92481c7dSArnd Bergmannendif 31*92481c7dSArnd Bergmann 32*92481c7dSArnd BergmannPHONY += initrd 33*92481c7dSArnd Bergmanninitrd: 34*92481c7dSArnd Bergmann @test "$(PARAMS_PHYS)" != "" || \ 35*92481c7dSArnd Bergmann (echo bootpImage: You must specify PHYS_OFFSET of PARAMS_PHYS ; exit -1) 36*92481c7dSArnd Bergmann @test "$(INITRD_PHYS)" != "" || \ 37*92481c7dSArnd Bergmann (echo bootpImage: You must specify INITRD_OFFSET or INITRD_PHYS ; exit -1) 38*92481c7dSArnd Bergmann @test "$(INITRD)" != "" || \ 39*92481c7dSArnd Bergmann (echo bootpImage: You must specify INITRD; exit -1) 40*92481c7dSArnd Bergmann 41091bb549SNathan ChancellorLDFLAGS_bootp := --no-undefined -X \ 421da177e4SLinus Torvalds --defsym initrd_phys=$(INITRD_PHYS) \ 431da177e4SLinus Torvalds --defsym params_phys=$(PARAMS_PHYS) -T 441da177e4SLinus TorvaldsAFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\" 451da177e4SLinus Torvalds 461da177e4SLinus Torvaldstargets := bootp init.o kernel.o initrd.o 471da177e4SLinus Torvalds 481da177e4SLinus Torvalds# Note that bootp.lds picks up kernel.o and initrd.o 491da177e4SLinus Torvalds$(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE 501da177e4SLinus Torvalds $(call if_changed,ld) 511da177e4SLinus Torvalds 521da177e4SLinus Torvalds# kernel.o and initrd.o includes a binary image using 531da177e4SLinus Torvalds# .incbin, a dependency which is not tracked automatically 541da177e4SLinus Torvalds 551da177e4SLinus Torvalds$(obj)/kernel.o: arch/arm/boot/zImage FORCE 561da177e4SLinus Torvalds 57*92481c7dSArnd Bergmann$(obj)/initrd.o: initrd $(INITRD) FORCE 581da177e4SLinus Torvalds 591c44b28dSMasahiro YamadaPHONY += $(INITRD) 60