Adjust prep loader to deal with larger kernel images. signed-off-by: Jason Wessel Index: linux-2.6.21-rc3/arch/ppc/boot/simple/misc.c =================================================================== --- linux-2.6.21-rc3.orig/arch/ppc/boot/simple/misc.c +++ linux-2.6.21-rc3/arch/ppc/boot/simple/misc.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include "nonstdio.h" +#define CONFIG_RUNTIME_CMDLINE 0x17ff000 /* Default cmdline */ #ifdef CONFIG_CMDLINE #define CMDLINE CONFIG_CMDLINE @@ -53,7 +55,7 @@ char *avail_ram; char *end_avail; char *zimage_start; -char cmd_preset[] = CMDLINE; +char cmd_preset[256] = CMDLINE; char cmd_buf[256]; char *cmd_line = cmd_buf; int keyb_present = HAS_KEYB; @@ -91,9 +93,11 @@ get_mem_size(void) #endif struct bi_record * -decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) +decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum +,RESIDUAL *residual, void *OFW_interface) { #ifdef INTERACTIVE_CONSOLE + int do_console = 0; int timer = 0; char ch; #endif @@ -120,9 +124,12 @@ decompress_kernel(unsigned long load_add * and we must have the correct file linked in here. */ TotalMemory = get_mem_size(); + puts("TotalMemory: "); puthex(TotalMemory); puts("\n"); + puts("TotalResid: "); puthex(residual->TotalMemory); puts("\n"); + puts("Resid at: "); puthex((unsigned int)residual); puts("\n"); - /* assume the chunk below 8M is free */ - end_avail = (char *)0x00800000; + /* assume the chunk below 10M is free */ + end_avail = (char *)0x00A00000; /* * Reveal where we were loaded at and where we @@ -139,6 +146,13 @@ decompress_kernel(unsigned long load_add puts("\n"); } + if (residual) { + puts("board data at: "); puthex((unsigned long)residual); + puts(" "); + puthex((unsigned long)((unsigned long)residual + + sizeof(RESIDUAL))); + puts("\n"); + } /* * We link ourself to 0x00800000. When we run, we relocate * ourselves there. So we just need __image_begin for the @@ -167,15 +181,21 @@ decompress_kernel(unsigned long load_add } #ifndef CONFIG_40x /* don't overwrite the 40x image located at 0x00400000! */ - avail_ram = (char *)0x00400000; + avail_ram = (char *)0x00500000; #endif - end_avail = (char *)0x00800000; + end_avail = (char *)0x00A00000; puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); puthex((unsigned long)end_avail); puts("\n"); if (keyb_present) CRT_tstc(); /* Forces keyboard to be initialized */ +#ifdef CONFIG_RUNTIME_CMDLINE + if (*(char *)CONFIG_RUNTIME_CMDLINE != '\0') + { + memcpy (cmd_preset, (char *)CONFIG_RUNTIME_CMDLINE, sizeof(cmd_preset)); + } +#endif /* Display standard Linux/PPC boot prompt for kernel args */ puts("\nLinux/PPC load: "); cp = cmd_line; @@ -187,7 +207,7 @@ decompress_kernel(unsigned long load_add * If they have a console, allow them to edit the command line. * Otherwise, don't bother wasting the five seconds. */ - while (timer++ < 5*1000) { + while (do_console && timer++ < 5*1000) { if (tstc()) { while ((ch = getc()) != '\n' && ch != '\r') { /* Test for backspace/delete */ @@ -215,8 +235,9 @@ decompress_kernel(unsigned long load_add #endif puts("\n"); - puts("Uncompressing Linux..."); - gunzip(NULL, 0x400000, zimage_start, &zimage_size); + puts("Compressed size: "); puthex((unsigned long)(zimage_size)); + puts("\nUncompressing Linux..."); + gunzip(NULL, 0x500000, zimage_start, &zimage_size); puts("done.\n"); /* get the bi_rec address */ @@ -274,5 +295,5 @@ load_kernel(unsigned long load_addr, int void *ign1, void *ign2) { board_isa_init(); - return decompress_kernel(load_addr, num_words, cksum); + return decompress_kernel(load_addr, num_words, cksum, ign1, ign2); }