printk/nmi: generic solution for safe printk in NMI
[deliverable/linux.git] / arch / mips / cobalt / setup.c
CommitLineData
1da177e4
LT
1/*
2 * Setup pointers to hardware dependent routines.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
fcdb27ad 8 * Copyright (C) 1996, 1997, 2004, 05 by Ralf Baechle (ralf@linux-mips.org)
1da177e4
LT
9 * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
10 *
11 */
1da177e4 12#include <linux/init.h>
1097c6ac
YY
13#include <linux/interrupt.h>
14#include <linux/io.h>
15#include <linux/ioport.h>
fcdb27ad 16#include <linux/pm.h>
1da177e4
LT
17
18#include <asm/bootinfo.h>
1da177e4 19#include <asm/reboot.h>
8a8594a7 20#include <asm/setup.h>
1da177e4
LT
21#include <asm/gt64120.h>
22
cc50b67d 23#include <cobalt.h>
1da177e4
LT
24
25extern void cobalt_machine_restart(char *command);
26extern void cobalt_machine_halt(void);
1da177e4 27
1da177e4
LT
28const char *get_system_type(void)
29{
c4ed38a0
RB
30 switch (cobalt_board_id) {
31 case COBALT_BRD_ID_QUBE1:
32 return "Cobalt Qube";
33 case COBALT_BRD_ID_RAQ1:
34 return "Cobalt RaQ";
35 case COBALT_BRD_ID_QUBE2:
36 return "Cobalt Qube2";
37 case COBALT_BRD_ID_RAQ2:
38 return "Cobalt RaQ2";
39 }
1da177e4
LT
40 return "MIPS Cobalt";
41}
42
47d7c44b
YY
43/*
44 * Cobalt doesn't have PS/2 keyboard/mouse interfaces,
45 * keyboard conntroller is never used.
46 * Also PCI-ISA bridge DMA contoroller is never used.
47 */
48static struct resource cobalt_reserved_resources[] = {
49 { /* dma1 */
5e46c3ae
RB
50 .start = 0x00,
51 .end = 0x1f,
47d7c44b
YY
52 .name = "reserved",
53 .flags = IORESOURCE_BUSY | IORESOURCE_IO,
54 },
55 { /* keyboard */
5e46c3ae
RB
56 .start = 0x60,
57 .end = 0x6f,
47d7c44b
YY
58 .name = "reserved",
59 .flags = IORESOURCE_BUSY | IORESOURCE_IO,
60 },
61 { /* dma page reg */
5e46c3ae
RB
62 .start = 0x80,
63 .end = 0x8f,
47d7c44b
YY
64 .name = "reserved",
65 .flags = IORESOURCE_BUSY | IORESOURCE_IO,
66 },
67 { /* dma2 */
5e46c3ae
RB
68 .start = 0xc0,
69 .end = 0xdf,
47d7c44b
YY
70 .name = "reserved",
71 .flags = IORESOURCE_BUSY | IORESOURCE_IO,
5e46c3ae 72 },
1da177e4
LT
73};
74
2925aba4 75void __init plat_mem_setup(void)
1da177e4 76{
1da177e4
LT
77 int i;
78
79 _machine_restart = cobalt_machine_restart;
80 _machine_halt = cobalt_machine_halt;
f13558c2 81 pm_power_off = cobalt_machine_halt;
1da177e4 82
56ae5833 83 set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
c4ed38a0 84
b5d5accc
YY
85 /* I/O port resource */
86 ioport_resource.end = 0x01ffffff;
1da177e4 87
47d7c44b
YY
88 /* These resources have been reserved by VIA SuperI/O chip. */
89 for (i = 0; i < ARRAY_SIZE(cobalt_reserved_resources); i++)
90 request_resource(&ioport_resource, cobalt_reserved_resources + i);
1da177e4
LT
91}
92
1da177e4
LT
93/*
94 * Prom init. We read our one and only communication with the firmware.
c4ed38a0
RB
95 * Grab the amount of installed memory.
96 * Better boot loaders (CoLo) pass a command line too :-)
1da177e4
LT
97 */
98
99void __init prom_init(void)
100{
c4ed38a0 101 unsigned long memsz;
0833c76b 102 int argc, i;
c4ed38a0 103 char **argv;
1da177e4 104
c4ed38a0 105 memsz = fw_arg0 & 0x7fff0000;
0833c76b
YY
106 argc = fw_arg0 & 0x0000ffff;
107 argv = (char **)fw_arg1;
108
109 for (i = 1; i < argc; i++) {
110 strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
111 if (i < (argc - 1))
112 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
c4ed38a0
RB
113 }
114
115 add_memory_region(0x0, memsz, BOOT_MEM_RAM);
8a8594a7
YY
116
117 setup_8250_early_printk_port(CKSEG1ADDR(0x1c800000), 0, 0);
1da177e4
LT
118}
119
c44e8d5e 120void __init prom_free_prom_memory(void)
1da177e4
LT
121{
122 /* Nothing to do! */
1da177e4 123}
This page took 0.806746 seconds and 5 git commands to generate.