diff options
author | Paul Mackerras <paulus@samba.org> | 2006-01-13 23:04:06 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-13 23:04:06 -0500 |
commit | 66a45dd3620ee5f913ba1af3d2dca8b9bdfa2b96 (patch) | |
tree | f98b25a1004d6e6bc84244186db61e76d5b2fe1c /arch/powerpc/boot/Makefile | |
parent | 36874579dbf4cafa31486d4207c6807efbbf1378 (diff) |
powerpc: Make COFF zImages for old 32-bit powermacs
This adds code to build zImage.coff and/or zImage.initrd.coff when
CONFIG_PPC32 and CONFIG_PPC_PMAC are defined. It also restructures
the OF client code and adds some workarounds for OF quirks on the
older machines.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r-- | arch/powerpc/boot/Makefile | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index b53d677f6742..788dec4c7ef3 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -25,8 +25,8 @@ HOSTCC := gcc | |||
25 | BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ | 25 | BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ |
26 | $(shell $(CROSS32CC) -print-file-name=include) -fPIC | 26 | $(shell $(CROSS32CC) -print-file-name=include) -fPIC |
27 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc | 27 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc |
28 | BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds | ||
29 | OBJCOPYFLAGS := contents,alloc,load,readonly,data | 28 | OBJCOPYFLAGS := contents,alloc,load,readonly,data |
29 | OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000 | ||
30 | 30 | ||
31 | zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c | 31 | zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c |
32 | zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h | 32 | zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h |
@@ -35,7 +35,7 @@ zliblinuxheader := zlib.h zconf.h zutil.h | |||
35 | $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) | 35 | $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) |
36 | #$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h) | 36 | #$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h) |
37 | 37 | ||
38 | src-boot := string.S prom.c main.c div64.S crt0.S | 38 | src-boot := crt0.S string.S prom.c stdio.c main.c div64.S |
39 | src-boot += $(zlib) | 39 | src-boot += $(zlib) |
40 | src-boot := $(addprefix $(obj)/, $(src-boot)) | 40 | src-boot := $(addprefix $(obj)/, $(src-boot)) |
41 | obj-boot := $(addsuffix .o, $(basename $(src-boot))) | 41 | obj-boot := $(addsuffix .o, $(basename $(src-boot))) |
@@ -70,7 +70,7 @@ quiet_cmd_bootas = BOOTAS $@ | |||
70 | cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< | 70 | cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< |
71 | 71 | ||
72 | quiet_cmd_bootld = BOOTLD $@ | 72 | quiet_cmd_bootld = BOOTLD $@ |
73 | cmd_bootld = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(2) | 73 | cmd_bootld = $(CROSS32LD) -T $(srctree)/$(src)/$(3) -o $@ $(2) |
74 | 74 | ||
75 | $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c | 75 | $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c |
76 | $(call if_changed_dep,bootcc) | 76 | $(call if_changed_dep,bootcc) |
@@ -87,12 +87,14 @@ obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section))) | |||
87 | src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) | 87 | src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) |
88 | gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) | 88 | gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) |
89 | 89 | ||
90 | hostprogs-y := addnote addRamDisk | 90 | hostprogs-y := addnote addRamDisk hack-coff |
91 | targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \ | 91 | |
92 | $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ | 92 | targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \ |
93 | $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ | 93 | zImage.coff zImage.initrd.coff \ |
94 | $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ | 94 | $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ |
95 | vmlinux.initrd | 95 | $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ |
96 | $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ | ||
97 | vmlinux.initrd | ||
96 | extra-y := initrd.o | 98 | extra-y := initrd.o |
97 | 99 | ||
98 | quiet_cmd_ramdisk = RAMDISK $@ | 100 | quiet_cmd_ramdisk = RAMDISK $@ |
@@ -114,6 +116,10 @@ quiet_cmd_addsection = ADDSEC $@ | |||
114 | quiet_cmd_addnote = ADDNOTE $@ | 116 | quiet_cmd_addnote = ADDNOTE $@ |
115 | cmd_addnote = $(obj)/addnote $@ | 117 | cmd_addnote = $(obj)/addnote $@ |
116 | 118 | ||
119 | quiet_cmd_gencoff = COFF $@ | ||
120 | cmd_gencoff = $(OBJCOPY) $(OBJCOPY_COFF_ARGS) $@ && \ | ||
121 | $(obj)/hack-coff $@ | ||
122 | |||
117 | $(call gz-sec, $(required)): $(obj)/kernel-%.gz: % | 123 | $(call gz-sec, $(required)): $(obj)/kernel-%.gz: % |
118 | $(call if_changed,gzip) | 124 | $(call if_changed,gzip) |
119 | 125 | ||
@@ -127,22 +133,35 @@ $(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c | |||
127 | $(call if_changed_dep,bootcc) | 133 | $(call if_changed_dep,bootcc) |
128 | $(call cmd,addsection) | 134 | $(call cmd,addsection) |
129 | 135 | ||
130 | $(obj)/zImage.vmode: obj-boot += $(call obj-sec, $(required)) | 136 | $(obj)/zImage.vmode $(obj)/zImage.coff: obj-boot += $(call obj-sec, $(required)) |
131 | $(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.lds | 137 | $(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.lds |
132 | $(call cmd,bootld,$(obj-boot)) | 138 | $(call cmd,bootld,$(obj-boot),zImage.lds) |
133 | 139 | ||
134 | $(obj)/zImage.initrd.vmode: obj-boot += $(call obj-sec, $(required) $(initrd)) | 140 | $(obj)/zImage.initrd.vmode $(obj)/zImage.initrd.coff: obj-boot += $(call obj-sec, $(required) $(initrd)) |
135 | $(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds | 141 | $(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds |
136 | $(call cmd,bootld,$(obj-boot)) | 142 | $(call cmd,bootld,$(obj-boot),zImage.lds) |
143 | |||
144 | # For 32-bit powermacs, build the COFF images as well as the ELF images. | ||
145 | coffimage-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.coff | ||
146 | coffrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.initrd.coff | ||
137 | 147 | ||
138 | $(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote | 148 | $(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) |
139 | @cp -f $< $@ | 149 | @cp -f $< $@ |
140 | $(call if_changed,addnote) | 150 | $(call if_changed,addnote) |
141 | 151 | ||
142 | $(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote | 152 | $(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote $(coffrdimg-y-y) |
143 | @cp -f $< $@ | 153 | @cp -f $< $@ |
144 | $(call if_changed,addnote) | 154 | $(call if_changed,addnote) |
145 | 155 | ||
156 | $(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff | ||
157 | $(call cmd,bootld,$(obj-boot),zImage.coff.lds) | ||
158 | $(call cmd,gencoff) | ||
159 | |||
160 | $(obj)/zImage.initrd.coff: $(call obj-sec, $(required) $(initrd)) $(obj-boot) \ | ||
161 | $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff | ||
162 | $(call cmd,bootld,$(obj-boot),zImage.coff.lds) | ||
163 | $(call cmd,gencoff) | ||
164 | |||
146 | #----------------------------------------------------------- | 165 | #----------------------------------------------------------- |
147 | # build u-boot images | 166 | # build u-boot images |
148 | #----------------------------------------------------------- | 167 | #----------------------------------------------------------- |