194b212c2SPaul Mackerras /* 294b212c2SPaul Mackerras * Copyright (C) Paul Mackerras 1997. 394b212c2SPaul Mackerras * 494b212c2SPaul Mackerras * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner. 594b212c2SPaul Mackerras * 694b212c2SPaul Mackerras * This program is free software; you can redistribute it and/or 794b212c2SPaul Mackerras * modify it under the terms of the GNU General Public License 894b212c2SPaul Mackerras * as published by the Free Software Foundation; either version 994b212c2SPaul Mackerras * 2 of the License, or (at your option) any later version. 1094b212c2SPaul Mackerras */ 1194b212c2SPaul Mackerras #include <stdarg.h> 1294b212c2SPaul Mackerras #include <stddef.h> 1394b212c2SPaul Mackerras #include "elf.h" 1494b212c2SPaul Mackerras #include "page.h" 1594b212c2SPaul Mackerras #include "string.h" 1694b212c2SPaul Mackerras #include "stdio.h" 1794b212c2SPaul Mackerras #include "zlib.h" 18*b2c5f619SMark A. Greer #include "ops.h" 19*b2c5f619SMark A. Greer #include "flatdevtree.h" 2094b212c2SPaul Mackerras 2194b212c2SPaul Mackerras extern void flush_cache(void *, unsigned long); 2294b212c2SPaul Mackerras 2394b212c2SPaul Mackerras extern char _start[]; 2494b212c2SPaul Mackerras extern char __bss_start[]; 2594b212c2SPaul Mackerras extern char _end[]; 2694b212c2SPaul Mackerras extern char _vmlinux_start[]; 2794b212c2SPaul Mackerras extern char _vmlinux_end[]; 2894b212c2SPaul Mackerras extern char _initrd_start[]; 2994b212c2SPaul Mackerras extern char _initrd_end[]; 3094b212c2SPaul Mackerras 3194b212c2SPaul Mackerras struct addr_range { 3294b212c2SPaul Mackerras unsigned long addr; 3394b212c2SPaul Mackerras unsigned long size; 3494b212c2SPaul Mackerras unsigned long memsize; 3594b212c2SPaul Mackerras }; 3694b212c2SPaul Mackerras static struct addr_range vmlinux; 3794b212c2SPaul Mackerras static struct addr_range vmlinuz; 3894b212c2SPaul Mackerras static struct addr_range initrd; 3994b212c2SPaul Mackerras 4094b212c2SPaul Mackerras static unsigned long elfoffset; 41*b2c5f619SMark A. Greer static int is_64bit; 4294b212c2SPaul Mackerras 43*b2c5f619SMark A. Greer /* scratch space for gunzip; 46912 is from zlib_inflate_workspacesize() */ 44*b2c5f619SMark A. Greer static char scratch[46912]; 4594b212c2SPaul Mackerras static char elfheader[256]; 4694b212c2SPaul Mackerras 47*b2c5f619SMark A. Greer typedef void (*kernel_entry_t)(unsigned long, unsigned long, void *); 4894b212c2SPaul Mackerras 4994b212c2SPaul Mackerras #undef DEBUG 5094b212c2SPaul Mackerras 5194b212c2SPaul Mackerras #define HEAD_CRC 2 5294b212c2SPaul Mackerras #define EXTRA_FIELD 4 5394b212c2SPaul Mackerras #define ORIG_NAME 8 5494b212c2SPaul Mackerras #define COMMENT 0x10 5594b212c2SPaul Mackerras #define RESERVED 0xe0 5694b212c2SPaul Mackerras 5794b212c2SPaul Mackerras static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) 5894b212c2SPaul Mackerras { 5994b212c2SPaul Mackerras z_stream s; 6094b212c2SPaul Mackerras int r, i, flags; 6194b212c2SPaul Mackerras 6294b212c2SPaul Mackerras /* skip header */ 6394b212c2SPaul Mackerras i = 10; 6494b212c2SPaul Mackerras flags = src[3]; 6594b212c2SPaul Mackerras if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) { 6694b212c2SPaul Mackerras printf("bad gzipped data\n\r"); 6794b212c2SPaul Mackerras exit(); 6894b212c2SPaul Mackerras } 6994b212c2SPaul Mackerras if ((flags & EXTRA_FIELD) != 0) 7094b212c2SPaul Mackerras i = 12 + src[10] + (src[11] << 8); 7194b212c2SPaul Mackerras if ((flags & ORIG_NAME) != 0) 7294b212c2SPaul Mackerras while (src[i++] != 0) 7394b212c2SPaul Mackerras ; 7494b212c2SPaul Mackerras if ((flags & COMMENT) != 0) 7594b212c2SPaul Mackerras while (src[i++] != 0) 7694b212c2SPaul Mackerras ; 7794b212c2SPaul Mackerras if ((flags & HEAD_CRC) != 0) 7894b212c2SPaul Mackerras i += 2; 7994b212c2SPaul Mackerras if (i >= *lenp) { 8094b212c2SPaul Mackerras printf("gunzip: ran out of data in header\n\r"); 8194b212c2SPaul Mackerras exit(); 8294b212c2SPaul Mackerras } 8394b212c2SPaul Mackerras 8494b212c2SPaul Mackerras if (zlib_inflate_workspacesize() > sizeof(scratch)) { 8594b212c2SPaul Mackerras printf("gunzip needs more mem\n"); 8694b212c2SPaul Mackerras exit(); 8794b212c2SPaul Mackerras } 8894b212c2SPaul Mackerras memset(&s, 0, sizeof(s)); 8994b212c2SPaul Mackerras s.workspace = scratch; 9094b212c2SPaul Mackerras r = zlib_inflateInit2(&s, -MAX_WBITS); 9194b212c2SPaul Mackerras if (r != Z_OK) { 9294b212c2SPaul Mackerras printf("inflateInit2 returned %d\n\r", r); 9394b212c2SPaul Mackerras exit(); 9494b212c2SPaul Mackerras } 9594b212c2SPaul Mackerras s.next_in = src + i; 9694b212c2SPaul Mackerras s.avail_in = *lenp - i; 9794b212c2SPaul Mackerras s.next_out = dst; 9894b212c2SPaul Mackerras s.avail_out = dstlen; 9994b212c2SPaul Mackerras r = zlib_inflate(&s, Z_FULL_FLUSH); 10094b212c2SPaul Mackerras if (r != Z_OK && r != Z_STREAM_END) { 10194b212c2SPaul Mackerras printf("inflate returned %d msg: %s\n\r", r, s.msg); 10294b212c2SPaul Mackerras exit(); 10394b212c2SPaul Mackerras } 10494b212c2SPaul Mackerras *lenp = s.next_out - (unsigned char *) dst; 10594b212c2SPaul Mackerras zlib_inflateEnd(&s); 10694b212c2SPaul Mackerras } 10794b212c2SPaul Mackerras 10894b212c2SPaul Mackerras static int is_elf64(void *hdr) 10994b212c2SPaul Mackerras { 11094b212c2SPaul Mackerras Elf64_Ehdr *elf64 = hdr; 11194b212c2SPaul Mackerras Elf64_Phdr *elf64ph; 11294b212c2SPaul Mackerras unsigned int i; 11394b212c2SPaul Mackerras 11494b212c2SPaul Mackerras if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 && 11594b212c2SPaul Mackerras elf64->e_ident[EI_MAG1] == ELFMAG1 && 11694b212c2SPaul Mackerras elf64->e_ident[EI_MAG2] == ELFMAG2 && 11794b212c2SPaul Mackerras elf64->e_ident[EI_MAG3] == ELFMAG3 && 11894b212c2SPaul Mackerras elf64->e_ident[EI_CLASS] == ELFCLASS64 && 11994b212c2SPaul Mackerras elf64->e_ident[EI_DATA] == ELFDATA2MSB && 12094b212c2SPaul Mackerras elf64->e_type == ET_EXEC && 12194b212c2SPaul Mackerras elf64->e_machine == EM_PPC64)) 12294b212c2SPaul Mackerras return 0; 12394b212c2SPaul Mackerras 12494b212c2SPaul Mackerras elf64ph = (Elf64_Phdr *)((unsigned long)elf64 + 12594b212c2SPaul Mackerras (unsigned long)elf64->e_phoff); 12694b212c2SPaul Mackerras for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++) 127158daa4cSOlaf Hering if (elf64ph->p_type == PT_LOAD) 12894b212c2SPaul Mackerras break; 12994b212c2SPaul Mackerras if (i >= (unsigned int)elf64->e_phnum) 13094b212c2SPaul Mackerras return 0; 13194b212c2SPaul Mackerras 13294b212c2SPaul Mackerras elfoffset = (unsigned long)elf64ph->p_offset; 13394b212c2SPaul Mackerras vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset; 13494b212c2SPaul Mackerras vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset; 13566a45dd3SPaul Mackerras 136*b2c5f619SMark A. Greer is_64bit = 1; 13794b212c2SPaul Mackerras return 1; 13894b212c2SPaul Mackerras } 13994b212c2SPaul Mackerras 14094b212c2SPaul Mackerras static int is_elf32(void *hdr) 14194b212c2SPaul Mackerras { 14294b212c2SPaul Mackerras Elf32_Ehdr *elf32 = hdr; 14394b212c2SPaul Mackerras Elf32_Phdr *elf32ph; 14494b212c2SPaul Mackerras unsigned int i; 14594b212c2SPaul Mackerras 14694b212c2SPaul Mackerras if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 && 14794b212c2SPaul Mackerras elf32->e_ident[EI_MAG1] == ELFMAG1 && 14894b212c2SPaul Mackerras elf32->e_ident[EI_MAG2] == ELFMAG2 && 14994b212c2SPaul Mackerras elf32->e_ident[EI_MAG3] == ELFMAG3 && 15094b212c2SPaul Mackerras elf32->e_ident[EI_CLASS] == ELFCLASS32 && 15194b212c2SPaul Mackerras elf32->e_ident[EI_DATA] == ELFDATA2MSB && 15294b212c2SPaul Mackerras elf32->e_type == ET_EXEC && 15394b212c2SPaul Mackerras elf32->e_machine == EM_PPC)) 15494b212c2SPaul Mackerras return 0; 15594b212c2SPaul Mackerras 15694b212c2SPaul Mackerras elf32 = (Elf32_Ehdr *)elfheader; 15794b212c2SPaul Mackerras elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff); 15894b212c2SPaul Mackerras for (i = 0; i < elf32->e_phnum; i++, elf32ph++) 159158daa4cSOlaf Hering if (elf32ph->p_type == PT_LOAD) 16094b212c2SPaul Mackerras break; 16194b212c2SPaul Mackerras if (i >= elf32->e_phnum) 16294b212c2SPaul Mackerras return 0; 16394b212c2SPaul Mackerras 16494b212c2SPaul Mackerras elfoffset = elf32ph->p_offset; 16594b212c2SPaul Mackerras vmlinux.size = elf32ph->p_filesz + elf32ph->p_offset; 16694b212c2SPaul Mackerras vmlinux.memsize = elf32ph->p_memsz + elf32ph->p_offset; 16794b212c2SPaul Mackerras return 1; 16894b212c2SPaul Mackerras } 16994b212c2SPaul Mackerras 170*b2c5f619SMark A. Greer static void prep_kernel(unsigned long *a1, unsigned long *a2) 17130d8caf7Smostrows@watson.ibm.com { 17230d8caf7Smostrows@watson.ibm.com int len; 17366a45dd3SPaul Mackerras 17494b212c2SPaul Mackerras vmlinuz.addr = (unsigned long)_vmlinux_start; 17594b212c2SPaul Mackerras vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start); 17694b212c2SPaul Mackerras 17794b212c2SPaul Mackerras /* gunzip the ELF header of the kernel */ 17894b212c2SPaul Mackerras if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { 17994b212c2SPaul Mackerras len = vmlinuz.size; 18094b212c2SPaul Mackerras gunzip(elfheader, sizeof(elfheader), 18194b212c2SPaul Mackerras (unsigned char *)vmlinuz.addr, &len); 18294b212c2SPaul Mackerras } else 183*b2c5f619SMark A. Greer memcpy(elfheader, (const void *)vmlinuz.addr, 184*b2c5f619SMark A. Greer sizeof(elfheader)); 18594b212c2SPaul Mackerras 18694b212c2SPaul Mackerras if (!is_elf64(elfheader) && !is_elf32(elfheader)) { 18794b212c2SPaul Mackerras printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r"); 18894b212c2SPaul Mackerras exit(); 18994b212c2SPaul Mackerras } 190*b2c5f619SMark A. Greer if (platform_ops.image_hdr) 191*b2c5f619SMark A. Greer platform_ops.image_hdr(elfheader); 19294b212c2SPaul Mackerras 193*b2c5f619SMark A. Greer /* We need to alloc the memsize plus the file offset since gzip 19494b212c2SPaul Mackerras * will expand the header (file offset), then the kernel, then 19594b212c2SPaul Mackerras * possible rubbish we don't care about. But the kernel bss must 19694b212c2SPaul Mackerras * be claimed (it will be zero'd by the kernel itself) 19794b212c2SPaul Mackerras */ 19894b212c2SPaul Mackerras printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize); 199*b2c5f619SMark A. Greer vmlinux.addr = (unsigned long)malloc(vmlinux.memsize); 20094b212c2SPaul Mackerras if (vmlinux.addr == 0) { 20194b212c2SPaul Mackerras printf("Can't allocate memory for kernel image !\n\r"); 20294b212c2SPaul Mackerras exit(); 20394b212c2SPaul Mackerras } 20494b212c2SPaul Mackerras 20594b212c2SPaul Mackerras /* 206*b2c5f619SMark A. Greer * Now we try to alloc memory for the initrd (and copy it there) 20794b212c2SPaul Mackerras */ 20894b212c2SPaul Mackerras initrd.size = (unsigned long)(_initrd_end - _initrd_start); 20994b212c2SPaul Mackerras initrd.memsize = initrd.size; 21094b212c2SPaul Mackerras if ( initrd.size > 0 ) { 211*b2c5f619SMark A. Greer printf("Allocating 0x%lx bytes for initrd ...\n\r", 212*b2c5f619SMark A. Greer initrd.size); 213*b2c5f619SMark A. Greer initrd.addr = (unsigned long)malloc((u32)initrd.size); 21494b212c2SPaul Mackerras if (initrd.addr == 0) { 215*b2c5f619SMark A. Greer printf("Can't allocate memory for initial " 216*b2c5f619SMark A. Greer "ramdisk !\n\r"); 21794b212c2SPaul Mackerras exit(); 21894b212c2SPaul Mackerras } 219*b2c5f619SMark A. Greer *a1 = initrd.addr; 220*b2c5f619SMark A. Greer *a2 = initrd.size; 221*b2c5f619SMark A. Greer printf("initial ramdisk moving 0x%lx <- 0x%lx " 222*b2c5f619SMark A. Greer "(0x%lx bytes)\n\r", initrd.addr, 223*b2c5f619SMark A. Greer (unsigned long)_initrd_start, initrd.size); 224*b2c5f619SMark A. Greer memmove((void *)initrd.addr, (void *)_initrd_start, 225*b2c5f619SMark A. Greer initrd.size); 226*b2c5f619SMark A. Greer printf("initrd head: 0x%lx\n\r", 227*b2c5f619SMark A. Greer *((unsigned long *)initrd.addr)); 22894b212c2SPaul Mackerras } 22994b212c2SPaul Mackerras 23094b212c2SPaul Mackerras /* Eventually gunzip the kernel */ 23194b212c2SPaul Mackerras if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { 23294b212c2SPaul Mackerras printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...", 23394b212c2SPaul Mackerras vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size); 23494b212c2SPaul Mackerras len = vmlinuz.size; 23594b212c2SPaul Mackerras gunzip((void *)vmlinux.addr, vmlinux.memsize, 23694b212c2SPaul Mackerras (unsigned char *)vmlinuz.addr, &len); 23794b212c2SPaul Mackerras printf("done 0x%lx bytes\n\r", len); 23894b212c2SPaul Mackerras } else { 239*b2c5f619SMark A. Greer memmove((void *)vmlinux.addr,(void *)vmlinuz.addr, 240*b2c5f619SMark A. Greer vmlinuz.size); 24194b212c2SPaul Mackerras } 24294b212c2SPaul Mackerras 24394b212c2SPaul Mackerras /* Skip over the ELF header */ 24494b212c2SPaul Mackerras #ifdef DEBUG 24594b212c2SPaul Mackerras printf("... skipping 0x%lx bytes of ELF header\n\r", 24694b212c2SPaul Mackerras elfoffset); 24794b212c2SPaul Mackerras #endif 24894b212c2SPaul Mackerras vmlinux.addr += elfoffset; 24994b212c2SPaul Mackerras 25094b212c2SPaul Mackerras flush_cache((void *)vmlinux.addr, vmlinux.size); 25194b212c2SPaul Mackerras } 25294b212c2SPaul Mackerras 253*b2c5f619SMark A. Greer void __attribute__ ((weak)) ft_init(void *dt_blob) 254*b2c5f619SMark A. Greer { 255*b2c5f619SMark A. Greer } 256*b2c5f619SMark A. Greer 257*b2c5f619SMark A. Greer /* A buffer that may be edited by tools operating on a zImage binary so as to 258*b2c5f619SMark A. Greer * edit the command line passed to vmlinux (by setting /chosen/bootargs). 259*b2c5f619SMark A. Greer * The buffer is put in it's own section so that tools may locate it easier. 260*b2c5f619SMark A. Greer */ 261*b2c5f619SMark A. Greer static char builtin_cmdline[COMMAND_LINE_SIZE] 262*b2c5f619SMark A. Greer __attribute__((__section__("__builtin_cmdline"))); 263*b2c5f619SMark A. Greer 264*b2c5f619SMark A. Greer static void get_cmdline(char *buf, int size) 265*b2c5f619SMark A. Greer { 266*b2c5f619SMark A. Greer void *devp; 267*b2c5f619SMark A. Greer int len = strlen(builtin_cmdline); 268*b2c5f619SMark A. Greer 269*b2c5f619SMark A. Greer buf[0] = '\0'; 270*b2c5f619SMark A. Greer 271*b2c5f619SMark A. Greer if (len > 0) { /* builtin_cmdline overrides dt's /chosen/bootargs */ 272*b2c5f619SMark A. Greer len = min(len, size-1); 273*b2c5f619SMark A. Greer strncpy(buf, builtin_cmdline, len); 274*b2c5f619SMark A. Greer buf[len] = '\0'; 275*b2c5f619SMark A. Greer } 276*b2c5f619SMark A. Greer else if ((devp = finddevice("/chosen"))) 277*b2c5f619SMark A. Greer getprop(devp, "bootargs", buf, size); 278*b2c5f619SMark A. Greer } 279*b2c5f619SMark A. Greer 280*b2c5f619SMark A. Greer static void set_cmdline(char *buf) 281*b2c5f619SMark A. Greer { 282*b2c5f619SMark A. Greer void *devp; 283*b2c5f619SMark A. Greer 284*b2c5f619SMark A. Greer if ((devp = finddevice("/chosen"))) 285*b2c5f619SMark A. Greer setprop(devp, "bootargs", buf, strlen(buf) + 1); 286*b2c5f619SMark A. Greer } 287*b2c5f619SMark A. Greer 288*b2c5f619SMark A. Greer /* Section where ft can be tacked on after zImage is built */ 289*b2c5f619SMark A. Greer union blobspace { 290*b2c5f619SMark A. Greer struct boot_param_header hdr; 291*b2c5f619SMark A. Greer char space[8*1024]; 292*b2c5f619SMark A. Greer } dt_blob __attribute__((__section__("__builtin_ft"))); 293*b2c5f619SMark A. Greer 294*b2c5f619SMark A. Greer struct platform_ops platform_ops; 295*b2c5f619SMark A. Greer struct dt_ops dt_ops; 296*b2c5f619SMark A. Greer struct console_ops console_ops; 297*b2c5f619SMark A. Greer 298*b2c5f619SMark A. Greer void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) 299*b2c5f619SMark A. Greer { 300*b2c5f619SMark A. Greer int have_dt = 0; 301*b2c5f619SMark A. Greer kernel_entry_t kentry; 302*b2c5f619SMark A. Greer char cmdline[COMMAND_LINE_SIZE]; 303*b2c5f619SMark A. Greer 304*b2c5f619SMark A. Greer memset(__bss_start, 0, _end - __bss_start); 305*b2c5f619SMark A. Greer memset(&platform_ops, 0, sizeof(platform_ops)); 306*b2c5f619SMark A. Greer memset(&dt_ops, 0, sizeof(dt_ops)); 307*b2c5f619SMark A. Greer memset(&console_ops, 0, sizeof(console_ops)); 308*b2c5f619SMark A. Greer 309*b2c5f619SMark A. Greer /* Override the dt_ops and device tree if there was an flat dev 310*b2c5f619SMark A. Greer * tree attached to the zImage. 311*b2c5f619SMark A. Greer */ 312*b2c5f619SMark A. Greer if (dt_blob.hdr.magic == OF_DT_HEADER) { 313*b2c5f619SMark A. Greer have_dt = 1; 314*b2c5f619SMark A. Greer ft_init(&dt_blob); 315*b2c5f619SMark A. Greer } 316*b2c5f619SMark A. Greer 317*b2c5f619SMark A. Greer if (platform_init(promptr)) 318*b2c5f619SMark A. Greer exit(); 319*b2c5f619SMark A. Greer if (console_ops.open && (console_ops.open() < 0)) 320*b2c5f619SMark A. Greer exit(); 321*b2c5f619SMark A. Greer if (platform_ops.fixups) 322*b2c5f619SMark A. Greer platform_ops.fixups(); 323*b2c5f619SMark A. Greer 324*b2c5f619SMark A. Greer printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", 325*b2c5f619SMark A. Greer _start, sp); 326*b2c5f619SMark A. Greer 327*b2c5f619SMark A. Greer prep_kernel(&a1, &a2); 328*b2c5f619SMark A. Greer 329*b2c5f619SMark A. Greer /* If cmdline came from zimage wrapper or if we can edit the one 330*b2c5f619SMark A. Greer * in the dt, print it out and edit it, if possible. 331*b2c5f619SMark A. Greer */ 332*b2c5f619SMark A. Greer if ((strlen(builtin_cmdline) > 0) || console_ops.edit_cmdline) { 333*b2c5f619SMark A. Greer get_cmdline(cmdline, COMMAND_LINE_SIZE); 334*b2c5f619SMark A. Greer printf("\n\rLinux/PowerPC load: %s", cmdline); 335*b2c5f619SMark A. Greer if (console_ops.edit_cmdline) 336*b2c5f619SMark A. Greer console_ops.edit_cmdline(cmdline, COMMAND_LINE_SIZE); 337*b2c5f619SMark A. Greer printf("\n\r"); 338*b2c5f619SMark A. Greer set_cmdline(cmdline); 339*b2c5f619SMark A. Greer } 340*b2c5f619SMark A. Greer 341*b2c5f619SMark A. Greer if (console_ops.close) 342*b2c5f619SMark A. Greer console_ops.close(); 343*b2c5f619SMark A. Greer 344*b2c5f619SMark A. Greer kentry = (kernel_entry_t) vmlinux.addr; 345*b2c5f619SMark A. Greer if (have_dt) 346*b2c5f619SMark A. Greer kentry(dt_ops.ft_addr(), 0, NULL); 347*b2c5f619SMark A. Greer else 348*b2c5f619SMark A. Greer /* XXX initrd addr/size should be passed in properties */ 349*b2c5f619SMark A. Greer kentry(a1, a2, promptr); 350*b2c5f619SMark A. Greer 351*b2c5f619SMark A. Greer /* console closed so printf below may not work */ 352*b2c5f619SMark A. Greer printf("Error: Linux kernel returned to zImage boot wrapper!\n\r"); 353*b2c5f619SMark A. Greer exit(); 354*b2c5f619SMark A. Greer } 355