import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / mips / cobalt / setup.c
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  *
8  * Copyright (C) 1996, 1997 by Ralf Baechle
9  * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
10  *
11  */
12
13 #include <linux/config.h>
14 #include <linux/interrupt.h>
15 #include <linux/pci.h>
16 #include <linux/mc146818rtc.h>
17 #include <linux/init.h>
18 #include <linux/ide.h>
19
20 #include <asm/bootinfo.h>
21 #include <asm/time.h>
22 #include <asm/io.h>
23 #include <asm/irq.h>
24 #include <asm/processor.h>
25 #include <asm/reboot.h>
26 #include <asm/gt64120/gt64120.h>
27
28 #include <asm/cobalt/cobalt.h>
29
30 extern void cobalt_machine_restart(char *command);
31 extern void cobalt_machine_halt(void);
32 extern void cobalt_machine_power_off(void);
33
34 extern struct rtc_ops std_rtc_ops;
35 extern struct ide_ops std_ide_ops;
36
37
38 char arcs_cmdline[CL_SIZE] = {
39  "console=ttyS0,115200 "
40 #ifdef CONFIG_IP_PNP
41  "ip=on "
42 #endif
43 #ifdef CONFIG_ROOT_NFS
44  "root=/dev/nfs "
45 #else
46  "root=/dev/hda1 "
47 #endif
48  };
49
50 const char *get_system_type(void)
51 {
52         return "MIPS Cobalt";
53 }
54
55
56 static void __init cobalt_time_init(void)
57 {
58         rtc_ops = &std_rtc_ops;
59 }
60
61 static void __init cobalt_timer_setup(struct irqaction *irq)
62 {
63         /* Load timer value for 150 Hz */
64         GALILEO_OUTL(500000, GT_TC0_OFS);
65
66         /* Register our timer interrupt */
67         setup_irq(COBALT_TIMER_IRQ, irq);
68
69         /* Enable timer ints */
70         GALILEO_OUTL((GALILEO_ENTC0 | GALILEO_SELTC0), GT_TC_CONTROL_OFS);
71         /* Unmask timer int */
72         GALILEO_OUTL(0x100, GT_INTRMASK_OFS);
73 }
74
75
76 void __init cobalt_setup(void)
77 {
78
79         _machine_restart = cobalt_machine_restart;
80         _machine_halt = cobalt_machine_halt;
81         _machine_power_off = cobalt_machine_power_off;
82
83         board_time_init = cobalt_time_init;
84         board_timer_setup = cobalt_timer_setup;
85
86 #ifdef CONFIG_BLK_DEV_IDE
87         ide_ops = &std_ide_ops;
88 #endif
89
90         set_io_port_base(KSEG1ADDR(0x10000000));
91
92         /*
93          * This is a prom style console. We just poke at the
94          *  UART to make it talk.
95          * Only use this console if you really screw up and can't
96          *  get to the stage of setting up a real serial console.
97          */
98         /*ns16550_setup_console();*/
99 }
100
101 /* Prom init. We read our one and only communication with the
102     firmware. Grab the amount of installed memory */
103 void __init prom_init(int argc)
104 {
105         mips_machgroup = MACH_GROUP_COBALT;
106
107         add_memory_region(0x0, argc & 0x7fffffff, BOOT_MEM_RAM);
108 }
109
110 void __init prom_free_prom_memory(void)
111 {
112         /* Nothing to do! */
113 }