#endif
static void print_type (image_header_t *hdr);
+#ifdef __I386__
+image_header_t *fake_header(image_header_t *hdr, void *ptr, int size);
+#endif
+
/*
* Continue booting an OS image; caller already has:
* - copied image header to global variable `header'
ulong *len_ptr, /* multi-file image length table */
int verify); /* getenv("verify")[0] != 'n' */
-#ifndef CONFIG_ARM
+#ifdef CONFIG_PPC
static boot_os_Fcn do_bootm_linux;
#else
extern boot_os_Fcn do_bootm_linux;
memmove (&header, (char *)addr, sizeof(image_header_t));
if (ntohl(hdr->ih_magic) != IH_MAGIC) {
+#ifdef __I386__ /* correct image format not implemented yet - fake it */
+ if (fake_header(hdr, (void*)addr, -1) != NULL) {
+ /* to compensate for the addition below */
+ addr -= sizeof(image_header_t);
+ /* turnof verify,
+ * fake_header() does not fake the data crc
+ */
+ verify = 0;
+ } else
+#endif /* __I386__ */
+ {
printf ("Bad Magic Number\n");
SHOW_BOOT_PROGRESS (-1);
return 1;
+ }
}
SHOW_BOOT_PROGRESS (2);
SHOW_BOOT_PROGRESS (3);
/* for multi-file images we need the data part, too */
- print_image_hdr ((image_header_t *)addr);
+ print_image_hdr (hdr);
data = addr + sizeof(image_header_t);
len = ntohl(hdr->ih_size);
len_ptr = (ulong *)data;
- if (hdr->ih_arch != IH_CPU_PPC && hdr->ih_arch != IH_CPU_ARM) {
- printf ("Unsupported Architecture\n");
+#if defined(__PPC__)
+ if (hdr->ih_arch != IH_CPU_PPC)
+#elif defined(__ARM__)
+ if (hdr->ih_arch != IH_CPU_ARM)
+#elif defined(__I386__)
+ if (hdr->ih_arch != IH_CPU_I386)
+#else
+# error Unknown CPU type
+#endif
+ {
+ printf ("Unsupported Architecture 0x%x\n", hdr->ih_arch);
SHOW_BOOT_PROGRESS (-4);
return 1;
}
iflag = disable_interrupts();
+#ifdef CONFIG_AMIGAONEG3SE
+ /*
+ * We've possible left the caches enabled during
+ * bios emulation, so turn them off again
+ */
+ icache_disable();
+ invalidate_l1_instruction_cache();
+ flush_data_cache();
+ dcache_disable();
+#endif
+
switch (hdr->ih_comp) {
case IH_COMP_NONE:
- if(hdr->ih_load == addr) {
+ if(ntohl(hdr->ih_load) == addr) {
printf (" XIP %s ... ", name);
} else {
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
return 1;
}
-#ifndef CONFIG_ARM
+#ifdef CONFIG_PPC
static void
do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
int argc, char *argv[],
initrd_high = ~0;
}
+#ifdef CONFIG_LOGBUFFER
+ kbd=gd->bd;
+ if ((s = getenv ("logstart")) != NULL) {
+ kbd->bi_sramstart = simple_strtoul(s, NULL, 16);
+ /* Prevent initrd from overwriting logbuffer */
+ if (initrd_high < kbd->bi_sramstart)
+ initrd_high = kbd->bi_sramstart-1024;
+ }
+ debug ("## Logbuffer at 0x%08lX ", kbd->bi_sramstart);
+#endif
+
/*
* Booting a (Linux) kernel image
*
asm( "mr %0,1": "=r"(sp) : );
-#ifdef DEBUG
- printf ("## Current stack ends at 0x%08lX ", sp);
-#endif
+ debug ("## Current stack ends at 0x%08lX ", sp);
+
sp -= 2048; /* just to be sure */
if (sp > CFG_BOOTMAPSZ)
sp = CFG_BOOTMAPSZ;
sp &= ~0xF;
-#ifdef DEBUG
- printf ("=> set upper limit to 0x%08lX\n", sp);
-#endif
+ debug ("=> set upper limit to 0x%08lX\n", sp);
+
cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
kbd = (bd_t *)(((ulong)cmdline - sizeof(bd_t)) & ~0xF);
len = data = 0;
}
-#ifdef DEBUG
if (!data) {
- printf ("No initrd\n");
+ debug ("No initrd\n");
}
-#endif
if (data) {
initrd_start = (ulong)kbd - len;
}
SHOW_BOOT_PROGRESS (12);
-#ifdef DEBUG
- printf ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
+
+ debug ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
data, data + len - 1, len, len);
-#endif
+
initrd_end = initrd_start + len;
printf (" Loading Ramdisk to %08lx, end %08lx ... ",
initrd_start, initrd_end);
initrd_end = 0;
}
-#ifdef DEBUG
- printf ("## Transferring control to Linux (at address %08lx) ...\n",
+
+ debug ("## Transferring control to Linux (at address %08lx) ...\n",
(ulong)kernel);
-#endif
+
SHOW_BOOT_PROGRESS (15);
#ifdef CFG_INIT_RAM_LOCK