2 * ip22-setup.c: SGI specific setup, including init of the feature struct.
4 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
5 * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
7 #include <linux/ds1286.h>
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/kdev_t.h>
11 #include <linux/types.h>
12 #include <linux/module.h>
13 #include <linux/console.h>
14 #include <linux/sched.h>
15 #include <linux/tty.h>
17 #include <asm/addrspace.h>
18 #include <asm/bcache.h>
19 #include <asm/bootinfo.h>
21 #include <asm/reboot.h>
24 #include <asm/traps.h>
25 #include <asm/sgialib.h>
26 #include <asm/sgi/mc.h>
27 #include <asm/sgi/hpc3.h>
28 #include <asm/sgi/ip22.h>
30 unsigned long sgi_gfxaddr;
31 EXPORT_SYMBOL_GPL(sgi_gfxaddr);
33 extern void ip22_be_init(void) __init;
35 void __init plat_mem_setup(void)
40 board_be_init = ip22_be_init;
42 /* Init the INDY HPC I/O controller. Need to call this before
43 * fucking with the memory controller because it needs to know the
44 * boardID and whether this is a Guiness or a FullHouse machine.
48 /* Init INDY memory controller. */
51 #ifdef CONFIG_BOARD_SCACHE
52 /* Now enable boardcaches, if any. */
56 /* Set EISA IO port base for Indigo2
57 * ioremap cannot fail */
58 set_io_port_base((unsigned long)ioremap(0x00080000,
59 0x1fffffff - 0x00080000));
60 /* ARCS console environment variable is set to "g?" for
61 * graphics console, it is set to "d" for the first serial
62 * line and "d2" for the second serial line.
64 * Need to check if the case is 'g' but no keyboard:
65 * (ConsoleIn/Out = serial)
67 ctype = ArcGetEnvironmentVariable("console");
68 cserial = ArcGetEnvironmentVariable("ConsoleOut");
70 if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
71 static char options[8];
72 char *baud = ArcGetEnvironmentVariable("dbaud");
74 strcpy(options, baud);
75 add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
76 baud ? options : NULL);
77 } else if (!ctype || *ctype != 'g') {
78 /* Use ARC if we don't want serial ('d') or graphics ('g'). */
79 prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
80 add_preferred_console("arc", 0, NULL);
83 #if defined(CONFIG_VT) && defined(CONFIG_SGI_NEWPORT_CONSOLE)
86 ULONG * (*__vec)(void) = (void *) (long)
87 *((_PULONG *)(long)((PROMBLOCK)->pvector + 0x20));
90 sgi_gfxaddr = ((gfxinfo[1] >= 0xa0000000
91 && gfxinfo[1] <= 0xc0000000)
92 ? gfxinfo[1] - 0xa0000000 : 0);
94 /* newport addresses? */
95 if (sgi_gfxaddr == 0x1f0f0000 || sgi_gfxaddr == 0x1f4f0000) {
96 conswitchp = &newport_con;