Commit e7b34565 authored by Paul Mackerras's avatar Paul Mackerras

PPC32: clean up the arch/ppc/boot Makefiles.

This removes Rules.make inclusions, makes make clean work properly,
removes EXTRA_TARGETS where not needed, and fixes a couple of compile
warnings in the boot wrappers where <linux/string.h> wasn't included.
parent d4d20bce
...@@ -1314,6 +1314,17 @@ config BOOT_LOAD ...@@ -1314,6 +1314,17 @@ config BOOT_LOAD
depends on BOOT_LOAD_BOOL depends on BOOT_LOAD_BOOL
default "0x00400000" default "0x00400000"
# If we don't have a custom load, we define one here depending.
config BOOT_LOAD
hex
depends on !BOOT_LOAD_BOOL && (40x || 8xx || 8260)
default "0x00400000"
config BOOT_LOAD
hex
depends on !BOOT_LOAD_BOOL
default "0x00800000"
endmenu endmenu
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
......
...@@ -36,19 +36,13 @@ ifdef CONFIG_MORE_COMPILE_OPTIONS ...@@ -36,19 +36,13 @@ ifdef CONFIG_MORE_COMPILE_OPTIONS
CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
endif endif
ifdef CONFIG_4xx head-y := head.o
HEAD := arch/ppc/kernel/head_4xx.o head-$(CONFIG_PPC_ISERIES) := iSeries_head.o
else head-$(CONFIG_8xx) := head_8xx.o
ifdef CONFIG_8xx head-$(CONFIG_4xx) := head_4xx.o
HEAD := arch/ppc/kernel/head_8xx.o head-$(CONFIG_440) := head_44x.o
else
ifdef CONFIG_PPC_ISERIES HEAD := arch/ppc/kernel/$(head-y)
HEAD := arch/ppc/kernel/iSeries_head.o
else
HEAD := arch/ppc/kernel/head.o
endif
endif
endif
core-y += arch/ppc/kernel/ arch/ppc/platforms/ \ core-y += arch/ppc/kernel/ arch/ppc/platforms/ \
arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/ arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
...@@ -80,7 +74,7 @@ $(BOOT_TARGETS): vmlinux ...@@ -80,7 +74,7 @@ $(BOOT_TARGETS): vmlinux
cp -f arch/ppc/configs/$(@:config=defconfig) .config cp -f arch/ppc/configs/$(@:config=defconfig) .config
archclean: archclean:
$(MAKE) -f scripts/Makefile.clean obj=arch/ppc/boot +$(MAKE) -f scripts/Makefile.clean obj=arch/ppc/boot
archmrproper: archmrproper:
......
...@@ -10,19 +10,17 @@ ...@@ -10,19 +10,17 @@
# modified by Cort (cort@cs.nmt.edu) # modified by Cort (cort@cs.nmt.edu)
# #
CFLAGS += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include CFLAGS += -fno-builtin -D__BOOTER__ -Iarch/$(ARCH)/boot/include
AFLAGS += -D__BOOTER__ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
OBJCOPY_ARGS = -O elf32-powerpc
bootdir-y := simple bootdir-y := simple
bootdir-$(CONFIG_ALL_PPC) := openfirmware prep bootdir-$(CONFIG_ALL_PPC) := openfirmware prep
subdir-y := lib common images
subdir-$(CONFIG_ALL_PPC) += of1275
# for cleaning... # for cleaning
subdir- := images simple openfirmware prep \ subdir- += simple openfirmware prep
lib common of1275
HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep
tools-$(CONFIG_PPLUS) := mkbugboot mkprep tools-$(CONFIG_PPLUS) := mkbugboot mkprep
...@@ -39,15 +37,9 @@ all-tools := addnote mknote hack-coff mkprep mkbugboot mktree ...@@ -39,15 +37,9 @@ all-tools := addnote mknote hack-coff mkprep mkbugboot mktree
host-progs := $(addprefix utils/,$(tools-y)) host-progs := $(addprefix utils/,$(tools-y))
zImage zImage.initrd znetboot znetboot.initrd: $(addprefix $(obj)/,$(bootdir-y)) .PHONY: $(BOOT_TARGETS) $(bootdir-y)
.PHONY: FORCE
$(obj)/simple $(obj)/openfirmware $(obj)/prep: $(obj)/lib $(obj)/common $(obj)/images
$(obj)/openfirmware $(obj)/prep: $(obj)/of1275
$(obj)/lib $(obj)/common $(obj)/of1275 $(obj)/images: FORCE $(BOOT_TARGETS): $(bootdir-y)
+@$(call descend,$@,)
$(obj)/openfirmware $(obj)/prep $(obj)/simple: FORCE $(bootdir-y): $(addprefix $(obj)/,$(subdir-y))
+@$(call descend,$@,$(MAKECMDGOALS)) +$(call descend,$(obj)/$@,$(MAKECMDGOALS))
...@@ -15,5 +15,3 @@ obj-$(CONFIG_ALL_PPC) += mpc10x_memory.o ...@@ -15,5 +15,3 @@ obj-$(CONFIG_ALL_PPC) += mpc10x_memory.o
obj-$(CONFIG_LOPEC) += mpc10x_memory.o obj-$(CONFIG_LOPEC) += mpc10x_memory.o
obj-$(CONFIG_PAL4) += cpc700_memory.o obj-$(CONFIG_PAL4) += cpc700_memory.o
obj-$(CONFIG_SERIAL_8250_CONSOLE) += ns16550.o obj-$(CONFIG_SERIAL_8250_CONSOLE) += ns16550.o
include $(TOPDIR)/Rules.make
...@@ -10,6 +10,5 @@ $(obj)/vmlinux.gz: vmlinux ...@@ -10,6 +10,5 @@ $(obj)/vmlinux.gz: vmlinux
$(OBJCOPY) -O binary $< $(@:.gz=) $(OBJCOPY) -O binary $< $(@:.gz=)
gzip $(GZIP_FLAGS) $(@:.gz=) gzip $(GZIP_FLAGS) $(@:.gz=)
clean: # Files generated that shall be removed upon make clean
rm -f $(obj)/sImage $(obj)/vmapus $(obj)/vmlinux* $(obj)/miboot* clean-files := sImage vmapus vmlinux* miboot* zImage*
rm -f $(obj)/zImage* z$(obj)/vmlinux*
...@@ -5,5 +5,3 @@ ...@@ -5,5 +5,3 @@
L_TARGET := lib.a L_TARGET := lib.a
obj-y := zlib.o div64.o obj-y := zlib.o div64.o
include $(TOPDIR)/Rules.make
...@@ -6,5 +6,3 @@ L_TARGET := lib.a ...@@ -6,5 +6,3 @@ L_TARGET := lib.a
obj-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \ obj-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \
ofstdio.o read.o release.o write.o ofstdio.o read.o release.o write.o
include $(TOPDIR)/Rules.make
...@@ -10,13 +10,10 @@ ...@@ -10,13 +10,10 @@
# Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the # Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
# rules. # rules.
EXTRA_TARGETS := start.o misc.o crt0.o coffcrt0.o coffmain.o chrpmain.o \ clean-files := note coffboot coffboot.initrd
newworldmain.o common.o
boot: zImage boot: zImage
include $(TOPDIR)/Rules.make
boot := arch/ppc/boot boot := arch/ppc/boot
common := $(boot)/common common := $(boot)/common
utils := $(boot)/utils utils := $(boot)/utils
...@@ -38,8 +35,6 @@ LIBS = lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a ...@@ -38,8 +35,6 @@ LIBS = lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
ADDNOTE := $(utils)/addnote ADDNOTE := $(utils)/addnote
MKNOTE := $(utils)/mknote MKNOTE := $(utils)/mknote
SIZE := $(utils)/size
OFFSET := $(utils)/offset
HACKCOFF := $(utils)/hack-coff HACKCOFF := $(utils)/hack-coff
ifdef CONFIG_SMP ifdef CONFIG_SMP
...@@ -109,12 +104,12 @@ $(obj)/coffboot.initrd: $(COFFOBJS) $(obj)/image-initrd.o $(LIBS) ...@@ -109,12 +104,12 @@ $(obj)/coffboot.initrd: $(COFFOBJS) $(obj)/image-initrd.o $(LIBS)
$(LD) -o $@ $(COFF_LD_ARGS) $^ $(LD) -o $@ $(COFF_LD_ARGS) $^
$(OBJCOPY) $@ $@ -R .comment $(OBJCOPY) $@ $@ -R .comment
$(images)/vmlinux.coff: $(obj)/coffboot $(images)/vmlinux.coff: $(obj)/coffboot $(HACKCOFF)
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot $@ $(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot $@
$(HACKCOFF) $@ $(HACKCOFF) $@
ln -sf vmlinux.coff $(images)/zImage.pmac ln -sf vmlinux.coff $(images)/zImage.pmac
$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd $(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd $(HACKCOFF)
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot.initrd $@ $(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot.initrd $@
$(HACKCOFF) $@ $(HACKCOFF) $@
ln -sf vmlinux.initrd.coff $(images)/zImage.initrd.pmac ln -sf vmlinux.initrd.coff $(images)/zImage.initrd.pmac
...@@ -139,11 +134,11 @@ $(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image-initrd.o $(LIBS) ...@@ -139,11 +134,11 @@ $(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image-initrd.o $(LIBS)
$(LD) $(CHRP_LD_ARGS) -o $@ $^ $(LD) $(CHRP_LD_ARGS) -o $@ $^
$(OBJCOPY) $@ $@ -R .comment $(OBJCOPY) $@ $@ -R .comment
$(images)/zImage.chrp-rs6k: $(images)/zImage.chrp $(images)/zImage.chrp-rs6k: $(images)/zImage.chrp $(ADDNOTE)
cp $(images)/zImage.chrp $@ cp $(images)/zImage.chrp $@
$(ADDNOTE) $@ $(ADDNOTE) $@
$(images)/zImage.initrd.chrp-rs6k: $(images)/zImage.initrd.chrp $(images)/zImage.initrd.chrp-rs6k: $(images)/zImage.initrd.chrp $(ADDNOTE)
cp $(images)/zImage.initrd.chrp $@ cp $(images)/zImage.initrd.chrp $@
$(ADDNOTE) $@ $(ADDNOTE) $@
...@@ -152,6 +147,3 @@ zImage: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac \ ...@@ -152,6 +147,3 @@ zImage: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac \
zImage.initrd: $(images)/vmlinux.initrd.coff $(images)/vmlinux.initrd.elf-pmac\ zImage.initrd: $(images)/vmlinux.initrd.coff $(images)/vmlinux.initrd.elf-pmac\
$(images)/zImage.initrd.chrp $(images)/miboot.initrd.image $(images)/zImage.initrd.chrp $(images)/miboot.initrd.image
clean:
rm -f $(obj)/note $(obj)/image.o $(obj)/coffboot $(obj)/coffboot.initrd
...@@ -27,10 +27,6 @@ LIBS = $(common)/lib.a $(bootlib)/lib.a ...@@ -27,10 +27,6 @@ LIBS = $(common)/lib.a $(bootlib)/lib.a
boot-y := head.o misc.o boot-y := head.o misc.o
boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
EXTRA_TARGETS := $(boot-y) ../simple/legacy.o
include $(TOPDIR)/Rules.make
boot := arch/ppc/boot boot := arch/ppc/boot
common := $(boot)/common common := $(boot)/common
utils := $(boot)/utils utils := $(boot)/utils
...@@ -43,8 +39,6 @@ OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o ...@@ -43,8 +39,6 @@ OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o
# Tools # Tools
MKPREP := $(utils)/mkprep MKPREP := $(utils)/mkprep
SIZE := $(utils)/size
OFFSET := $(utils)/offset
# Extra include search dirs # Extra include search dirs
CFLAGS_kbd.o += -Idrivers/char CFLAGS_kbd.o += -Idrivers/char
...@@ -55,8 +49,8 @@ zImage.initrd: $(images)/zImage.initrd.prep ...@@ -55,8 +49,8 @@ zImage.initrd: $(images)/zImage.initrd.prep
$(obj)/dummy.o: $(common)/dummy.c $(obj)/dummy.o: $(common)/dummy.c
$(CC) -c -o $@ $(common)/dummy.c $(CC) -c -o $@ $(common)/dummy.c
$(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script \ $(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \
$(images)/vmlinux.gz $(obj)/dummy.o $(obj)/dummy.o $(MKPREP)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=.image=$(images)/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data \
...@@ -68,7 +62,7 @@ $(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script \ ...@@ -68,7 +62,7 @@ $(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script \
rm -f $(obj)/zImage rm -f $(obj)/zImage
$(images)/zImage.initrd.prep: $(OBJS) $(LIBS) $(boot)/ld.script \ $(images)/zImage.initrd.prep: $(OBJS) $(LIBS) $(boot)/ld.script \
$(images)/vmlinux.gz $(obj)/dummy.o $(images)/vmlinux.gz $(obj)/dummy.o $(MKPREP)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=.ramdisk=$(images)/ramdisk.image.gz \ --add-section=.ramdisk=$(images)/ramdisk.image.gz \
--set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h>
#include <asm/residual.h> #include <asm/residual.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/threads.h> #include <linux/threads.h>
......
...@@ -132,23 +132,9 @@ EXTRA_AFLAGS := -Wa,-m405 ...@@ -132,23 +132,9 @@ EXTRA_AFLAGS := -Wa,-m405
EXTRA := rw4/rw4_init.o rw4/rw4_init_brd.o EXTRA := rw4/rw4_init.o rw4/rw4_init_brd.o
endif endif
# Default linker args. Link at 0x00800000 or 0x00400000 by default, but # Linker args. This specifies where the image will be run at.
# allow it to be overridden.
ifeq ($(CONFIG_BOOT_LOAD_BOOL),y)
LD_ARGS := -T $(boot)/ld.script \
-Ttext $(CONFIG_BOOT_LOAD) -Bstatic
else
LD_ARGS = -T $(boot)/ld.script \ LD_ARGS = -T $(boot)/ld.script \
-Ttext 0x00800000 -Bstatic -Ttext $(CONFIG_BOOT_LOAD) -Bstatic
ifeq ($(CONFIG_8260)$(CONFIG_40x)$(CONFIG_8xx),y)
LD_ARGS := -T $(boot)/ld.script -Ttext 0x00400000 \
-Bstatic
endif
ifeq ($(CONFIG_440),y)
LD_ARGS := -T $(boot)/ld.script -Ttext 0x01000000 \
-Bstatic
endif
endif
OBJCOPY_ARGS := -O elf32-powerpc OBJCOPY_ARGS := -O elf32-powerpc
# head.o and relocate.o must be at the start. # head.o and relocate.o must be at the start.
...@@ -167,7 +153,6 @@ boot-$(CONFIG_8260) += m8260_tty.o ...@@ -167,7 +153,6 @@ boot-$(CONFIG_8260) += m8260_tty.o
boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o
endif endif
EXTRA_TARGETS := $(boot-y)
LIBS := $(common)/lib.a $(bootlib)/lib.a LIBS := $(common)/lib.a $(bootlib)/lib.a
OBJS := $(addprefix $(obj)/,$(boot-y)) OBJS := $(addprefix $(obj)/,$(boot-y))
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/string.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/processor.h> #include <asm/processor.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment