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 SandersGCOV_PROFILE := n 975c34906SVincent Sanders 10*92481c7dSArnd Bergmannifdef PHYS_OFFSET 11*92481c7dSArnd Bergmannadd_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) ) 12*92481c7dSArnd Bergmann 13*92481c7dSArnd Bergmann# If PHYS_OFFSET is set, INITRD_PHYS and PARAMS_PHYS can be derived, 14*92481c7dSArnd Bergmann# otherwise they must be passed on the command line. 15*92481c7dSArnd Bergmann# 16*92481c7dSArnd Bergmann# Note: the following conditions must always be true: 17*92481c7dSArnd Bergmann# PARAMS_PHYS must be within 4MB of ZRELADDR 18*92481c7dSArnd Bergmann# INITRD_PHYS must be in RAM 19*92481c7dSArnd Bergmann 20*92481c7dSArnd BergmannPARAMS_PHYS := $(call add_hex, $(PHYS_OFFSET), 0x100) 21*92481c7dSArnd Bergmann 22*92481c7dSArnd Bergmann# guess an initrd location if possible 23*92481c7dSArnd Bergmanninitrd_offset-$(CONFIG_ARCH_FOOTBRIDGE) += 0x00800000 24*92481c7dSArnd Bergmanninitrd_offset-$(CONFIG_ARCH_SA1100) += 0x00800000 25*92481c7dSArnd Bergmanninitrd_offset-$(CONFIG_ARCH_RPC) += 0x08000000 26*92481c7dSArnd BergmannINITRD_OFFSET := $(initrd_offset-y) 27*92481c7dSArnd Bergmannifdef INITRD_OFFSET 28*92481c7dSArnd BergmannINITRD_PHYS := $(call add_hex, $(PHYS_OFFSET), $(INITRD_OFFSET)) 29*92481c7dSArnd Bergmannendif 30*92481c7dSArnd Bergmann 31*92481c7dSArnd Bergmannendif 32*92481c7dSArnd Bergmann 33*92481c7dSArnd BergmannPHONY += initrd 34*92481c7dSArnd Bergmanninitrd: 35*92481c7dSArnd Bergmann @test "$(PARAMS_PHYS)" != "" || \ 36*92481c7dSArnd Bergmann (echo bootpImage: You must specify PHYS_OFFSET of PARAMS_PHYS ; exit -1) 37*92481c7dSArnd Bergmann @test "$(INITRD_PHYS)" != "" || \ 38*92481c7dSArnd Bergmann (echo bootpImage: You must specify INITRD_OFFSET or INITRD_PHYS ; exit -1) 39*92481c7dSArnd Bergmann @test "$(INITRD)" != "" || \ 40*92481c7dSArnd Bergmann (echo bootpImage: You must specify INITRD; exit -1) 41*92481c7dSArnd Bergmann 42091bb549SNathan ChancellorLDFLAGS_bootp := --no-undefined -X \ 431da177e4SLinus Torvalds --defsym initrd_phys=$(INITRD_PHYS) \ 441da177e4SLinus Torvalds --defsym params_phys=$(PARAMS_PHYS) -T 451da177e4SLinus TorvaldsAFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\" 461da177e4SLinus Torvalds 471da177e4SLinus Torvaldstargets := bootp init.o kernel.o initrd.o 481da177e4SLinus Torvalds 491da177e4SLinus Torvalds# Note that bootp.lds picks up kernel.o and initrd.o 501da177e4SLinus Torvalds$(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE 511da177e4SLinus Torvalds $(call if_changed,ld) 521da177e4SLinus Torvalds 531da177e4SLinus Torvalds# kernel.o and initrd.o includes a binary image using 541da177e4SLinus Torvalds# .incbin, a dependency which is not tracked automatically 551da177e4SLinus Torvalds 561da177e4SLinus Torvalds$(obj)/kernel.o: arch/arm/boot/zImage FORCE 571da177e4SLinus Torvalds 58*92481c7dSArnd Bergmann$(obj)/initrd.o: initrd $(INITRD) FORCE 591da177e4SLinus Torvalds 601c44b28dSMasahiro YamadaPHONY += $(INITRD) 61