fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / ppc / boot / simple / misc.c
index f09af4f..a5df089 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * arch/ppc/simple/misc.c
- *
  * Misc. bootloader code for many machines.  This assumes you have are using
  * a 6xx/7xx/74xx CPU in your machine.  This assumes the chunk of memory
  * below 8MB is free.  Finally, it assumes you have a NS16550-style uart for
  */
 
 #include <linux/types.h>
-#include <linux/config.h>
 #include <linux/string.h>
 
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/bootinfo.h>
-#ifdef CONFIG_44x
+#ifdef CONFIG_4xx
 #include <asm/ibm4xx.h>
 #endif
 #include <asm/reg.h>
 
 #include "nonstdio.h"
-#include "zlib.h"
 
 /* Default cmdline */
 #ifdef CONFIG_CMDLINE
  * Val Henson has requested that Gemini doesn't wait for the
  * user to edit the cmdline or not.
  */
-#if (defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_VGA_CONSOLE)) \
+#if (defined(CONFIG_SERIAL_8250_CONSOLE) \
+       || defined(CONFIG_VGA_CONSOLE) \
+       || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
+       || defined(CONFIG_SERIAL_MPSC_CONSOLE)) \
        && !defined(CONFIG_GEMINI)
 #define INTERACTIVE_CONSOLE    1
 #endif
@@ -86,6 +85,14 @@ get_mem_size(void)
        return 0;
 }
 
+#if defined(CONFIG_40x)
+#define PPC4xx_EMAC0_MR0       EMAC0_BASE
+#endif
+
+#if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0)
+#define PPC4xx_EMAC0_MR0       PPC44x_EMAC0_MR0
+#endif
+
 struct bi_record *
 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
 {
@@ -95,20 +102,19 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
 #endif
        char *cp;
        struct bi_record *rec;
-       unsigned long initrd_loc, TotalMemory = 0;
+       unsigned long initrd_loc = 0, TotalMemory = 0;
 
-       serial_fixups();
-#ifdef CONFIG_SERIAL_8250_CONSOLE
+#if defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_SERIAL_MPSC_CONSOLE)
        com_port = serial_init(0, NULL);
 #endif
 
-#ifdef CONFIG_44x
+#if defined(PPC4xx_EMAC0_MR0)
        /* Reset MAL */
        mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);
        /* Wait for reset */
        while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {};
        /* Reset EMAC */
-       *(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000;
+       *(volatile unsigned long *)PPC4xx_EMAC0_MR0 = 0x20000000;
        __asm__ __volatile__("eieio");
 #endif
 
@@ -163,7 +169,9 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
                puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n");
        }
 
+#ifndef CONFIG_40x /* don't overwrite the 40x image located at 0x00400000! */
        avail_ram = (char *)0x00400000;
+#endif
        end_avail = (char *)0x00800000;
        puts("avail ram:     "); puthex((unsigned long)avail_ram); puts(" ");
        puthex((unsigned long)end_avail); puts("\n");
@@ -268,10 +276,16 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
        return rec;
 }
 
+void __attribute__ ((weak))
+board_isa_init(void)
+{
+}
+
 /* Allow decompress_kernel to be hooked into.  This is the default. */
 void * __attribute__ ((weak))
 load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
                void *ign1, void *ign2)
 {
+               board_isa_init();
                return decompress_kernel(load_addr, num_words, cksum);
 }