Import changeset
[linux-flexiantxendom0-3.2.10.git] / arch / ia64 / dig / setup.c
1 /*
2  * Platform dependent support for Intel SoftSDV simulator.
3  *
4  * Copyright (C) 1999 Intel Corp.
5  * Copyright (C) 1999 Hewlett-Packard Co
6  * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
7  * Copyright (C) 1999 VA Linux Systems
8  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
9  * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
10  */
11 #include <linux/config.h>
12
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/kernel.h>
16 #include <linux/kdev_t.h>
17 #include <linux/string.h>
18 #include <linux/tty.h>
19 #include <linux/console.h>
20 #include <linux/timex.h>
21 #include <linux/sched.h>
22
23 #include <asm/io.h>
24 #include <asm/machvec.h>
25 #include <asm/system.h>
26
27 /*
28  * This is here so we can use the CMOS detection in ide-probe.c to
29  * determine what drives are present.  In theory, we don't need this
30  * as the auto-detection could be done via ide-probe.c:do_probe() but
31  * in practice that would be much slower, which is painful when
32  * running in the simulator.  Note that passing zeroes in DRIVE_INFO
33  * is sufficient (the IDE driver will autodetect the drive geometry).
34  */
35 char drive_info[4*16];
36
37 unsigned char aux_device_present = 0xaa;        /* XXX remove this when legacy I/O is gone */
38
39 void __init
40 dig_setup (char **cmdline_p)
41 {
42         unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
43
44         /*
45          * Default to /dev/sda2.  This assumes that the EFI partition
46          * is physical disk 1 partition 1 and the Linux root disk is
47          * physical disk 1 partition 2.
48          */
49         ROOT_DEV = to_kdev_t(0x0802);           /* default to second partition on first drive */
50
51 #ifdef  CONFIG_IA64_SOFTSDV_HACKS
52         ROOT_DEV = to_kdev_t(0x0302);           /* 2nd partion on 1st IDE */
53 #endif /* CONFIG_IA64_SOFTSDV_HACKS */
54
55 #ifdef CONFIG_SMP
56         init_smp_config();
57 #endif
58
59         memset(&screen_info, 0, sizeof(screen_info));
60
61         if (!ia64_boot_param.console_info.num_rows
62             || !ia64_boot_param.console_info.num_cols)
63         {
64                 printk("dig_setup: warning: invalid screen-info, guessing 80x25\n");
65                 orig_x = 0;
66                 orig_y = 0;
67                 num_cols = 80;
68                 num_rows = 25;
69                 font_height = 16;
70         } else {
71                 orig_x = ia64_boot_param.console_info.orig_x;
72                 orig_y = ia64_boot_param.console_info.orig_y;
73                 num_cols = ia64_boot_param.console_info.num_cols;
74                 num_rows = ia64_boot_param.console_info.num_rows;
75                 font_height = 400 / num_rows;
76         }
77
78         screen_info.orig_x = orig_x;
79         screen_info.orig_y = orig_y;
80         screen_info.orig_video_cols  = num_cols;
81         screen_info.orig_video_lines = num_rows;
82         screen_info.orig_video_points = font_height;
83         screen_info.orig_video_mode = 3;        /* XXX fake */
84         screen_info.orig_video_isVGA = 1;       /* XXX fake */
85         screen_info.orig_video_ega_bx = 3;      /* XXX fake */
86 }
87
88 void
89 dig_irq_init (void)
90 {
91         /*
92          * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support
93          * enabled.
94          */
95         outb(0xff, 0xA1);
96         outb(0xff, 0x21);
97 }