spi-imx: no need to assert bits_per_word being initialized
[safe/jmp/linux-2.6] / arch / parisc / kernel / setup.c
index 3c7a3fa..cb71f3d 100644 (file)
@@ -1,5 +1,4 @@
-/*    $Id: setup.c,v 1.8 2000/02/02 04:42:38 prumpf Exp $
- *
+/*
  *    Initial setup-routines for HP 9000 based hardware.
  *
  *    Copyright (C) 1991, 1992, 1995  Linus Torvalds
@@ -44,8 +43,9 @@
 #include <asm/pdc_chassis.h>
 #include <asm/io.h>
 #include <asm/setup.h>
+#include <asm/unwind.h>
 
-char   command_line[COMMAND_LINE_SIZE] __read_mostly;
+static char __initdata command_line[COMMAND_LINE_SIZE];
 
 /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */
 struct proc_dir_entry * proc_runway_root __read_mostly = NULL;
@@ -57,11 +57,6 @@ int parisc_bus_is_phys __read_mostly = 1;    /* Assume no IOMMU is present */
 EXPORT_SYMBOL(parisc_bus_is_phys);
 #endif
 
-/* This sets the vmerge boundary and size, it's here because it has to
- * be available on all platforms (zero means no-virtual merging) */
-unsigned long parisc_vmerge_boundary = 0;
-unsigned long parisc_vmerge_max_size = 0;
-
 void __init setup_cmdline(char **cmdline_p)
 {
        extern unsigned int boot_args[];
@@ -71,9 +66,9 @@ void __init setup_cmdline(char **cmdline_p)
        /* boot_args[0] is free-mem start, boot_args[1] is ptr to command line */
        if (boot_args[0] < 64) {
                /* called from hpux boot loader */
-               saved_command_line[0] = '\0';
+               boot_command_line[0] = '\0';
        } else {
-               strcpy(saved_command_line, (char *)__va(boot_args[1]));
+               strcpy(boot_command_line, (char *)__va(boot_args[1]));
 
 #ifdef CONFIG_BLK_DEV_INITRD
                if (boot_args[2] != 0) /* did palo pass us a ramdisk? */
@@ -84,7 +79,7 @@ void __init setup_cmdline(char **cmdline_p)
 #endif
        }
 
-       strcpy(command_line, saved_command_line);
+       strcpy(command_line, boot_command_line);
        *cmdline_p = command_line;
 }
 
@@ -120,13 +115,14 @@ extern void collect_boot_cpu_data(void);
 
 void __init setup_arch(char **cmdline_p)
 {
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        extern int parisc_narrow_firmware;
 #endif
+       unwind_init();
 
        init_per_cpu(smp_processor_id());       /* Set Modes & Enable FP */
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        printk(KERN_INFO "The 64-bit Kernel has started...\n");
 #else
        printk(KERN_INFO "The 32-bit Kernel has started...\n");
@@ -134,7 +130,7 @@ void __init setup_arch(char **cmdline_p)
 
        pdc_console_init();
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        if(parisc_narrow_firmware) {
                printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
        }
@@ -162,7 +158,7 @@ void __init setup_arch(char **cmdline_p)
 }
 
 /*
- * Display cpu info for all cpu's.
+ * Display CPU info for all CPUs.
  * for parisc this is in processor.c
  */
 extern int show_cpuinfo (struct seq_file *m, void *v);
@@ -190,7 +186,7 @@ c_stop (struct seq_file *m, void *v)
 {
 }
 
-struct seq_operations cpuinfo_op = {
+const struct seq_operations cpuinfo_op = {
        .start  = c_start,
        .next   = c_next,
        .stop   = c_stop,
@@ -225,6 +221,7 @@ static void __init parisc_proc_mkdir(void)
                 }
                 break;
        case mako:
+       case mako2:
                 if (NULL == proc_mckinley_root)
                 {
                         proc_mckinley_root = proc_mkdir("bus/mckinley", NULL);
@@ -318,7 +315,7 @@ static int __init parisc_init(void)
        
        processor_init();
        printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n",
-                       boot_cpu_data.cpu_count,
+                       num_present_cpus(),
                        boot_cpu_data.cpu_name,
                        boot_cpu_data.cpu_hz / 1000000,
                        boot_cpu_data.cpu_hz % 1000000  );
@@ -367,6 +364,31 @@ static int __init parisc_init(void)
 
        return 0;
 }
-
 arch_initcall(parisc_init);
 
+void start_parisc(void)
+{
+       extern void start_kernel(void);
+
+       int ret, cpunum;
+       struct pdc_coproc_cfg coproc_cfg;
+
+       cpunum = smp_processor_id();
+
+       set_firmware_width_unlocked();
+
+       ret = pdc_coproc_cfg_unlocked(&coproc_cfg);
+       if (ret >= 0 && coproc_cfg.ccr_functional) {
+               mtctl(coproc_cfg.ccr_functional, 10);
+
+               per_cpu(cpu_data, cpunum).fp_rev = coproc_cfg.revision;
+               per_cpu(cpu_data, cpunum).fp_model = coproc_cfg.model;
+
+               asm volatile ("fstd     %fr0,8(%sp)");
+       } else {
+               panic("must have an fpu to boot linux");
+       }
+
+       start_kernel();
+       // not reached
+}