Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / ia64 / kernel / setup.c
index 0e1b4eb149b4bc0537bff5a4807b8f38c06c2000..8eb276aac5cec38df3b7eff06f1802316fdc49eb 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/cpu.h>
+#include <linux/kdev_t.h>
 #include <linux/kernel.h>
 #include <linux/memblock.h>
 #include <linux/reboot.h>
@@ -41,6 +42,7 @@
 #include <linux/threads.h>
 #include <linux/screen_info.h>
 #include <linux/dmi.h>
+#include <linux/root_dev.h>
 #include <linux/serial.h>
 #include <linux/serial_core.h>
 #include <linux/efi.h>
@@ -50,7 +52,6 @@
 #include <linux/kexec.h>
 #include <linux/crash_dump.h>
 
-#include <asm/machvec.h>
 #include <asm/mca.h>
 #include <asm/meminit.h>
 #include <asm/page.h>
 #include <asm/smp.h>
 #include <asm/tlbflush.h>
 #include <asm/unistd.h>
-#include <asm/hpsim.h>
+#include <asm/uv/uv.h>
 
 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
 # error "struct cpuinfo_ia64 too big!"
 #endif
 
+char ia64_platform_name[64];
+
 #ifdef CONFIG_SMP
 unsigned long __per_cpu_offset[NR_CPUS];
 EXPORT_SYMBOL(__per_cpu_offset);
@@ -260,11 +263,11 @@ __initcall(register_memory);
  * in kdump case. See the comment in sba_init() in sba_iommu.c.
  *
  * So, the only machvec that really supports loading the kdump kernel
- * over 4 GB is "sn2".
+ * over 4 GB is "uv".
  */
 static int __init check_crashkernel_memory(unsigned long pbase, size_t size)
 {
-       if (ia64_platform_is("sn2") || ia64_platform_is("uv"))
+       if (is_uv_system())
                return 1;
        else
                return pbase < (1UL << 32);
@@ -461,23 +464,44 @@ io_port_init (void)
 static inline int __init
 early_console_setup (char *cmdline)
 {
-       int earlycons = 0;
-
-#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
-       {
-               extern int sn_serial_console_early_setup(void);
-               if (!sn_serial_console_early_setup())
-                       earlycons++;
-       }
-#endif
 #ifdef CONFIG_EFI_PCDP
        if (!efi_setup_pcdp_console(cmdline))
-               earlycons++;
+               return 0;
 #endif
-       if (!simcons_register())
-               earlycons++;
+       return -1;
+}
+
+static void __init
+screen_info_setup(void)
+{
+       unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
+
+       memset(&screen_info, 0, sizeof(screen_info));
+
+       if (!ia64_boot_param->console_info.num_rows ||
+           !ia64_boot_param->console_info.num_cols) {
+               printk(KERN_WARNING "invalid screen-info, guessing 80x25\n");
+               orig_x = 0;
+               orig_y = 0;
+               num_cols = 80;
+               num_rows = 25;
+               font_height = 16;
+       } else {
+               orig_x = ia64_boot_param->console_info.orig_x;
+               orig_y = ia64_boot_param->console_info.orig_y;
+               num_cols = ia64_boot_param->console_info.num_cols;
+               num_rows = ia64_boot_param->console_info.num_rows;
+               font_height = 400 / num_rows;
+       }
 
-       return (earlycons) ? 0 : -1;
+       screen_info.orig_x = orig_x;
+       screen_info.orig_y = orig_y;
+       screen_info.orig_video_cols  = num_cols;
+       screen_info.orig_video_lines = num_rows;
+       screen_info.orig_video_points = font_height;
+       screen_info.orig_video_mode = 3;        /* XXX fake */
+       screen_info.orig_video_isVGA = 1;       /* XXX fake */
+       screen_info.orig_video_ega_bx = 3;      /* XXX fake */
 }
 
 static inline void
@@ -536,35 +560,25 @@ setup_arch (char **cmdline_p)
        efi_init();
        io_port_init();
 
-#ifdef CONFIG_IA64_GENERIC
-       /* machvec needs to be parsed from the command line
-        * before parse_early_param() is called to ensure
-        * that ia64_mv is initialised before any command line
-        * settings may cause console setup to occur
-        */
-       machvec_init_from_cmdline(*cmdline_p);
-#endif
-
+       uv_probe_system_type();
        parse_early_param();
 
        if (early_console_setup(*cmdline_p) == 0)
                mark_bsp_online();
 
-#ifdef CONFIG_ACPI
        /* Initialize the ACPI boot-time table parser */
        acpi_table_init();
        early_acpi_boot_init();
-# ifdef CONFIG_ACPI_NUMA
+#ifdef CONFIG_ACPI_NUMA
        acpi_numa_init();
        acpi_numa_fixup();
-#  ifdef CONFIG_ACPI_HOTPLUG_CPU
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
        prefill_possible_map();
-#  endif
+#endif
        per_cpu_scan_finalize((cpumask_weight(&early_cpu_possible_map) == 0 ?
                32 : cpumask_weight(&early_cpu_possible_map)),
                additional_cpus > 0 ? additional_cpus : 0);
-# endif
-#endif /* CONFIG_APCI_BOOT */
+#endif /* CONFIG_ACPI_NUMA */
 
 #ifdef CONFIG_SMP
        smp_build_cpu_map();
@@ -614,10 +628,21 @@ setup_arch (char **cmdline_p)
        if (!nomca)
                ia64_mca_init();
 
-       platform_setup(cmdline_p);
-#ifndef CONFIG_IA64_HP_SIM
-       check_sal_cache_flush();
+       /*
+        * Default to /dev/sda2.  This assumes that the EFI partition
+        * is physical disk 1 partition 1 and the Linux root disk is
+        * physical disk 1 partition 2.
+        */
+       ROOT_DEV = Root_SDA2;           /* default to second partition on first drive */
+
+       if (is_uv_system())
+               uv_setup(cmdline_p);
+#ifdef CONFIG_SMP
+       else
+               init_smp_config();
 #endif
+
+       screen_info_setup();
        paging_init();
 
        clear_sched_clock_stable();
@@ -1046,7 +1071,6 @@ cpu_init (void)
                ia64_patch_phys_stack_reg(num_phys_stacked*8 + 8);
                max_num_phys_stacked = num_phys_stacked;
        }
-       platform_cpu_init();
 }
 
 void __init