aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/Makefile
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2008-02-06 13:18:34 -0500
committerPaul Mackerras <paulus@samba.org>2008-02-06 19:40:19 -0500
commit25431333813686654907ab987fb5de10c10a16db (patch)
treec641d4c3ffbf28ebd19b02f1103b9bbfb65a61fe /arch/powerpc/boot/Makefile
parent1daa6d08d1257aa61f376c3cc4795660877fb9e3 (diff)
[POWERPC] bootwrapper: Build multiple cuImages
Currently, the kernel uses CONFIG_DEVICE_TREE to wrap a kernel image with a fdt blob which means for any given configuration only one dts file can be selected and so support for only one board can be built This moves the selection of the default .dts file out of the kernel config and into the bootwrapper makefile. The makefile chooses which images to build based on the kernel config and the dts source file name is taken directly from the image name. For example "cuImage.ebony" will use "ebony.dts" as the device tree source file. In addition, this patch allows a specific image to be requested from the command line by adding "cuImage.%" and "treeImage.%" targets to the list of valid built targets in arch/powerpc/Makefile. This allows the default dts selection to be overridden. Another advantage to this change is it allows a single defconfig to be supplied for all boards using the same chip family and only differing in the device tree. Important note: This patch adds two new zImage targets; zImage.dtb.% and zImage.dtb.initrd.% for zImages with embedded dtb files. Currently there are 5 platforms which require this: ps3, ep405, mpc885ads, ep88xc, adder875-redboot and ep8248e. This patch *changes the zImage filenames* for those platforms. ie. 'zImage.ps3' is now 'zImage.dtb.ps3'. This new zImage.dtb targets were added so that the .dts file could be part of the dependancies list for building them. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r--arch/powerpc/boot/Makefile126
1 files changed, 77 insertions, 49 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 122a27078998..49797a45416c 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -60,8 +60,9 @@ src-wlib := string.S crt0.S stdio.c main.c \
60src-plat := of.c cuboot-52xx.c cuboot-824x.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 \
61 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 61 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
62 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 \
63 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ 63 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \
64 fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \ 64 cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \
65 fixed-head.S ep88xc.c ep405.c \
65 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ 66 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
66 cuboot-warp.c cuboot-85xx-cpm2.c 67 cuboot-warp.c cuboot-85xx-cpm2.c
67src-boot := $(src-wlib) $(src-plat) empty.c 68src-boot := $(src-wlib) $(src-plat) empty.c
@@ -123,6 +124,8 @@ targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
123extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ 124extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
124 $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds 125 $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
125 126
127dtstree := $(srctree)/$(src)/dts
128
126wrapper :=$(srctree)/$(src)/wrapper 129wrapper :=$(srctree)/$(src)/wrapper
127wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \ 130wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
128 $(wrapper) FORCE 131 $(wrapper) FORCE
@@ -181,7 +184,7 @@ quiet_cmd_wrap = WRAP $@
181image-$(CONFIG_PPC_PSERIES) += zImage.pseries 184image-$(CONFIG_PPC_PSERIES) += zImage.pseries
182image-$(CONFIG_PPC_MAPLE) += zImage.pseries 185image-$(CONFIG_PPC_MAPLE) += zImage.pseries
183image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries 186image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries
184image-$(CONFIG_PPC_PS3) += zImage.ps3 187image-$(CONFIG_PPC_PS3) += zImage-dtb.ps3
185image-$(CONFIG_PPC_CELLEB) += zImage.pseries 188image-$(CONFIG_PPC_CELLEB) += zImage.pseries
186image-$(CONFIG_PPC_CHRP) += zImage.chrp 189image-$(CONFIG_PPC_CHRP) += zImage.chrp
187image-$(CONFIG_PPC_EFIKA) += zImage.chrp 190image-$(CONFIG_PPC_EFIKA) += zImage.chrp
@@ -191,33 +194,69 @@ image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800
191image-$(CONFIG_PPC_ISERIES) += zImage.iseries 194image-$(CONFIG_PPC_ISERIES) += zImage.iseries
192image-$(CONFIG_DEFAULT_UIMAGE) += uImage 195image-$(CONFIG_DEFAULT_UIMAGE) += uImage
193 196
194ifneq ($(CONFIG_DEVICE_TREE),"") 197#
195image-$(CONFIG_PPC_8xx) += cuImage.8xx 198# Targets which embed a device tree blob
196image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc 199#
197image-$(CONFIG_EP405) += zImage.ep405 200# Theses are default targets to build images which embed device tree blobs.
198image-$(CONFIG_8260) += cuImage.pq2 201# They are only required on boards which do not have FDT support in firmware.
199image-$(CONFIG_EP8248E) += zImage.ep8248e 202# Boards with newish u-boot firmare can use the uImage target above
200image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx 203#
201image-$(CONFIG_STORCENTER) += cuImage.824x 204
202image-$(CONFIG_PPC_83xx) += cuImage.83xx 205# Board ports in arch/powerpc/platform/40x/Kconfig
203image-$(CONFIG_PPC_85xx) += cuImage.85xx 206image-$(CONFIG_EP405) += zImage-dtb.ep405
204ifeq ($(CONFIG_CPM2),y) 207image-$(CONFIG_WALNUT) += treeImage.walnut
205image-$(CONFIG_PPC_85xx) += cuImage.85xx-cpm2 208
206endif 209# Board ports in arch/powerpc/platform/44x/Kconfig
207image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2
208image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 210image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
209image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo 211image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
210image-$(CONFIG_SEQUOIA) += cuImage.sequoia 212image-$(CONFIG_SEQUOIA) += cuImage.sequoia
211image-$(CONFIG_RAINIER) += cuImage.rainier 213image-$(CONFIG_RAINIER) += cuImage.rainier
212image-$(CONFIG_WALNUT) += treeImage.walnut
213image-$(CONFIG_TAISHAN) += cuImage.taishan 214image-$(CONFIG_TAISHAN) += cuImage.taishan
214image-$(CONFIG_KATMAI) += cuImage.katmai 215image-$(CONFIG_KATMAI) += cuImage.katmai
215image-$(CONFIG_WARP) += cuImage.warp 216image-$(CONFIG_WARP) += cuImage.warp
216endif
217 217
218ifneq ($(CONFIG_REDBOOT),"") 218# Board ports in arch/powerpc/platform/8xx/Kconfig
219image-$(CONFIG_PPC_8xx) += zImage.redboot-8xx 219image-$(CONFIG_PPC_MPC86XADS) += cuImage.mpc866ads
220endif 220image-$(CONFIG_PPC_MPC885ADS) += cuImage.mpc885ads
221image-$(CONFIG_PPC_EP88XC) += zImage-dtb.ep88xc
222image-$(CONFIG_PPC_ADDER875) += cuImage.adder875-uboot \
223 zImage-dtb.adder875-redboot
224
225# Board ports in arch/powerpc/platform/52xx/Kconfig
226image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200 cuImage.lite5200b
227
228# Board ports in arch/powerpc/platform/82xx/Kconfig
229image-$(CONFIG_MPC8272_ADS) += cuImage.mpc8272ads
230image-$(CONFIG_PQ2FADS) += cuImage.pq2fads
231image-$(CONFIG_EP8248E) += zImage-dtb.ep8248e
232
233# Board ports in arch/powerpc/platform/83xx/Kconfig
234image-$(CONFIG_MPC832x_MDS) += cuImage.mpc832x_mds
235image-$(CONFIG_MPC832x_RDB) += cuImage.mpc832x_rdb
236image-$(CONFIG_MPC834x_ITX) += cuImage.mpc8349emitx \
237 cuImage.mpc8349emitxgp
238image-$(CONFIG_MPC834x_MDS) += cuImage.mpc834x_mds
239image-$(CONFIG_MPC836x_MDS) += cuImage.mpc836x_mds
240
241# Board ports in arch/powerpc/platform/85xx/Kconfig
242image-$(CONFIG_MPC8540_ADS) += cuImage.mpc8540ads
243image-$(CONFIG_MPC8560_ADS) += cuImage.mpc8560ads
244image-$(CONFIG_MPC85xx_CDS) += cuImage.mpc8541cds \
245 cuImage.mpc8548cds \
246 cuImage.mpc8555cds
247image-$(CONFIG_MPC85xx_MDS) += cuImage.mpc8568mds
248image-$(CONFIG_MPC85xx_DS) += cuImage.mpc8544ds \
249 cuImage.mpc8572ds
250image-$(CONFIG_TQM8540) += cuImage.tqm8540
251image-$(CONFIG_TQM8541) += cuImage.tqm8541
252image-$(CONFIG_TQM8555) += cuImage.tqm8555
253image-$(CONFIG_TQM8560) += cuImage.tqm8560
254image-$(CONFIG_SBC8548) += cuImage.tqm8548
255image-$(CONFIG_SBC8560) += cuImage.tqm8560
256
257# Board ports in arch/powerpc/platform/embedded6xx/Kconfig
258image-$(CONFIG_STORCENTER) += cuImage.storcenter
259image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2
221 260
222# For 32-bit powermacs, build the COFF and miboot images 261# For 32-bit powermacs, build the COFF and miboot images
223# as well as the ELF images. 262# as well as the ELF images.
@@ -233,24 +272,20 @@ targets += $(image-y) $(initrd-y)
233 272
234$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz 273$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
235 274
236# If CONFIG_WANT_DEVICE_TREE is set and CONFIG_DEVICE_TREE isn't an
237# empty string, define 'dts' to be path to the dts
238# CONFIG_DEVICE_TREE will have "" around it, make sure to strip them
239ifeq ($(CONFIG_WANT_DEVICE_TREE),y)
240ifneq ($(CONFIG_DEVICE_TREE),"")
241dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\
242 ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE:"%"=%)
243endif
244endif
245
246# Don't put the ramdisk on the pattern rule; when its missing make will try 275# Don't put the ramdisk on the pattern rule; when its missing make will try
247# the pattern rule with less dependencies that also matches (even with the 276# the pattern rule with less dependencies that also matches (even with the
248# hard dependency listed). 277# hard dependency listed).
249$(obj)/zImage.initrd.%: vmlinux $(wrapperbits) $(dts) 278$(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
250 $(call if_changed,wrap,$*,$(dts),,$(obj)/ramdisk.image.gz) 279 $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
251 280
252$(obj)/zImage.%: vmlinux $(wrapperbits) $(dts) 281$(obj)/zImage.%: vmlinux $(wrapperbits)
253 $(call if_changed,wrap,$*,$(dts)) 282 $(call if_changed,wrap,$*)
283
284$(obj)/zImage-dtb.initrd.%: vmlinux $(wrapperbits) $(dtstree)/%.dts
285 $(call if_changed,wrap,$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz)
286
287$(obj)/zImage-dtb.%: vmlinux $(wrapperbits) $(dtstree)/%.dts
288 $(call if_changed,wrap,$*,$(dtstree)/$*.dts)
254 289
255# This cannot be in the root of $(src) as the zImage rule always adds a $(obj) 290# This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
256# prefix 291# prefix
@@ -260,24 +295,17 @@ $(obj)/vmlinux.strip: vmlinux
260$(obj)/zImage.iseries: vmlinux 295$(obj)/zImage.iseries: vmlinux
261 $(STRIP) -s -R .comment $< -o $@ 296 $(STRIP) -s -R .comment $< -o $@
262 297
263$(obj)/zImage.ps3: vmlinux $(wrapper) $(wrapperbits) $(srctree)/$(src)/dts/ps3.dts
264 $(STRIP) -s -R .comment $< -o vmlinux.strip
265 $(call cmd,wrap,ps3,$(srctree)/$(src)/dts/ps3.dts,,)
266
267$(obj)/zImage.initrd.ps3: vmlinux $(wrapper) $(wrapperbits) $(srctree)/$(src)/dts/ps3.dts $(obj)/ramdisk.image.gz
268 $(call cmd,wrap,ps3,$(srctree)/$(src)/dts/ps3.dts,,$(obj)/ramdisk.image.gz)
269
270$(obj)/uImage: vmlinux $(wrapperbits) 298$(obj)/uImage: vmlinux $(wrapperbits)
271 $(call if_changed,wrap,uboot) 299 $(call if_changed,wrap,uboot)
272 300
273$(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits) 301$(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits)
274 $(call if_changed,wrap,cuboot-$*,$(dts)) 302 $(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts)
275 303
276$(obj)/treeImage.initrd.%: vmlinux $(dts) $(wrapperbits) 304$(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits)
277 $(call if_changed,wrap,treeboot-$*,$(dts),,$(obj)/ramdisk.image.gz) 305 $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz)
278 306
279$(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits) 307$(obj)/treeImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits)
280 $(call if_changed,wrap,treeboot-$*,$(dts)) 308 $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts)
281 309
282# If there isn't a platform selected then just strip the vmlinux. 310# If there isn't a platform selected then just strip the vmlinux.
283ifeq (,$(image-y)) 311ifeq (,$(image-y))