Split low-level OF-related bootloader code into separate files
Currently, all OF-related code in the bootloader is contained in of.c. of.c also provides the platform specific things necessary to boot on an OF platform.
However, there are platforms (such as PReP) which can include an OF implementation, but are not bootable as pure OF systems. For use by such platforms, this patch splits out the low-level parts of the OF code (call_prom() and various wrappers thereof) into a new oflib.c file. In addition, the code related to bootwrapper console output via OF are moved to a new ofconsole.c file. Both these files are included in the wrapper.a library where they can be used by both full-OF and partial OF platforms.
arch/powerpc/boot/of.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef _PPC_BOOT_OF_H_ +#define _PPC_BOOT_OF_H_ + +typedef void *phandle ; +typedef void *ihandle ; + +void of_init (void *promptr); +int of_call_prom (const char *service,int nargs,int nret, ...); +void *of_claim (unsigned long virt,unsigned long size,unsigned long align); +void of_exit (void ); + +/* Console functions */ +void of_console_init (void ); + +#endif /* _PPC_BOOT_OF_H_ */
arch/powerpc/boot/oflib.c new file +172 -0
172 lines not on this page · raw message
arch/powerpc/boot/Makefile +1 -1
@@ -43,7 +43,7 @@ $(addprefix $(obj)/,$(zlib) gunzip_util. src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ ns16550.c serial.c simple_alloc.c div64.S util.S \ - gunzip_util.c elf_util.c $(zlib) devtree.c \ + gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c
arch/powerpc/boot/of.c +7 -181
238 lines not on this page · raw message
arch/powerpc/boot/ofconsole.c new file +45 -0
45 lines not on this page · raw message
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson