aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r--arch/powerpc/boot/Makefile118
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)
33BOOTCFLAGS += -fno-stack-protector 33BOOTCFLAGS += -fno-stack-protector
34endif 34endif
35 35
36BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 36BOOTCFLAGS += -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
42zlib := inffast.c inflate.c inftrees.c 45zlib := inffast.c inflate.c inftrees.c
43zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 46zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
44zliblinuxheader := zlib.h zconf.h zutil.h 47zliblinuxheader := 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
49src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 52src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
53src-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
55src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ 60src-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
60src-boot := $(src-wlib) $(src-plat) empty.c 67src-boot := $(src-wlib) $(src-plat) empty.c
61 68
62src-boot := $(addprefix $(obj)/, $(src-boot)) 69src-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
111hostprogs-y := addnote addRamDisk hack-coff mktree 120hostprogs-y := addnote addRamDisk hack-coff mktree dtc
112 121
113targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) 122targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
114extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ 123extra-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
117wrapper :=$(srctree)/$(src)/wrapper 126wrapper :=$(srctree)/$(src)/wrapper
118wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ 127wrapperbits := $(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
134dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
135dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
136dtc-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
142HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
143
144targets += dtc-src/dtc-parser.tab.c
145targets += dtc-src/dtc-lexer.lex.c
146
147ifdef DTC_GENPARSER
148BISON = bison
149FLEX = flex
150
151quiet_cmd_bison = BISON $@
152 cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
153quiet_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)
163endif
164
165#############
122# Bits for building various flavours of zImage 166# Bits for building various flavours of zImage
123 167
124ifneq ($(CROSS32_COMPILE),) 168ifneq ($(CROSS32_COMPILE),)
@@ -150,15 +194,29 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImage
150ifneq ($(CONFIG_DEVICE_TREE),"") 194ifneq ($(CONFIG_DEVICE_TREE),"")
151image-$(CONFIG_PPC_8xx) += cuImage.8xx 195image-$(CONFIG_PPC_8xx) += cuImage.8xx
152image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc 196image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc
197image-$(CONFIG_EP405) += zImage.ep405
153image-$(CONFIG_8260) += cuImage.pq2 198image-$(CONFIG_8260) += cuImage.pq2
199image-$(CONFIG_EP8248E) += zImage.ep8248e
154image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx 200image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
201image-$(CONFIG_STORCENTER) += cuImage.824x
155image-$(CONFIG_PPC_83xx) += cuImage.83xx 202image-$(CONFIG_PPC_83xx) += cuImage.83xx
156image-$(CONFIG_PPC_85xx) += cuImage.85xx 203image-$(CONFIG_PPC_85xx) += cuImage.85xx
204ifeq ($(CONFIG_CPM2),y)
205image-$(CONFIG_PPC_85xx) += cuImage.85xx-cpm2
206endif
157image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2 207image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2
158image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 208image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
159image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo 209image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
160image-$(CONFIG_SEQUOIA) += cuImage.sequoia 210image-$(CONFIG_SEQUOIA) += cuImage.sequoia
211image-$(CONFIG_RAINIER) += cuImage.rainier
161image-$(CONFIG_WALNUT) += treeImage.walnut 212image-$(CONFIG_WALNUT) += treeImage.walnut
213image-$(CONFIG_TAISHAN) += cuImage.taishan
214image-$(CONFIG_KATMAI) += cuImage.katmai
215image-$(CONFIG_WARP) += cuImage.warp
216endif
217
218ifneq ($(CONFIG_REDBOOT),"")
219image-$(CONFIG_PPC_8xx) += zImage.redboot-8xx
162endif 220endif
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
243clean-kernel += $(addsuffix .gz,$(clean-kernel)) 301clean-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).
245clean-files += $(addprefix $(objtree)/, $(clean-kernel)) 303clean-files += $(addprefix $(objtree)/, $(clean-kernel))
304
305WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
306WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
307WRAPPER_BINDIR := /usr/sbin
308INSTALL := install
309
310extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
311hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
312wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
313dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
314
315all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
316
317quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
318 cmd_mkdir = mkdir -p $@
319
320quiet_cmd_install = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
321 cmd_install = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
322
323quiet_cmd_install_dts = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
324 cmd_install_dts = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
325
326quiet_cmd_install_exe = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
327 cmd_install_exe = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
328
329quiet_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