]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/setup_64.c
powerpc: create kernel/setup.h
[karo-tx-linux.git] / arch / powerpc / kernel / setup_64.c
index 6b52cce872bef47ade033cd9d6853c9fcf90545b..fe39aac4f24dc76bd3cb44198c8161dcc4b84a04 100644 (file)
@@ -41,7 +41,6 @@
 #include <asm/elf.h>
 #include <asm/machdep.h>
 #include <asm/paca.h>
-#include <asm/ppcdebug.h>
 #include <asm/time.h>
 #include <asm/cputable.h>
 #include <asm/sections.h>
@@ -60,6 +59,9 @@
 #include <asm/firmware.h>
 #include <asm/systemcfg.h>
 #include <asm/xmon.h>
+#include <asm/udbg.h>
+
+#include "setup.h"
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -243,12 +245,6 @@ void __init early_setup(unsigned long dt_ptr)
 
        DBG(" -> early_setup()\n");
 
-       /*
-        * Fill the default DBG level (do we want to keep
-        * that old mecanism around forever ?)
-        */
-       ppcdbg_initialize();
-
        /*
         * Do early initializations using the flattened device
         * tree, like retreiving the physical memory map or
@@ -277,16 +273,21 @@ void __init early_setup(unsigned long dt_ptr)
        DBG("Found, Initializing memory management...\n");
 
        /*
-        * Initialize stab / SLB management
+        * Initialize the MMU Hash table and create the linear mapping
+        * of memory. Has to be done before stab/slb initialization as
+        * this is currently where the page size encoding is obtained
         */
-       if (!firmware_has_feature(FW_FEATURE_ISERIES))
-               stab_initialize(lpaca->stab_real);
+       htab_initialize();
 
        /*
-        * Initialize the MMU Hash table and create the linear mapping
-        * of memory
+        * Initialize stab / SLB management except on iSeries
         */
-       htab_initialize();
+       if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
+               if (cpu_has_feature(CPU_FTR_SLB))
+                       slb_initialize();
+               else
+                       stab_initialize(lpaca->stab_real);
+       }
 
        DBG(" <- early_setup()\n");
 }
@@ -396,43 +397,6 @@ static void __init initialize_cache_info(void)
        DBG(" <- initialize_cache_info()\n");
 }
 
-static void __init check_for_initrd(void)
-{
-#ifdef CONFIG_BLK_DEV_INITRD
-       u64 *prop;
-
-       DBG(" -> check_for_initrd()\n");
-
-       if (of_chosen) {
-               prop = (u64 *)get_property(of_chosen,
-                               "linux,initrd-start", NULL);
-               if (prop != NULL) {
-                       initrd_start = (unsigned long)__va(*prop);
-                       prop = (u64 *)get_property(of_chosen,
-                                       "linux,initrd-end", NULL);
-                       if (prop != NULL) {
-                               initrd_end = (unsigned long)__va(*prop);
-                               initrd_below_start_ok = 1;
-                       } else
-                               initrd_start = 0;
-               }
-       }
-
-       /* If we were passed an initrd, set the ROOT_DEV properly if the values
-        * look sensible. If not, clear initrd reference.
-        */
-       if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
-           initrd_end > initrd_start)
-               ROOT_DEV = Root_RAM0;
-       else
-               initrd_start = initrd_end = 0;
-
-       if (initrd_start)
-               printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
-
-       DBG(" <- check_for_initrd()\n");
-#endif /* CONFIG_BLK_DEV_INITRD */
-}
 
 /*
  * Do some initial setup of the system.  The parameters are those which 
@@ -516,7 +480,6 @@ void __init setup_system(void)
 
        printk("-----------------------------------------------------\n");
        printk("ppc64_pft_size                = 0x%lx\n", ppc64_pft_size);
-       printk("ppc64_debug_switch            = 0x%lx\n", ppc64_debug_switch);
        printk("ppc64_interrupt_controller    = 0x%ld\n", ppc64_interrupt_controller);
        printk("systemcfg                     = 0x%p\n", systemcfg);
        printk("systemcfg->platform           = 0x%x\n", systemcfg->platform);
@@ -552,10 +515,12 @@ static void __init irqstack_early_init(void)
         * SLB misses on them.
         */
        for_each_cpu(i) {
-               softirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE,
-                                       THREAD_SIZE, 0x10000000));
-               hardirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE,
-                                       THREAD_SIZE, 0x10000000));
+               softirq_ctx[i] = (struct thread_info *)
+                       __va(lmb_alloc_base(THREAD_SIZE,
+                                           THREAD_SIZE, 0x10000000));
+               hardirq_ctx[i] = (struct thread_info *)
+                       __va(lmb_alloc_base(THREAD_SIZE,
+                                           THREAD_SIZE, 0x10000000));
        }
 }
 #else
@@ -583,8 +548,8 @@ static void __init emergency_stack_init(void)
        limit = min(0x10000000UL, lmb.rmo_size);
 
        for_each_cpu(i)
-               paca[i].emergency_sp = __va(lmb_alloc_base(PAGE_SIZE, 128,
-                                               limit)) + PAGE_SIZE;
+               paca[i].emergency_sp =
+               __va(lmb_alloc_base(HW_PAGE_SIZE, 128, limit)) + HW_PAGE_SIZE;
 }
 
 /*
@@ -895,26 +860,6 @@ int check_legacy_ioport(unsigned long base_port)
 }
 EXPORT_SYMBOL(check_legacy_ioport);
 
-#ifdef CONFIG_XMON
-static int __init early_xmon(char *p)
-{
-       /* ensure xmon is enabled */
-       if (p) {
-               if (strncmp(p, "on", 2) == 0)
-                       xmon_init(1);
-               if (strncmp(p, "off", 3) == 0)
-                       xmon_init(0);
-               if (strncmp(p, "early", 5) != 0)
-                       return 0;
-       }
-       xmon_init(1);
-       debugger(NULL);
-
-       return 0;
-}
-early_param("xmon", early_xmon);
-#endif
-
 void cpu_die(void)
 {
        if (ppc_md.cpu_die)