aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/Makefile
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-03-04 22:24:52 -0500
committerPaul Mackerras <paulus@samba.org>2007-03-12 22:35:03 -0400
commitcd197ffcf10bcc1a260efe5c09a3188fd9228c83 (patch)
tree280d1c3026b263fbdb95961ae77efb79739e8daf /arch/powerpc/boot/Makefile
parent79c8541924a220964f9f2cbed31eaa9fdb042eab (diff)
[POWERPC] zImage: Cleanup and improve zImage entry point
This patch re-organises the way the zImage wrapper code is entered, to allow more flexibility on platforms with unusual entry conditions. After this patch, a platform .o file has two options: 1) It can define a _zimage_start, in which case the platform code gets control from the very beginning of execution. In this case the platform code is responsible for relocating the zImage if necessary, clearing the BSS, performing any platform specific initialization, and finally calling start() to load and enter the kernel. 2) It can define platform_init(). In this case the generic crt0.S handles initial entry, and calls platform_init() before calling start(). The signature of platform_init() is changed, however, to take up to 5 parameters (in r3..r7) as they come from the platform's initial loader, instead of a fixed set of parameters based on OF's usage. When using the generic crt0.S, the platform .o can optionally supply a custom stack to use, using the BSS_STACK() macro. If this is not supplied, the crt0.S will assume that the loader has supplied a usable stack. In either case, the platform code communicates information to the generic code (specifically, a PROM pointer for OF systems, and/or an initrd image address supplied by the bootloader) via a global structure "loader_info". In addition the wrapper script is rearranged to ensure that the platform .o is always linked first. This means that platforms where the zImage entry point is at a fixed address or offset, rather than being encoded in the binary header can be supported using option (1). Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r--arch/powerpc/boot/Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 3628d8681844..b1fc029e5ea7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -40,11 +40,11 @@ zliblinuxheader := zlib.h zconf.h zutil.h
40$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \ 40$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \
41 $(addprefix $(obj)/,$(zlibheader)) 41 $(addprefix $(obj)/,$(zlibheader))
42 42
43src-wlib := string.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 43src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
44 ns16550.c serial.c simple_alloc.c div64.S util.S \ 44 ns16550.c serial.c simple_alloc.c div64.S util.S \
45 gunzip_util.c $(zlib) 45 gunzip_util.c $(zlib)
46src-plat := of.c 46src-plat := of.c
47src-boot := crt0.S $(src-wlib) $(src-plat) empty.c 47src-boot := $(src-wlib) $(src-plat) empty.c
48 48
49src-boot := $(addprefix $(obj)/, $(src-boot)) 49src-boot := $(addprefix $(obj)/, $(src-boot))
50obj-boot := $(addsuffix .o, $(basename $(src-boot))) 50obj-boot := $(addsuffix .o, $(basename $(src-boot)))
@@ -97,7 +97,7 @@ $(obj)/wrapper.a: $(obj-wlib)
97 97
98hostprogs-y := addnote addRamDisk hack-coff mktree 98hostprogs-y := addnote addRamDisk hack-coff mktree
99 99
100extra-y := $(obj)/crt0.o $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ 100extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
101 $(obj)/zImage.lds $(obj)/zImage.coff.lds 101 $(obj)/zImage.lds $(obj)/zImage.coff.lds
102 102
103wrapper :=$(srctree)/$(src)/wrapper 103wrapper :=$(srctree)/$(src)/wrapper