xref: /linux/arch/arm/boot/compressed/Makefile (revision f45b1149911cc4c3ab50e56c8844ad4ec04a4575)
11da177e4SLinus Torvalds#
21da177e4SLinus Torvalds# linux/arch/arm/boot/compressed/Makefile
31da177e4SLinus Torvalds#
41da177e4SLinus Torvalds# create a compressed vmlinuz image from the original vmlinux
51da177e4SLinus Torvalds#
61da177e4SLinus Torvalds
7*f45b1149SSimon HormanOBJS		=
8*f45b1149SSimon Horman
9*f45b1149SSimon Horman# Ensure that mmcif loader code appears early in the image
10*f45b1149SSimon Horman# to minimise that number of bocks that have to be read in
11*f45b1149SSimon Horman# order to load it.
12*f45b1149SSimon Hormanifeq ($(CONFIG_ZBOOT_ROM_MMCIF),y)
13*f45b1149SSimon Hormanifeq ($(CONFIG_ARCH_SH7372),y)
14*f45b1149SSimon HormanOBJS		+= mmcif-sh7372.o
15*f45b1149SSimon Hormanendif
16*f45b1149SSimon Hormanendif
17*f45b1149SSimon Horman
18e69edc79SEric MiaoAFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
191da177e4SLinus TorvaldsHEAD	= head.o
20*f45b1149SSimon HormanOBJS	+= misc.o decompress.o
214486b863SRussell KingFONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c
221da177e4SLinus Torvalds
231da177e4SLinus Torvalds#
241da177e4SLinus Torvalds# Architecture dependencies
251da177e4SLinus Torvalds#
261da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_ACORN),y)
274486b863SRussell KingOBJS		+= ll_char_wr.o font.o
281da177e4SLinus Torvaldsendif
291da177e4SLinus Torvalds
301da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SHARK),y)
311da177e4SLinus TorvaldsOBJS		+= head-shark.o ofw-shark.o
321da177e4SLinus Torvaldsendif
331da177e4SLinus Torvalds
341da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_P720T),y)
351da177e4SLinus Torvalds# Borrow this code from SA1100
361da177e4SLinus TorvaldsOBJS		+= head-sa1100.o
371da177e4SLinus Torvaldsendif
381da177e4SLinus Torvalds
391da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SA1100),y)
401da177e4SLinus TorvaldsOBJS		+= head-sa1100.o
411da177e4SLinus Torvaldsendif
421da177e4SLinus Torvalds
431da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_XSCALE),y)
441da177e4SLinus TorvaldsOBJS		+= head-xscale.o
451da177e4SLinus Torvaldsendif
461da177e4SLinus Torvalds
479c3fca2eSEric Miaoifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
481da177e4SLinus TorvaldsOBJS		+= head-sharpsl.o
491da177e4SLinus Torvaldsendif
501da177e4SLinus Torvalds
5126584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
52f12d0d7cSHyok S. Choiifeq ($(CONFIG_CPU_CP15),y)
531da177e4SLinus TorvaldsOBJS		+= big-endian.o
54f12d0d7cSHyok S. Choielse
55f12d0d7cSHyok S. Choi# The endian should be set by h/w design.
56f12d0d7cSHyok S. Choiendif
571da177e4SLinus Torvaldsendif
581da177e4SLinus Torvalds
599a4af112SKuninori Morimotoifeq ($(CONFIG_ARCH_SHMOBILE),y)
609a4af112SKuninori MorimotoOBJS		+= head-shmobile.o
619a4af112SKuninori Morimotoendif
629a4af112SKuninori Morimoto
631da177e4SLinus Torvalds#
641da177e4SLinus Torvalds# We now have a PIC decompressor implementation.  Decompressors running
651da177e4SLinus Torvalds# from RAM should not define ZTEXTADDR.  Decompressors running directly
661da177e4SLinus Torvalds# from ROM or Flash must define ZTEXTADDR (preferably via the config)
671da177e4SLinus Torvalds# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
681da177e4SLinus Torvaldsifeq ($(CONFIG_ZBOOT_ROM),y)
691da177e4SLinus TorvaldsZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
701da177e4SLinus TorvaldsZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
711da177e4SLinus Torvaldselse
721da177e4SLinus TorvaldsZTEXTADDR	:= 0
731da177e4SLinus TorvaldsZBSSADDR	:= ALIGN(4)
741da177e4SLinus Torvaldsendif
751da177e4SLinus Torvalds
761da177e4SLinus TorvaldsSEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
771da177e4SLinus Torvalds
78e7db7b42SAlbin Tonnerresuffix_$(CONFIG_KERNEL_GZIP) = gzip
79e7db7b42SAlbin Tonnerresuffix_$(CONFIG_KERNEL_LZO)  = lzo
806e8699f7SAlbin Tonnerresuffix_$(CONFIG_KERNEL_LZMA) = lzma
81e7db7b42SAlbin Tonnerre
82e7db7b42SAlbin Tonnerretargets       := vmlinux vmlinux.lds \
83e7db7b42SAlbin Tonnerre		 piggy.$(suffix_y) piggy.$(suffix_y).o \
84e7db7b42SAlbin Tonnerre		 font.o font.c head.o misc.o $(OBJS)
85014c257cSAbhishek Sagar
86f1b957d3SMagnus Damm# Make sure files are removed during clean
87f1b957d3SMagnus Dammextra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
88f1b957d3SMagnus Damm
89606576ceSSteven Rostedtifeq ($(CONFIG_FUNCTION_TRACER),y)
90014c257cSAbhishek SagarORIG_CFLAGS := $(KBUILD_CFLAGS)
91014c257cSAbhishek SagarKBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
92014c257cSAbhishek Sagarendif
93014c257cSAbhishek Sagar
9448da78bcSCatalin MarinasEXTRA_CFLAGS  := -fpic -fno-builtin
9580cec14aSRussell KingEXTRA_AFLAGS  := -Wa,-march=all
961da177e4SLinus Torvalds
979e84ed63SRussell King# Supply ZRELADDR to the decompressor via a linker symbol.
989e84ed63SRussell Kingifneq ($(CONFIG_AUTO_ZRELADDR),y)
999e84ed63SRussell KingLDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
1009e84ed63SRussell Kingendif
10126584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
10226584853SCatalin MarinasLDFLAGS_vmlinux += --be8
10326584853SCatalin Marinasendif
104e7db7b42SAlbin Tonnerre# ?
105e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -p
106e7db7b42SAlbin Tonnerre# Report unresolved symbol references
107e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += --no-undefined
108e7db7b42SAlbin Tonnerre# Delete all temporary local symbols
109e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -X
110e7db7b42SAlbin Tonnerre# Next argument is a linker script
111e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -T
112e7db7b42SAlbin Tonnerre
113e7db7b42SAlbin Tonnerre# For __aeabi_uidivmod
114e7db7b42SAlbin Tonnerrelib1funcs = $(obj)/lib1funcs.o
115e7db7b42SAlbin Tonnerre
116e7db7b42SAlbin Tonnerre$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
117e7db7b42SAlbin Tonnerre	$(call cmd,shipped)
1181da177e4SLinus Torvalds
119e7db7b42SAlbin Tonnerre$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
120e7db7b42SAlbin Tonnerre	 	$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
1211da177e4SLinus Torvalds	$(call if_changed,ld)
1221da177e4SLinus Torvalds	@:
1231da177e4SLinus Torvalds
124e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
125e7db7b42SAlbin Tonnerre	$(call if_changed,$(suffix_y))
1261da177e4SLinus Torvalds
127e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y).o:  $(obj)/piggy.$(suffix_y) FORCE
1281da177e4SLinus Torvalds
1294486b863SRussell KingCFLAGS_font.o := -Dstatic=
1304486b863SRussell King
1314486b863SRussell King$(obj)/font.c: $(FONTC)
1324486b863SRussell King	$(call cmd,shipped)
1331da177e4SLinus Torvalds
134d93c333dSRussell King$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG)
1351da177e4SLinus Torvalds	@sed "$(SEDFLAGS)" < $< > $@
136