Merge remote-tracking branch 'regulator/topic/tps65910' into regulator-next
[deliverable/linux.git] / arch / mips / boot / compressed / Makefile
1 #
2 # This file is subject to the terms and conditions of the GNU General Public
3 # License.
4 #
5 # Adapted for MIPS Pete Popov, Dan Malek
6 #
7 # Copyright (C) 1994 by Linus Torvalds
8 # Adapted for PowerPC by Gary Thomas
9 # modified by Cort (cort@cs.nmt.edu)
10 #
11 # Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University
12 # Author: Wu Zhangjin <wuzhangjin@gmail.com>
13 #
14
15 # set the default size of the mallocing area for decompressing
16 BOOT_HEAP_SIZE := 0x400000
17
18 # Disable Function Tracer
19 KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//")
20
21 KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS))
22
23 KBUILD_CFLAGS := $(LINUXINCLUDE) $(KBUILD_CFLAGS) -D__KERNEL__ \
24 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull"
25
26 KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
27 -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
28 -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
29
30 targets := head.o decompress.o dbg.o uart-16550.o uart-alchemy.o
31
32 # decompressor objects (linked with vmlinuz)
33 vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/dbg.o
34
35 ifdef CONFIG_DEBUG_ZBOOT
36 vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o
37 vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o
38 endif
39
40 targets += vmlinux.bin
41 OBJCOPYFLAGS_vmlinux.bin := $(OBJCOPYFLAGS) -O binary -R .comment -S
42 $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE
43 $(call if_changed,objcopy)
44
45 tool_$(CONFIG_KERNEL_GZIP) = gzip
46 tool_$(CONFIG_KERNEL_BZIP2) = bzip2
47 tool_$(CONFIG_KERNEL_LZMA) = lzma
48 tool_$(CONFIG_KERNEL_LZO) = lzo
49
50 targets += vmlinux.bin.z
51 $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE
52 $(call if_changed,$(tool_y))
53
54 targets += piggy.o
55 OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
56 --set-section-flags=.image=contents,alloc,load,readonly,data
57 $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
58 $(call if_changed,objcopy)
59
60 # Calculate the load address of the compressed kernel image
61 hostprogs-y := calc_vmlinuz_load_addr
62
63 ifeq ($(CONFIG_MACH_JZ4740),y)
64 VMLINUZ_LOAD_ADDRESS := 0x80600000
65 else
66 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
67 $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
68 endif
69
70 vmlinuzobjs-y += $(obj)/piggy.o
71
72 quiet_cmd_zld = LD $@
73 cmd_zld = $(LD) $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T $< $(vmlinuzobjs-y) -o $@
74 quiet_cmd_strip = STRIP $@
75 cmd_strip = $(STRIP) -s $@
76 vmlinuz: $(src)/ld.script $(vmlinuzobjs-y) $(obj)/calc_vmlinuz_load_addr
77 $(call cmd,zld)
78 $(call cmd,strip)
79
80 #
81 # Some DECstations need all possible sections of an ECOFF executable
82 #
83 ifdef CONFIG_MACH_DECSTATION
84 e2eflag := -a
85 endif
86
87 # elf2ecoff can only handle 32bit image
88 hostprogs-y += ../elf2ecoff
89
90 ifdef CONFIG_32BIT
91 VMLINUZ = vmlinuz
92 else
93 VMLINUZ = vmlinuz.32
94 endif
95
96 quiet_cmd_32 = OBJCOPY $@
97 cmd_32 = $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
98 vmlinuz.32: vmlinuz
99 $(call cmd,32)
100
101 quiet_cmd_ecoff = ECOFF $@
102 cmd_ecoff = $< $(VMLINUZ) $@ $(e2eflag)
103 vmlinuz.ecoff: $(obj)/../elf2ecoff $(VMLINUZ)
104 $(call cmd,ecoff)
105
106 OBJCOPYFLAGS_vmlinuz.bin := $(OBJCOPYFLAGS) -O binary
107 vmlinuz.bin: vmlinuz
108 $(call cmd,objcopy)
109
110 OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec
111 vmlinuz.srec: vmlinuz
112 $(call cmd,objcopy)
113
114 clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec}
This page took 0.035725 seconds and 5 git commands to generate.