]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/setup_32.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[karo-tx-linux.git] / arch / powerpc / kernel / setup_32.c
index c6a67c65852a3b272e57a3087d3b270c63a00645..b45eedbb4b3a53ec439698ca3f7b115ad2ae87be 100644 (file)
@@ -24,7 +24,6 @@
 #include <asm/prom.h>
 #include <asm/processor.h>
 #include <asm/pgtable.h>
-#include <asm/bootinfo.h>
 #include <asm/setup.h>
 #include <asm/amigappc.h>
 #include <asm/smp.h>
@@ -41,6 +40,8 @@
 #include <asm/xmon.h>
 #include <asm/time.h>
 
+#define DBG(fmt...)
+
 #if defined CONFIG_KGDB
 #include <asm/kgdb.h>
 #endif
@@ -54,9 +55,13 @@ extern void power4_idle(void);
 boot_infos_t *boot_infos;
 struct ide_machdep_calls ppc_ide_md;
 
-/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
-   size value reported by the boot loader. */
-unsigned long boot_mem_size;
+/* XXX should go elsewhere */
+int __irq_offset_value;
+EXPORT_SYMBOL(__irq_offset_value);
+
+int boot_cpuid;
+EXPORT_SYMBOL_GPL(boot_cpuid);
+int boot_cpuid_phys;
 
 unsigned long ISA_DMA_THRESHOLD;
 unsigned int DMA_MODE_READ;
@@ -93,183 +98,6 @@ int dcache_bsize;
 int icache_bsize;
 int ucache_bsize;
 
-#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_FB_VGA16) || \
-    defined(CONFIG_FB_VGA16_MODULE) || defined(CONFIG_FB_VESA)
-struct screen_info screen_info = {
-       0, 25,                  /* orig-x, orig-y */
-       0,                      /* unused */
-       0,                      /* orig-video-page */
-       0,                      /* orig-video-mode */
-       80,                     /* orig-video-cols */
-       0,0,0,                  /* ega_ax, ega_bx, ega_cx */
-       25,                     /* orig-video-lines */
-       1,                      /* orig-video-isVGA */
-       16                      /* orig-video-points */
-};
-#endif /* CONFIG_VGA_CONSOLE || CONFIG_FB_VGA16 || CONFIG_FB_VESA */
-
-void machine_restart(char *cmd)
-{
-#ifdef CONFIG_NVRAM
-       nvram_sync();
-#endif
-       ppc_md.restart(cmd);
-}
-
-void machine_power_off(void)
-{
-#ifdef CONFIG_NVRAM
-       nvram_sync();
-#endif
-       ppc_md.power_off();
-}
-
-void machine_halt(void)
-{
-#ifdef CONFIG_NVRAM
-       nvram_sync();
-#endif
-       ppc_md.halt();
-}
-
-void (*pm_power_off)(void) = machine_power_off;
-
-#ifdef CONFIG_TAU
-extern u32 cpu_temp(unsigned long cpu);
-extern u32 cpu_temp_both(unsigned long cpu);
-#endif /* CONFIG_TAU */
-
-int show_cpuinfo(struct seq_file *m, void *v)
-{
-       int i = (int) v - 1;
-       unsigned int pvr;
-       unsigned short maj, min;
-       unsigned long lpj;
-
-       if (i >= NR_CPUS) {
-               /* Show summary information */
-#ifdef CONFIG_SMP
-               unsigned long bogosum = 0;
-               for (i = 0; i < NR_CPUS; ++i)
-                       if (cpu_online(i))
-                               bogosum += cpu_data[i].loops_per_jiffy;
-               seq_printf(m, "total bogomips\t: %lu.%02lu\n",
-                          bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
-#endif /* CONFIG_SMP */
-
-               if (ppc_md.show_cpuinfo != NULL)
-                       ppc_md.show_cpuinfo(m);
-               return 0;
-       }
-
-#ifdef CONFIG_SMP
-       if (!cpu_online(i))
-               return 0;
-       pvr = cpu_data[i].pvr;
-       lpj = cpu_data[i].loops_per_jiffy;
-#else
-       pvr = mfspr(SPRN_PVR);
-       lpj = loops_per_jiffy;
-#endif
-
-       seq_printf(m, "processor\t: %d\n", i);
-       seq_printf(m, "cpu\t\t: ");
-
-       if (cur_cpu_spec->pvr_mask)
-               seq_printf(m, "%s", cur_cpu_spec->cpu_name);
-       else
-               seq_printf(m, "unknown (%08x)", pvr);
-#ifdef CONFIG_ALTIVEC
-       if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
-               seq_printf(m, ", altivec supported");
-#endif
-       seq_printf(m, "\n");
-
-#ifdef CONFIG_TAU
-       if (cur_cpu_spec->cpu_features & CPU_FTR_TAU) {
-#ifdef CONFIG_TAU_AVERAGE
-               /* more straightforward, but potentially misleading */
-               seq_printf(m,  "temperature \t: %u C (uncalibrated)\n",
-                          cpu_temp(i));
-#else
-               /* show the actual temp sensor range */
-               u32 temp;
-               temp = cpu_temp_both(i);
-               seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n",
-                          temp & 0xff, temp >> 16);
-#endif
-       }
-#endif /* CONFIG_TAU */
-
-       if (ppc_md.show_percpuinfo != NULL)
-               ppc_md.show_percpuinfo(m, i);
-
-       /* If we are a Freescale core do a simple check so
-        * we dont have to keep adding cases in the future */
-       if (PVR_VER(pvr) & 0x8000) {
-               maj = PVR_MAJ(pvr);
-               min = PVR_MIN(pvr);
-       } else {
-               switch (PVR_VER(pvr)) {
-                       case 0x0020:    /* 403 family */
-                               maj = PVR_MAJ(pvr) + 1;
-                               min = PVR_MIN(pvr);
-                               break;
-                       case 0x1008:    /* 740P/750P ?? */
-                               maj = ((pvr >> 8) & 0xFF) - 1;
-                               min = pvr & 0xFF;
-                               break;
-                       default:
-                               maj = (pvr >> 8) & 0xFF;
-                               min = pvr & 0xFF;
-                               break;
-               }
-       }
-
-       /*
-        * Assume here that all clock rates are the same in a
-        * smp system.  -- Cort
-        */
-       seq_printf(m, "clock\t\t: %lu.%06luMHz\n", ppc_proc_freq / 1000000,
-                  ppc_proc_freq % 1000000);
-
-       seq_printf(m, "revision\t: %hd.%hd (pvr %04x %04x)\n",
-                  maj, min, PVR_VER(pvr), PVR_REV(pvr));
-
-       seq_printf(m, "bogomips\t: %lu.%02lu\n",
-                  lpj / (500000/HZ), (lpj / (5000/HZ)) % 100);
-
-#ifdef CONFIG_SMP
-       seq_printf(m, "\n");
-#endif
-
-       return 0;
-}
-
-static void *c_start(struct seq_file *m, loff_t *pos)
-{
-       int i = *pos;
-
-       return i <= NR_CPUS? (void *) (i + 1): NULL;
-}
-
-static void *c_next(struct seq_file *m, void *v, loff_t *pos)
-{
-       ++*pos;
-       return c_start(m, pos);
-}
-
-static void c_stop(struct seq_file *m, void *v)
-{
-}
-
-struct seq_operations cpuinfo_op = {
-       .start =c_start,
-       .next = c_next,
-       .stop = c_stop,
-       .show = show_cpuinfo,
-};
-
 /*
  * We're called here very early in the boot.  We determine the machine
  * type and call the appropriate low-level setup functions.
@@ -297,30 +125,6 @@ unsigned long __init early_init(unsigned long dt_ptr)
        return KERNELBASE + offset;
 }
 
-#ifdef CONFIG_PPC_OF
-void __init
-intuit_machine_type(void)
-{
-       char *model;
-       struct device_node *root;
-       
-       /* ask the OF info if we're a chrp or pmac */
-       root = find_path_device("/");
-       if (root != 0) {
-               /* assume pmac unless proven to be chrp -- Cort */
-               _machine = _MACH_Pmac;
-               model = get_property(root, "device_type", NULL);
-               if (model && !strncmp("chrp", model, 4))
-                       _machine = _MACH_chrp;
-               else {
-                       model = get_property(root, "model", NULL);
-                       if (model && !strncmp(model, "IBM", 3))
-                               _machine = _MACH_chrp;
-               }
-       }
-}
-#endif
-
 #ifdef CONFIG_PPC_MULTIPLATFORM
 /*
  * The PPC_MULTIPLATFORM version of platform_init...
@@ -362,64 +166,7 @@ void __init platform_init(void)
 #endif
        }
 }
-
-#ifdef CONFIG_SERIAL_CORE_CONSOLE
-extern char *of_stdout_device;
-
-static int __init set_preferred_console(void)
-{
-       struct device_node *prom_stdout;
-       char *name;
-       int offset = 0;
-
-       if (of_stdout_device == NULL)
-               return -ENODEV;
-
-       /* The user has requested a console so this is already set up. */
-       if (strstr(saved_command_line, "console="))
-               return -EBUSY;
-
-       prom_stdout = find_path_device(of_stdout_device);
-       if (!prom_stdout)
-               return -ENODEV;
-
-       name = (char *)get_property(prom_stdout, "name", NULL);
-       if (!name)
-               return -ENODEV;
-
-       if (strcmp(name, "serial") == 0) {
-               int i;
-               u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
-               if (i > 8) {
-                       switch (reg[1]) {
-                               case 0x3f8:
-                                       offset = 0;
-                                       break;
-                               case 0x2f8:
-                                       offset = 1;
-                                       break;
-                               case 0x898:
-                                       offset = 2;
-                                       break;
-                               case 0x890:
-                                       offset = 3;
-                                       break;
-                               default:
-                                       /* We dont recognise the serial port */
-                                       return -ENODEV;
-                       }
-               }
-       } else if (strcmp(name, "ch-a") == 0)
-               offset = 0;
-       else if (strcmp(name, "ch-b") == 0)
-               offset = 1;
-       else
-               return -ENODEV;
-       return add_preferred_console("ttyS", offset, NULL);
-}
-console_initcall(set_preferred_console);
-#endif /* CONFIG_SERIAL_CORE_CONSOLE */
-#endif /* CONFIG_PPC_MULTIPLATFORM */
+#endif
 
 /*
  * Find out what kind of machine we're on and save any data we need
@@ -541,11 +288,13 @@ void __init setup_arch(char **cmdline_p)
        unflatten_device_tree();
        finish_device_tree();
 
+       smp_setup_cpu_maps();
+
 #ifdef CONFIG_BOOTX_TEXT
        init_boot_display();
 #endif
 
-#ifdef CONFIG_PPC_MULTIPLATFORM
+#ifdef CONFIG_PPC_PMAC
        /* This could be called "early setup arch", it must be done
         * now because xmon need it
         */
@@ -555,8 +304,10 @@ void __init setup_arch(char **cmdline_p)
 
 #ifdef CONFIG_XMON
        xmon_map_scc();
-       if (strstr(cmd_line, "xmon"))
-               xmon(NULL);
+       if (strstr(cmd_line, "xmon")) {
+               xmon_init(1);
+               debugger(NULL);
+       }
 #endif /* CONFIG_XMON */
        if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);