diff options
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r-- | arch/powerpc/boot/Makefile | 118 |
1 files changed, 112 insertions, 6 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 4b1d98b8135e..122a27078998 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -33,12 +33,15 @@ ifeq ($(call cc-option-yn, -fstack-protector),y) | |||
33 | BOOTCFLAGS += -fno-stack-protector | 33 | BOOTCFLAGS += -fno-stack-protector |
34 | endif | 34 | endif |
35 | 35 | ||
36 | BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) | 36 | BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt |
37 | 37 | ||
38 | $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440 | 38 | $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440 |
39 | $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 | 39 | $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 |
40 | $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440 | ||
41 | $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440 | ||
40 | $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 | 42 | $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 |
41 | 43 | ||
44 | |||
42 | zlib := inffast.c inflate.c inftrees.c | 45 | zlib := inffast.c inflate.c inftrees.c |
43 | zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h | 46 | zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h |
44 | zliblinuxheader := zlib.h zconf.h zutil.h | 47 | zliblinuxheader := zlib.h zconf.h zutil.h |
@@ -46,17 +49,21 @@ zliblinuxheader := zlib.h zconf.h zutil.h | |||
46 | $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ | 49 | $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ |
47 | $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) | 50 | $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) |
48 | 51 | ||
49 | src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ | 52 | src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c |
53 | src-wlib := string.S crt0.S stdio.c main.c \ | ||
54 | $(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \ | ||
50 | ns16550.c serial.c simple_alloc.c div64.S util.S \ | 55 | ns16550.c serial.c simple_alloc.c div64.S util.S \ |
51 | gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ | 56 | gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ |
52 | 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ | 57 | 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ |
53 | cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ | 58 | cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ |
54 | fsl-soc.c mpc8xx.c pq2.c | 59 | fsl-soc.c mpc8xx.c pq2.c |
55 | src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ | 60 | src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ |
56 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ | 61 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ |
57 | ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ | 62 | ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ |
58 | cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ | 63 | cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ |
59 | fixed-head.S ep88xc.c cuboot-hpc2.c | 64 | fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \ |
65 | cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ | ||
66 | cuboot-warp.c cuboot-85xx-cpm2.c | ||
60 | src-boot := $(src-wlib) $(src-plat) empty.c | 67 | src-boot := $(src-wlib) $(src-plat) empty.c |
61 | 68 | ||
62 | src-boot := $(addprefix $(obj)/, $(src-boot)) | 69 | src-boot := $(addprefix $(obj)/, $(src-boot)) |
@@ -101,24 +108,61 @@ quiet_cmd_bootar = BOOTAR $@ | |||
101 | cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@ | 108 | cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@ |
102 | 109 | ||
103 | $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE | 110 | $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE |
111 | $(Q)mkdir -p $(dir $@) | ||
104 | $(call if_changed_dep,bootcc) | 112 | $(call if_changed_dep,bootcc) |
105 | $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE | 113 | $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE |
114 | $(Q)mkdir -p $(dir $@) | ||
106 | $(call if_changed_dep,bootas) | 115 | $(call if_changed_dep,bootas) |
107 | 116 | ||
108 | $(obj)/wrapper.a: $(obj-wlib) FORCE | 117 | $(obj)/wrapper.a: $(obj-wlib) FORCE |
109 | $(call if_changed,bootar) | 118 | $(call if_changed,bootar) |
110 | 119 | ||
111 | hostprogs-y := addnote addRamDisk hack-coff mktree | 120 | hostprogs-y := addnote addRamDisk hack-coff mktree dtc |
112 | 121 | ||
113 | targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) | 122 | targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) |
114 | extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ | 123 | extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ |
115 | $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds | 124 | $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds |
116 | 125 | ||
117 | wrapper :=$(srctree)/$(src)/wrapper | 126 | wrapper :=$(srctree)/$(src)/wrapper |
118 | wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ | 127 | wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \ |
119 | $(wrapper) FORCE | 128 | $(wrapper) FORCE |
120 | 129 | ||
121 | ############# | 130 | ############# |
131 | # Bits for building dtc | ||
132 | # DTC_GENPARSER := 1 # Uncomment to rebuild flex/bison output | ||
133 | |||
134 | dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o | ||
135 | dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o | ||
136 | dtc-objs := $(addprefix dtc-src/, $(dtc-objs)) | ||
137 | |||
138 | # prerequisites on generated files needs to be explicit | ||
139 | $(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h | ||
140 | $(obj)/dtc-src/dtc-lexer.lex.o: $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h | ||
141 | |||
142 | HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/ | ||
143 | |||
144 | targets += dtc-src/dtc-parser.tab.c | ||
145 | targets += dtc-src/dtc-lexer.lex.c | ||
146 | |||
147 | ifdef DTC_GENPARSER | ||
148 | BISON = bison | ||
149 | FLEX = flex | ||
150 | |||
151 | quiet_cmd_bison = BISON $@ | ||
152 | cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped | ||
153 | quiet_cmd_flex = FLEX $@ | ||
154 | cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped | ||
155 | |||
156 | $(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE | ||
157 | $(call if_changed,bison) | ||
158 | |||
159 | $(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c | ||
160 | |||
161 | $(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE | ||
162 | $(call if_changed,flex) | ||
163 | endif | ||
164 | |||
165 | ############# | ||
122 | # Bits for building various flavours of zImage | 166 | # Bits for building various flavours of zImage |
123 | 167 | ||
124 | ifneq ($(CROSS32_COMPILE),) | 168 | ifneq ($(CROSS32_COMPILE),) |
@@ -150,15 +194,29 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImage | |||
150 | ifneq ($(CONFIG_DEVICE_TREE),"") | 194 | ifneq ($(CONFIG_DEVICE_TREE),"") |
151 | image-$(CONFIG_PPC_8xx) += cuImage.8xx | 195 | image-$(CONFIG_PPC_8xx) += cuImage.8xx |
152 | image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc | 196 | image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc |
197 | image-$(CONFIG_EP405) += zImage.ep405 | ||
153 | image-$(CONFIG_8260) += cuImage.pq2 | 198 | image-$(CONFIG_8260) += cuImage.pq2 |
199 | image-$(CONFIG_EP8248E) += zImage.ep8248e | ||
154 | image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx | 200 | image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx |
201 | image-$(CONFIG_STORCENTER) += cuImage.824x | ||
155 | image-$(CONFIG_PPC_83xx) += cuImage.83xx | 202 | image-$(CONFIG_PPC_83xx) += cuImage.83xx |
156 | image-$(CONFIG_PPC_85xx) += cuImage.85xx | 203 | image-$(CONFIG_PPC_85xx) += cuImage.85xx |
204 | ifeq ($(CONFIG_CPM2),y) | ||
205 | image-$(CONFIG_PPC_85xx) += cuImage.85xx-cpm2 | ||
206 | endif | ||
157 | image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2 | 207 | image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2 |
158 | image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony | 208 | image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony |
159 | image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo | 209 | image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo |
160 | image-$(CONFIG_SEQUOIA) += cuImage.sequoia | 210 | image-$(CONFIG_SEQUOIA) += cuImage.sequoia |
211 | image-$(CONFIG_RAINIER) += cuImage.rainier | ||
161 | image-$(CONFIG_WALNUT) += treeImage.walnut | 212 | image-$(CONFIG_WALNUT) += treeImage.walnut |
213 | image-$(CONFIG_TAISHAN) += cuImage.taishan | ||
214 | image-$(CONFIG_KATMAI) += cuImage.katmai | ||
215 | image-$(CONFIG_WARP) += cuImage.warp | ||
216 | endif | ||
217 | |||
218 | ifneq ($(CONFIG_REDBOOT),"") | ||
219 | image-$(CONFIG_PPC_8xx) += zImage.redboot-8xx | ||
162 | endif | 220 | endif |
163 | 221 | ||
164 | # For 32-bit powermacs, build the COFF and miboot images | 222 | # For 32-bit powermacs, build the COFF and miboot images |
@@ -243,3 +301,51 @@ clean-kernel := vmlinux.strip vmlinux.bin | |||
243 | clean-kernel += $(addsuffix .gz,$(clean-kernel)) | 301 | clean-kernel += $(addsuffix .gz,$(clean-kernel)) |
244 | # If not absolute clean-files are relative to $(obj). | 302 | # If not absolute clean-files are relative to $(obj). |
245 | clean-files += $(addprefix $(objtree)/, $(clean-kernel)) | 303 | clean-files += $(addprefix $(objtree)/, $(clean-kernel)) |
304 | |||
305 | WRAPPER_OBJDIR := /usr/lib/kernel-wrapper | ||
306 | WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts | ||
307 | WRAPPER_BINDIR := /usr/sbin | ||
308 | INSTALL := install | ||
309 | |||
310 | extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) | ||
311 | hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) | ||
312 | wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper | ||
313 | dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts)) | ||
314 | |||
315 | all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed) | ||
316 | |||
317 | quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) | ||
318 | cmd_mkdir = mkdir -p $@ | ||
319 | |||
320 | quiet_cmd_install = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@) | ||
321 | cmd_install = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@ | ||
322 | |||
323 | quiet_cmd_install_dts = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@) | ||
324 | cmd_install_dts = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@ | ||
325 | |||
326 | quiet_cmd_install_exe = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@) | ||
327 | cmd_install_exe = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@ | ||
328 | |||
329 | quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@) | ||
330 | cmd_install_wrapper = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\ | ||
331 | sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \ | ||
332 | -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \ | ||
333 | |||
334 | |||
335 | $(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR): | ||
336 | $(call cmd,mkdir) | ||
337 | |||
338 | $(extra-installed) : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR) | ||
339 | $(call cmd,install) | ||
340 | |||
341 | $(hostprogs-installed) : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR) | ||
342 | $(call cmd,install_exe) | ||
343 | |||
344 | $(dts-installed) : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR) | ||
345 | $(call cmd,install_dts) | ||
346 | |||
347 | $(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR) | ||
348 | $(call cmd,install_wrapper) | ||
349 | |||
350 | $(obj)/bootwrapper_install: $(all-installed) | ||
351 | |||