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 42ef03ce2fd42de145ce247d3bbc08f786c7d04d..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/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);
@@ -263,7 +267,7 @@ __initcall(register_memory);
  */
 static int __init check_crashkernel_memory(unsigned long pbase, size_t size)
 {
-       if (ia64_platform_is("uv"))
+       if (is_uv_system())
                return 1;
        else
                return pbase < (1UL << 32);
@@ -467,6 +471,39 @@ early_console_setup (char *cmdline)
        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;
+       }
+
+       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
 mark_bsp_online (void)
 {
@@ -523,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();
@@ -559,7 +586,7 @@ setup_arch (char **cmdline_p)
        find_memory();
 
        /* process SAL system table: */
-       ia64_sal_init(__va(efi.sal_systab));
+       ia64_sal_init(__va(sal_systab_phys));
 
 #ifdef CONFIG_ITANIUM
        ia64_patch_rse((u64) __start___rse_patchlist, (u64) __end___rse_patchlist);
@@ -601,7 +628,21 @@ setup_arch (char **cmdline_p)
        if (!nomca)
                ia64_mca_init();
 
-       platform_setup(cmdline_p);
+       /*
+        * 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();