]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/prom_init.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / prom_init.c
index b72849ac7db39af14fe1547571da83066cdc3d77..23e0db203329cdfeeea7312e4c2b502c23fcaf1e 100644 (file)
@@ -487,67 +487,6 @@ static int __init prom_setprop(phandle node, const char *nodename,
        return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd);
 }
 
-/* We can't use the standard versions because of RELOC headaches. */
-#define isxdigit(c)    (('0' <= (c) && (c) <= '9') \
-                        || ('a' <= (c) && (c) <= 'f') \
-                        || ('A' <= (c) && (c) <= 'F'))
-
-#define isdigit(c)     ('0' <= (c) && (c) <= '9')
-#define islower(c)     ('a' <= (c) && (c) <= 'z')
-#define toupper(c)     (islower(c) ? ((c) - 'a' + 'A') : (c))
-
-unsigned long prom_strtoul(const char *cp, const char **endp)
-{
-       unsigned long result = 0, base = 10, value;
-
-       if (*cp == '0') {
-               base = 8;
-               cp++;
-               if (toupper(*cp) == 'X') {
-                       cp++;
-                       base = 16;
-               }
-       }
-
-       while (isxdigit(*cp) &&
-              (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
-               result = result * base + value;
-               cp++;
-       }
-
-       if (endp)
-               *endp = cp;
-
-       return result;
-}
-
-unsigned long prom_memparse(const char *ptr, const char **retptr)
-{
-       unsigned long ret = prom_strtoul(ptr, retptr);
-       int shift = 0;
-
-       /*
-        * We can't use a switch here because GCC *may* generate a
-        * jump table which won't work, because we're not running at
-        * the address we're linked at.
-        */
-       if ('G' == **retptr || 'g' == **retptr)
-               shift = 30;
-
-       if ('M' == **retptr || 'm' == **retptr)
-               shift = 20;
-
-       if ('K' == **retptr || 'k' == **retptr)
-               shift = 10;
-
-       if (shift) {
-               ret <<= shift;
-               (*retptr)++;
-       }
-
-       return ret;
-}
-
 /*
  * Early parsing of the command line passed to the kernel, used for
  * "mem=x" and the options that affect the iommu
@@ -732,7 +671,7 @@ static struct fake_elf {
                        u32     ignore_me;
                } rpadesc;
        } rpanote;
-} fake_elf = {
+} fake_elf __section(.fakeelf) = {
        .elfhdr = {
                .e_ident = { 0x7f, 'E', 'L', 'F',
                             ELFCLASS32, ELFDATA2MSB, EV_CURRENT },
@@ -774,13 +713,13 @@ static struct fake_elf {
                .type = 0x12759999,
                .name = "IBM,RPA-Client-Config",
                .rpadesc = {
-                       .lpar_affinity = 0,
-                       .min_rmo_size = 64,     /* in megabytes */
+                       .lpar_affinity = 1,
+                       .min_rmo_size = 128,    /* in megabytes */
                        .min_rmo_percent = 0,
-                       .max_pft_size = 48,     /* 2^48 bytes max PFT size */
+                       .max_pft_size = 46,     /* 2^46 bytes max PFT size */
                        .splpar = 1,
                        .min_load = ~0U,
-                       .new_mem_def = 0
+                       .new_mem_def = 1
                }
        }
 };
@@ -1321,7 +1260,7 @@ static void __init prom_initialize_tce_table(void)
  *
  * -- Cort
  */
-extern void __secondary_hold(void);
+extern char __secondary_hold;
 extern unsigned long __secondary_hold_spinloop;
 extern unsigned long __secondary_hold_acknowledge;
 
@@ -1342,13 +1281,7 @@ static void __init prom_hold_cpus(void)
                = (void *) LOW_ADDR(__secondary_hold_spinloop);
        unsigned long *acknowledge
                = (void *) LOW_ADDR(__secondary_hold_acknowledge);
-#ifdef CONFIG_PPC64
-       /* __secondary_hold is actually a descriptor, not the text address */
-       unsigned long secondary_hold
-               = __pa(*PTRRELOC((unsigned long *)__secondary_hold));
-#else
        unsigned long secondary_hold = LOW_ADDR(__secondary_hold);
-#endif
 
        prom_debug("prom_hold_cpus: start...\n");
        prom_debug("    1) spinloop       = 0x%x\n", (unsigned long)spinloop);
@@ -2315,13 +2248,14 @@ static void __init prom_check_initrd(unsigned long r3, unsigned long r4)
 
 unsigned long __init prom_init(unsigned long r3, unsigned long r4,
                               unsigned long pp,
-                              unsigned long r6, unsigned long r7)
+                              unsigned long r6, unsigned long r7,
+                              unsigned long kbase)
 {      
        struct prom_t *_prom;
        unsigned long hdr;
-       unsigned long offset = reloc_offset();
 
 #ifdef CONFIG_PPC32
+       unsigned long offset = reloc_offset();
        reloc_got2(offset);
 #endif
 
@@ -2355,9 +2289,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
         */
        RELOC(of_platform) = prom_find_machine_type();
 
+#ifndef CONFIG_RELOCATABLE
        /* Bail if this is a kdump kernel. */
        if (PHYSICAL_START > 0)
                prom_panic("Error: You can't boot a kdump kernel from OF!\n");
+#endif
 
        /*
         * Check for an initrd
@@ -2377,7 +2313,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
         * Copy the CPU hold code
         */
        if (RELOC(of_platform) != PLATFORM_POWERMAC)
-               copy_and_flush(0, KERNELBASE + offset, 0x100, 0);
+               copy_and_flush(0, kbase, 0x100, 0);
 
        /*
         * Do early parsing of command line
@@ -2480,7 +2416,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
        reloc_got2(-offset);
 #endif
 
-       __start(hdr, KERNELBASE + offset, 0);
+       __start(hdr, kbase, 0);
 
        return 0;
 }