diff options
author | Brian Murphy <brm@murphy.dk> | 2007-08-21 16:34:16 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 18:46:00 -0400 |
commit | 1f21d2bde0046e959b53756f74d96dfd040a803b (patch) | |
tree | 5ca1a0319982f1e665e57f22bd1dae1d90b07e35 /arch/mips/lasat/setup.c | |
parent | 0caf583398309398ec05fc76bff15c711e9f936d (diff) |
[MIPS] Add back support for LASAT platforms
Signed-off-by: Brian Murphy <brian@murphy.dk>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/lasat/setup.c')
-rw-r--r-- | arch/mips/lasat/setup.c | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c new file mode 100644 index 000000000000..187e37821d93 --- /dev/null +++ b/arch/mips/lasat/setup.c | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * Thomas Horsten <thh@lasat.com> | ||
6 | * Copyright (C) 2000 LASAT Networks A/S. | ||
7 | * | ||
8 | * Brian Murphy <brian@murphy.dk> | ||
9 | * | ||
10 | * This program is free software; you can distribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License (Version 2) as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
17 | * for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * Lasat specific setup. | ||
24 | */ | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/sched.h> | ||
27 | #include <linux/pci.h> | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <linux/tty.h> | ||
30 | |||
31 | #include <asm/time.h> | ||
32 | #include <asm/cpu.h> | ||
33 | #include <asm/bootinfo.h> | ||
34 | #include <asm/irq.h> | ||
35 | #include <asm/lasat/lasat.h> | ||
36 | #include <asm/lasat/serial.h> | ||
37 | |||
38 | #ifdef CONFIG_PICVUE | ||
39 | #include <linux/notifier.h> | ||
40 | #endif | ||
41 | |||
42 | #include "ds1603.h" | ||
43 | #include <asm/lasat/ds1603.h> | ||
44 | #include <asm/lasat/picvue.h> | ||
45 | #include <asm/lasat/eeprom.h> | ||
46 | |||
47 | #include "prom.h" | ||
48 | |||
49 | int lasat_command_line; | ||
50 | void lasatint_init(void); | ||
51 | |||
52 | extern void lasat_reboot_setup(void); | ||
53 | extern void pcisetup(void); | ||
54 | extern void edhac_init(void *, void *, void *); | ||
55 | extern void addrflt_init(void); | ||
56 | |||
57 | struct lasat_misc lasat_misc_info[N_MACHTYPES] = { | ||
58 | { | ||
59 | .reset_reg = (void *)KSEG1ADDR(0x1c840000), | ||
60 | .flash_wp_reg = (void *)KSEG1ADDR(0x1c800000), 2 | ||
61 | }, { | ||
62 | .reset_reg = (void *)KSEG1ADDR(0x11080000), | ||
63 | .flash_wp_reg = (void *)KSEG1ADDR(0x11000000), 6 | ||
64 | } | ||
65 | }; | ||
66 | |||
67 | struct lasat_misc *lasat_misc; | ||
68 | |||
69 | #ifdef CONFIG_DS1603 | ||
70 | static struct ds_defs ds_defs[N_MACHTYPES] = { | ||
71 | { (void *)DS1603_REG_100, (void *)DS1603_REG_100, | ||
72 | DS1603_RST_100, DS1603_CLK_100, DS1603_DATA_100, | ||
73 | DS1603_DATA_SHIFT_100, 0, 0 }, | ||
74 | { (void *)DS1603_REG_200, (void *)DS1603_DATA_REG_200, | ||
75 | DS1603_RST_200, DS1603_CLK_200, DS1603_DATA_200, | ||
76 | DS1603_DATA_READ_SHIFT_200, 1, 2000 } | ||
77 | }; | ||
78 | #endif | ||
79 | |||
80 | #ifdef CONFIG_PICVUE | ||
81 | #include "picvue.h" | ||
82 | static struct pvc_defs pvc_defs[N_MACHTYPES] = { | ||
83 | { (void *)PVC_REG_100, PVC_DATA_SHIFT_100, PVC_DATA_M_100, | ||
84 | PVC_E_100, PVC_RW_100, PVC_RS_100 }, | ||
85 | { (void *)PVC_REG_200, PVC_DATA_SHIFT_200, PVC_DATA_M_200, | ||
86 | PVC_E_200, PVC_RW_200, PVC_RS_200 } | ||
87 | }; | ||
88 | #endif | ||
89 | |||
90 | static int lasat_panic_display(struct notifier_block *this, | ||
91 | unsigned long event, void *ptr) | ||
92 | { | ||
93 | #ifdef CONFIG_PICVUE | ||
94 | unsigned char *string = ptr; | ||
95 | if (string == NULL) | ||
96 | string = "Kernel Panic"; | ||
97 | pvc_dump_string(string); | ||
98 | #endif | ||
99 | return NOTIFY_DONE; | ||
100 | } | ||
101 | |||
102 | static int lasat_panic_prom_monitor(struct notifier_block *this, | ||
103 | unsigned long event, void *ptr) | ||
104 | { | ||
105 | prom_monitor(); | ||
106 | return NOTIFY_DONE; | ||
107 | } | ||
108 | |||
109 | static struct notifier_block lasat_panic_block[] = | ||
110 | { | ||
111 | { | ||
112 | .notifier_call = lasat_panic_display, | ||
113 | .priority = INT_MAX | ||
114 | }, { | ||
115 | .notifier_call = lasat_panic_prom_monitor, | ||
116 | .priority = INT_MIN | ||
117 | } | ||
118 | }; | ||
119 | |||
120 | static void lasat_time_init(void) | ||
121 | { | ||
122 | mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2; | ||
123 | } | ||
124 | |||
125 | void __init plat_timer_setup(struct irqaction *irq) | ||
126 | { | ||
127 | change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5); | ||
128 | } | ||
129 | |||
130 | void __init plat_mem_setup(void) | ||
131 | { | ||
132 | int i; | ||
133 | lasat_misc = &lasat_misc_info[mips_machtype]; | ||
134 | #ifdef CONFIG_PICVUE | ||
135 | picvue = &pvc_defs[mips_machtype]; | ||
136 | #endif | ||
137 | |||
138 | /* Set up panic notifier */ | ||
139 | for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++) | ||
140 | atomic_notifier_chain_register(&panic_notifier_list, | ||
141 | &lasat_panic_block[i]); | ||
142 | |||
143 | lasat_reboot_setup(); | ||
144 | |||
145 | board_time_init = lasat_time_init; | ||
146 | |||
147 | #ifdef CONFIG_DS1603 | ||
148 | ds1603 = &ds_defs[mips_machtype]; | ||
149 | rtc_mips_get_time = ds1603_read; | ||
150 | rtc_mips_set_time = ds1603_set; | ||
151 | #endif | ||
152 | |||
153 | #ifdef DYNAMIC_SERIAL_INIT | ||
154 | serial_init(); | ||
155 | #endif | ||
156 | |||
157 | pr_info("Lasat specific initialization complete\n"); | ||
158 | } | ||