Blame view

arch/mips/sgi-ip22/ip22-setup.c 2.13 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
  /*
   * ip22-setup.c: SGI specific setup, including init of the feature struct.
   *
79add6277   Justin P. Mattock   update David Mill...
4
   * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
5
6
   * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  #include <linux/init.h>
  #include <linux/kernel.h>
  #include <linux/kdev_t.h>
  #include <linux/types.h>
  #include <linux/module.h>
  #include <linux/console.h>
  #include <linux/sched.h>
  #include <linux/tty.h>
  
  #include <asm/addrspace.h>
  #include <asm/bcache.h>
  #include <asm/bootinfo.h>
  #include <asm/irq.h>
  #include <asm/reboot.h>
  #include <asm/time.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
25
26
27
  #include <asm/io.h>
  #include <asm/traps.h>
  #include <asm/sgialib.h>
  #include <asm/sgi/mc.h>
  #include <asm/sgi/hpc3.h>
  #include <asm/sgi/ip22.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
28
  extern void ip22_be_init(void) __init;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
29

2925aba42   Ralf Baechle   [MIPS] Cleanup me...
30
  void __init plat_mem_setup(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
31
32
  {
  	char *ctype;
e9feeb207   Ralf Baechle   [MIPS] IP22: Fix ...
33
  	char *cserial;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
34
35
  
  	board_be_init = ip22_be_init;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  
  	/* Init the INDY HPC I/O controller.  Need to call this before
  	 * fucking with the memory controller because it needs to know the
  	 * boardID and whether this is a Guiness or a FullHouse machine.
  	 */
  	sgihpc_init();
  
  	/* Init INDY memory controller. */
  	sgimc_init();
  
  #ifdef CONFIG_BOARD_SCACHE
  	/* Now enable boardcaches, if any. */
  	indy_sc_init();
  #endif
  
  	/* Set EISA IO port base for Indigo2
  	 * ioremap cannot fail */
  	set_io_port_base((unsigned long)ioremap(0x00080000,
  						0x1fffffff - 0x00080000));
  	/* ARCS console environment variable is set to "g?" for
  	 * graphics console, it is set to "d" for the first serial
  	 * line and "d2" for the second serial line.
e9feeb207   Ralf Baechle   [MIPS] IP22: Fix ...
58
59
60
  	 *
  	 * Need to check if the case is 'g' but no keyboard:
  	 * (ConsoleIn/Out = serial)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
61
62
  	 */
  	ctype = ArcGetEnvironmentVariable("console");
e9feeb207   Ralf Baechle   [MIPS] IP22: Fix ...
63
64
65
  	cserial = ArcGetEnvironmentVariable("ConsoleOut");
  
  	if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
599a89459   Dmitri Vorobiev   MIPS: Move severa...
66
  		static char options[8] __initdata;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
67
68
69
70
71
72
  		char *baud = ArcGetEnvironmentVariable("dbaud");
  		if (baud)
  			strcpy(options, baud);
  		add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
  				      baud ? options : NULL);
  	} else if (!ctype || *ctype != 'g') {
e9feeb207   Ralf Baechle   [MIPS] IP22: Fix ...
73
  		/* Use ARC if we don't want serial ('d') or graphics ('g'). */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
75
76
  		prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
  		add_preferred_console("arc", 0, NULL);
  	}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
77
  }