diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2008-01-04 17:31:07 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-01-29 05:14:59 -0500 |
commit | 231a35d37293ab88d325a9cb94e5474c156282c0 (patch) | |
tree | 75f38d069e5e49de03fb789975b8a102c282b979 /arch/mips/sni/setup.c | |
parent | 237cfee1db66147aef4457f02b56a41e6f84bfd3 (diff) |
[MIPS] RM: Collected changes
- EISA support for non PCI RMs (RM200 and RM400-xxx). The major part
is the splitting of the EISA and onboard ISA of the RM200, which
makes the EISA bus on the RM200 look like on other RMs.
- 64bit kernel support
- system type detection is now common for big and little endian
- moved sniprom code to arch/mips/fw
- added call_o32 function to arch/mips/fw/lib, which uses a private
stack for calling prom functions
- fix problem with ISA interrupts, which makes using PIT clockevent
possible
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sni/setup.c')
-rw-r--r-- | arch/mips/sni/setup.c | 143 |
1 files changed, 141 insertions, 2 deletions
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index e8b26bdee24c..5484e1c62054 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c | |||
@@ -19,11 +19,17 @@ | |||
19 | #include <asm/sgialib.h> | 19 | #include <asm/sgialib.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifdef CONFIG_SNIPROM | ||
23 | #include <asm/mipsprom.h> | ||
24 | #endif | ||
25 | |||
26 | #include <asm/bootinfo.h> | ||
22 | #include <asm/io.h> | 27 | #include <asm/io.h> |
23 | #include <asm/reboot.h> | 28 | #include <asm/reboot.h> |
24 | #include <asm/sni.h> | 29 | #include <asm/sni.h> |
25 | 30 | ||
26 | unsigned int sni_brd_type; | 31 | unsigned int sni_brd_type; |
32 | EXPORT_SYMBOL(sni_brd_type); | ||
27 | 33 | ||
28 | extern void sni_machine_restart(char *command); | 34 | extern void sni_machine_restart(char *command); |
29 | extern void sni_machine_power_off(void); | 35 | extern void sni_machine_power_off(void); |
@@ -47,20 +53,152 @@ static void __init sni_display_setup(void) | |||
47 | #endif | 53 | #endif |
48 | } | 54 | } |
49 | 55 | ||
56 | static void __init sni_console_setup(void) | ||
57 | { | ||
58 | #ifndef CONFIG_ARC | ||
59 | char *ctype; | ||
60 | char *cdev; | ||
61 | char *baud; | ||
62 | int port; | ||
63 | static char options[8]; | ||
64 | |||
65 | cdev = prom_getenv("console_dev"); | ||
66 | if (strncmp(cdev, "tty", 3) == 0) { | ||
67 | ctype = prom_getenv("console"); | ||
68 | switch (*ctype) { | ||
69 | default: | ||
70 | case 'l': | ||
71 | port = 0; | ||
72 | baud = prom_getenv("lbaud"); | ||
73 | break; | ||
74 | case 'r': | ||
75 | port = 1; | ||
76 | baud = prom_getenv("rbaud"); | ||
77 | break; | ||
78 | } | ||
79 | if (baud) | ||
80 | strcpy(options, baud); | ||
81 | if (strncmp(cdev, "tty552", 6) == 0) | ||
82 | add_preferred_console("ttyS", port, | ||
83 | baud ? options : NULL); | ||
84 | else | ||
85 | add_preferred_console("ttySC", port, | ||
86 | baud ? options : NULL); | ||
87 | } | ||
88 | #endif | ||
89 | } | ||
90 | |||
91 | #ifdef DEBUG | ||
92 | static void __init sni_idprom_dump(void) | ||
93 | { | ||
94 | int i; | ||
95 | |||
96 | pr_debug("SNI IDProm dump:\n"); | ||
97 | for (i = 0; i < 256; i++) { | ||
98 | if (i%16 == 0) | ||
99 | pr_debug("%04x ", i); | ||
100 | |||
101 | printk("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i)); | ||
102 | |||
103 | if (i % 16 == 15) | ||
104 | printk("\n"); | ||
105 | } | ||
106 | } | ||
107 | #endif | ||
50 | 108 | ||
51 | void __init plat_mem_setup(void) | 109 | void __init plat_mem_setup(void) |
52 | { | 110 | { |
111 | int cputype; | ||
112 | |||
53 | set_io_port_base(SNI_PORT_BASE); | 113 | set_io_port_base(SNI_PORT_BASE); |
54 | // ioport_resource.end = sni_io_resource.end; | 114 | // ioport_resource.end = sni_io_resource.end; |
55 | 115 | ||
56 | /* | 116 | /* |
57 | * Setup (E)ISA I/O memory access stuff | 117 | * Setup (E)ISA I/O memory access stuff |
58 | */ | 118 | */ |
59 | isa_slot_offset = 0xb0000000; | 119 | isa_slot_offset = CKSEG1ADDR(0xb0000000); |
60 | #ifdef CONFIG_EISA | 120 | #ifdef CONFIG_EISA |
61 | EISA_bus = 1; | 121 | EISA_bus = 1; |
62 | #endif | 122 | #endif |
63 | 123 | ||
124 | sni_brd_type = *(unsigned char *)SNI_IDPROM_BRDTYPE; | ||
125 | cputype = *(unsigned char *)SNI_IDPROM_CPUTYPE; | ||
126 | switch (sni_brd_type) { | ||
127 | case SNI_BRD_TOWER_OASIC: | ||
128 | switch (cputype) { | ||
129 | case SNI_CPU_M8030: | ||
130 | system_type = "RM400-330"; | ||
131 | break; | ||
132 | case SNI_CPU_M8031: | ||
133 | system_type = "RM400-430"; | ||
134 | break; | ||
135 | case SNI_CPU_M8037: | ||
136 | system_type = "RM400-530"; | ||
137 | break; | ||
138 | case SNI_CPU_M8034: | ||
139 | system_type = "RM400-730"; | ||
140 | break; | ||
141 | default: | ||
142 | system_type = "RM400-xxx"; | ||
143 | break; | ||
144 | } | ||
145 | break; | ||
146 | case SNI_BRD_MINITOWER: | ||
147 | switch (cputype) { | ||
148 | case SNI_CPU_M8021: | ||
149 | case SNI_CPU_M8043: | ||
150 | system_type = "RM400-120"; | ||
151 | break; | ||
152 | case SNI_CPU_M8040: | ||
153 | system_type = "RM400-220"; | ||
154 | break; | ||
155 | case SNI_CPU_M8053: | ||
156 | system_type = "RM400-225"; | ||
157 | break; | ||
158 | case SNI_CPU_M8050: | ||
159 | system_type = "RM400-420"; | ||
160 | break; | ||
161 | default: | ||
162 | system_type = "RM400-xxx"; | ||
163 | break; | ||
164 | } | ||
165 | break; | ||
166 | case SNI_BRD_PCI_TOWER: | ||
167 | system_type = "RM400-Cxx"; | ||
168 | break; | ||
169 | case SNI_BRD_RM200: | ||
170 | system_type = "RM200-xxx"; | ||
171 | break; | ||
172 | case SNI_BRD_PCI_MTOWER: | ||
173 | system_type = "RM300-Cxx"; | ||
174 | break; | ||
175 | case SNI_BRD_PCI_DESKTOP: | ||
176 | switch (read_c0_prid() & 0xff00) { | ||
177 | case PRID_IMP_R4600: | ||
178 | case PRID_IMP_R4700: | ||
179 | system_type = "RM200-C20"; | ||
180 | break; | ||
181 | case PRID_IMP_R5000: | ||
182 | system_type = "RM200-C40"; | ||
183 | break; | ||
184 | default: | ||
185 | system_type = "RM200-Cxx"; | ||
186 | break; | ||
187 | } | ||
188 | break; | ||
189 | case SNI_BRD_PCI_TOWER_CPLUS: | ||
190 | system_type = "RM400-Exx"; | ||
191 | break; | ||
192 | case SNI_BRD_PCI_MTOWER_CPLUS: | ||
193 | system_type = "RM300-Exx"; | ||
194 | break; | ||
195 | } | ||
196 | pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type, system_type); | ||
197 | |||
198 | #ifdef DEBUG | ||
199 | sni_idprom_dump(); | ||
200 | #endif | ||
201 | |||
64 | switch (sni_brd_type) { | 202 | switch (sni_brd_type) { |
65 | case SNI_BRD_10: | 203 | case SNI_BRD_10: |
66 | case SNI_BRD_10NEW: | 204 | case SNI_BRD_10NEW: |
@@ -89,9 +227,10 @@ void __init plat_mem_setup(void) | |||
89 | pm_power_off = sni_machine_power_off; | 227 | pm_power_off = sni_machine_power_off; |
90 | 228 | ||
91 | sni_display_setup(); | 229 | sni_display_setup(); |
230 | sni_console_setup(); | ||
92 | } | 231 | } |
93 | 232 | ||
94 | #if CONFIG_PCI | 233 | #ifdef CONFIG_PCI |
95 | 234 | ||
96 | #include <linux/pci.h> | 235 | #include <linux/pci.h> |
97 | #include <video/vga.h> | 236 | #include <video/vga.h> |