Blame view

arch/mips/cobalt/setup.c 2.72 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
  /*
   * Setup pointers to hardware dependent routines.
   *
   * This file is subject to the terms and conditions of the GNU General Public
   * License.  See the file "COPYING" in the main directory of this archive
   * for more details.
   *
fcdb27ad1   Ralf Baechle   [MIPS] Rename _ma...
8
   * Copyright (C) 1996, 1997, 2004, 05 by Ralf Baechle (ralf@linux-mips.org)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
10
11
   * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
   *
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
12
  #include <linux/init.h>
1097c6ac3   Yoichi Yuasa   [MIPS] time: Add ...
13
14
15
  #include <linux/interrupt.h>
  #include <linux/io.h>
  #include <linux/ioport.h>
fcdb27ad1   Ralf Baechle   [MIPS] Rename _ma...
16
  #include <linux/pm.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
17
18
  
  #include <asm/bootinfo.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
  #include <asm/reboot.h>
  #include <asm/gt64120.h>
cc50b67dc   Yoichi Yuasa   [MIPS] Cobalt: cl...
21
  #include <cobalt.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
  
  extern void cobalt_machine_restart(char *command);
  extern void cobalt_machine_halt(void);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
25

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
26
27
  const char *get_system_type(void)
  {
c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
28
29
30
31
32
33
34
35
36
37
  	switch (cobalt_board_id) {
  		case COBALT_BRD_ID_QUBE1:
  			return "Cobalt Qube";
  		case COBALT_BRD_ID_RAQ1:
  			return "Cobalt RaQ";
  		case COBALT_BRD_ID_QUBE2:
  			return "Cobalt Qube2";
  		case COBALT_BRD_ID_RAQ2:
  			return "Cobalt RaQ2";
  	}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
38
39
  	return "MIPS Cobalt";
  }
47d7c44b8   Yoichi Yuasa   [MIPS] Cobalt: up...
40
41
42
43
44
45
46
  /*
   * Cobalt doesn't have PS/2 keyboard/mouse interfaces,
   * keyboard conntroller is never used.
   * Also PCI-ISA bridge DMA contoroller is never used.
   */
  static struct resource cobalt_reserved_resources[] = {
  	{	/* dma1 */
5e46c3aef   Ralf Baechle   [MIPS] C99-ify st...
47
48
  		.start	= 0x00,
  		.end	= 0x1f,
47d7c44b8   Yoichi Yuasa   [MIPS] Cobalt: up...
49
50
51
52
  		.name	= "reserved",
  		.flags	= IORESOURCE_BUSY | IORESOURCE_IO,
  	},
  	{	/* keyboard */
5e46c3aef   Ralf Baechle   [MIPS] C99-ify st...
53
54
  		.start	= 0x60,
  		.end	= 0x6f,
47d7c44b8   Yoichi Yuasa   [MIPS] Cobalt: up...
55
56
57
58
  		.name	= "reserved",
  		.flags	= IORESOURCE_BUSY | IORESOURCE_IO,
  	},
  	{	/* dma page reg */
5e46c3aef   Ralf Baechle   [MIPS] C99-ify st...
59
60
  		.start	= 0x80,
  		.end	= 0x8f,
47d7c44b8   Yoichi Yuasa   [MIPS] Cobalt: up...
61
62
63
64
  		.name	= "reserved",
  		.flags	= IORESOURCE_BUSY | IORESOURCE_IO,
  	},
  	{	/* dma2 */
5e46c3aef   Ralf Baechle   [MIPS] C99-ify st...
65
66
  		.start	= 0xc0,
  		.end	= 0xdf,
47d7c44b8   Yoichi Yuasa   [MIPS] Cobalt: up...
67
68
  		.name	= "reserved",
  		.flags	= IORESOURCE_BUSY | IORESOURCE_IO,
5e46c3aef   Ralf Baechle   [MIPS] C99-ify st...
69
  	},
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
70
  };
2925aba42   Ralf Baechle   [MIPS] Cleanup me...
71
  void __init plat_mem_setup(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
72
  {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73
74
75
76
  	int i;
  
  	_machine_restart = cobalt_machine_restart;
  	_machine_halt = cobalt_machine_halt;
f13558c2a   Yoichi Yuasa   [MIPS] Cobalt: Re...
77
  	pm_power_off = cobalt_machine_halt;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
78

56ae58333   Yoichi Yuasa   [MIPS] Rewrite GA...
79
  	set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
80

b5d5accc7   Yoichi Yuasa   [MIPS] Cobalt: Fi...
81
82
  	/* I/O port resource */
  	ioport_resource.end = 0x01ffffff;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
83

47d7c44b8   Yoichi Yuasa   [MIPS] Cobalt: up...
84
85
86
  	/* These resources have been reserved by VIA SuperI/O chip. */
  	for (i = 0; i < ARRAY_SIZE(cobalt_reserved_resources); i++)
  		request_resource(&ioport_resource, cobalt_reserved_resources + i);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
87
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
88
89
  /*
   * Prom init. We read our one and only communication with the firmware.
c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
90
91
   * Grab the amount of installed memory.
   * Better boot loaders (CoLo) pass a command line too :-)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
92
93
94
95
   */
  
  void __init prom_init(void)
  {
c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
96
  	unsigned long memsz;
0833c76bd   Yoichi Yuasa   MIPS: Cobalt use ...
97
  	int argc, i;
c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
98
  	char **argv;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
99

c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
100
  	memsz = fw_arg0 & 0x7fff0000;
0833c76bd   Yoichi Yuasa   MIPS: Cobalt use ...
101
102
103
104
105
106
107
  	argc = fw_arg0 & 0x0000ffff;
  	argv = (char **)fw_arg1;
  
  	for (i = 1; i < argc; i++) {
  		strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
  		if (i < (argc - 1))
  			strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
c4ed38a0c   Ralf Baechle   Resurrect Cobalt ...
108
109
110
  	}
  
  	add_memory_region(0x0, memsz, BOOT_MEM_RAM);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
111
  }
c44e8d5e4   Atsushi Nemoto   [MIPS] prom_free_...
112
  void __init prom_free_prom_memory(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
113
114
  {
  	/* Nothing to do! */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
115
  }