aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-01-14 21:00:08 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-14 21:00:08 -0500
commit9216ad8cb7849d88b6d8e9f097718de4f25d4121 (patch)
treea147d159f8f02c41280318d4da1facac4985c752 /arch/powerpc/boot
parent7c7dce9209161eb260cdf9e9172f72c3a02379e6 (diff)
powerpc/32: Generate miboot images with ARCH=powerpc
Miboot images are apparently still used on some old 32-bit powermacs, so build them with ARCH=powerpc if we're 32-bit and powermac support is enabled. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/Makefile29
-rw-r--r--arch/powerpc/boot/dummy.c4
2 files changed, 27 insertions, 6 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 788dec4c7ef3..840ae595a617 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -27,6 +27,7 @@ BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \
27BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 27BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
28OBJCOPYFLAGS := contents,alloc,load,readonly,data 28OBJCOPYFLAGS := contents,alloc,load,readonly,data
29OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000 29OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000
30OBJCOPY_MIB_ARGS := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
30 31
31zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c 32zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
32zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h 33zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h
@@ -90,11 +91,11 @@ gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
90hostprogs-y := addnote addRamDisk hack-coff 91hostprogs-y := addnote addRamDisk hack-coff
91 92
92targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \ 93targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \
93 zImage.coff zImage.initrd.coff \ 94 zImage.coff zImage.initrd.coff miboot.image miboot.initrd.image \
94 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ 95 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
95 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ 96 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
96 $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ 97 $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
97 vmlinux.initrd 98 vmlinux.initrd dummy.o
98extra-y := initrd.o 99extra-y := initrd.o
99 100
100quiet_cmd_ramdisk = RAMDISK $@ 101quiet_cmd_ramdisk = RAMDISK $@
@@ -116,6 +117,10 @@ quiet_cmd_addsection = ADDSEC $@
116quiet_cmd_addnote = ADDNOTE $@ 117quiet_cmd_addnote = ADDNOTE $@
117 cmd_addnote = $(obj)/addnote $@ 118 cmd_addnote = $(obj)/addnote $@
118 119
120quiet_cmd_gen-miboot = GEN $@
121 cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_MIB_ARGS) \
122 --add-section=$1=$(word 2, $^) $< $@
123
119quiet_cmd_gencoff = COFF $@ 124quiet_cmd_gencoff = COFF $@
120 cmd_gencoff = $(OBJCOPY) $(OBJCOPY_COFF_ARGS) $@ && \ 125 cmd_gencoff = $(OBJCOPY) $(OBJCOPY_COFF_ARGS) $@ && \
121 $(obj)/hack-coff $@ 126 $(obj)/hack-coff $@
@@ -141,19 +146,25 @@ $(obj)/zImage.initrd.vmode $(obj)/zImage.initrd.coff: obj-boot += $(call obj-sec
141$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds 146$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds
142 $(call cmd,bootld,$(obj-boot),zImage.lds) 147 $(call cmd,bootld,$(obj-boot),zImage.lds)
143 148
144# For 32-bit powermacs, build the COFF images as well as the ELF images. 149# For 32-bit powermacs, build the COFF and miboot images
150# as well as the ELF images.
145coffimage-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.coff 151coffimage-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.coff
146coffrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.initrd.coff 152coffrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.initrd.coff
153mibootimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.image
154mibrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.initrd.image
147 155
148$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) 156$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) \
157 $(mibootimg-y-y)
149 @cp -f $< $@ 158 @cp -f $< $@
150 $(call if_changed,addnote) 159 $(call if_changed,addnote)
151 160
152$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote $(coffrdimg-y-y) 161$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote \
162 $(coffrdimg-y-y) $(mibrdimg-y-y)
153 @cp -f $< $@ 163 @cp -f $< $@
154 $(call if_changed,addnote) 164 $(call if_changed,addnote)
155 165
156$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff 166$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) \
167 $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff
157 $(call cmd,bootld,$(obj-boot),zImage.coff.lds) 168 $(call cmd,bootld,$(obj-boot),zImage.coff.lds)
158 $(call cmd,gencoff) 169 $(call cmd,gencoff)
159 170
@@ -162,6 +173,12 @@ $(obj)/zImage.initrd.coff: $(call obj-sec, $(required) $(initrd)) $(obj-boot) \
162 $(call cmd,bootld,$(obj-boot),zImage.coff.lds) 173 $(call cmd,bootld,$(obj-boot),zImage.coff.lds)
163 $(call cmd,gencoff) 174 $(call cmd,gencoff)
164 175
176$(obj)/miboot.image: $(obj)/dummy.o $(obj)/vmlinux.gz
177 $(call cmd,gen-miboot,image)
178
179$(obj)/miboot.initrd.image: $(obj)/miboot.image $(images)/ramdisk.image.gz
180 $(call cmd,gen-miboot,initrd)
181
165#----------------------------------------------------------- 182#-----------------------------------------------------------
166# build u-boot images 183# build u-boot images
167#----------------------------------------------------------- 184#-----------------------------------------------------------
diff --git a/arch/powerpc/boot/dummy.c b/arch/powerpc/boot/dummy.c
new file mode 100644
index 000000000000..31dbf45bf99c
--- /dev/null
+++ b/arch/powerpc/boot/dummy.c
@@ -0,0 +1,4 @@
1int main(void)
2{
3 return 0;
4}