summaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/sn1/setup.c
blob: 3bfce39e770d98042f364121d29304e0f668ff1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 *
 * Copyright (C) 1999 Silicon Graphics, Inc.
 * Copyright (C) Vijay Chander(vijay@engr.sgi.com)
 */
#include <linux/config.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/kdev_t.h>
#include <linux/string.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/timex.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/mm.h>

#include <asm/sn/mmzone_sn1.h>
#include <asm/io.h>
#include <asm/machvec.h>
#include <asm/system.h>
#include <asm/processor.h>

/*
 * The format of "screen_info" is strange, and due to early i386-setup
 * code. This is just enough to make the console code think we're on a
 * VGA color display.
 */
struct screen_info sn1_screen_info = {
	orig_x:			 0,
	orig_y:			 0,
	orig_video_mode:	 3,
	orig_video_cols:	80,
	orig_video_ega_bx:	 3,
	orig_video_lines:	25,
	orig_video_isVGA:	 1,
	orig_video_points:	16
};

/*
 * This is here so we can use the CMOS detection in ide-probe.c to
 * determine what drives are present.  In theory, we don't need this
 * as the auto-detection could be done via ide-probe.c:do_probe() but
 * in practice that would be much slower, which is painful when
 * running in the simulator.  Note that passing zeroes in DRIVE_INFO
 * is sufficient (the IDE driver will autodetect the drive geometry).
 */
char drive_info[4*16];

unsigned long
sn1_map_nr (unsigned long addr)
{
#ifdef CONFIG_DISCONTIGMEM
	return MAP_NR_SN1(addr);
#else
	return MAP_NR_DENSE(addr);
#endif
}

void __init
sn1_setup(char **cmdline_p)
{
	extern void init_sn1_smp_config(void);
	ROOT_DEV = to_kdev_t(0x0301);		/* default to first IDE drive */

	init_sn1_smp_config();
#ifdef ZZZ
#if !defined (CONFIG_IA64_SOFTSDV_HACKS)
        /*
         * Program the timer to deliver timer ticks.  0x40 is the I/O port
         * address of PIT counter 0, 0x43 is the I/O port address of the
         * PIT control word.
         */
        request_region(0x40,0x20,"timer");
        outb(0x34, 0x43);            /* Control word */
        outb(LATCH & 0xff , 0x40);   /* LSB */
        outb(LATCH >> 8, 0x40);      /* MSB */
        printk("PIT: LATCH at 0x%x%x for %d HZ\n", LATCH >> 8, LATCH & 0xff, HZ);
#endif
#endif
#ifdef CONFIG_SMP
	init_smp_config();
#endif
	screen_info = sn1_screen_info;
}

int
IS_RUNNING_ON_SIMULATOR(void)
{
#ifdef CONFIG_IA64_SGI_SN1_SIM
	long sn;
	asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2));
	return(sn == SNMAGIC);
#else
	return(0);
#endif
}