2 * Setup pointers to hardware-dependent routines.
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
8 * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org)
9 * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
11 #include <linux/eisa.h>
12 #include <linux/init.h>
13 #include <linux/export.h>
14 #include <linux/console.h>
16 #include <linux/screen_info.h>
19 #include <asm/fw/arc/types.h>
20 #include <asm/sgialib.h>
23 #ifdef CONFIG_FW_SNIPROM
24 #include <asm/mipsprom.h>
27 #include <asm/bootinfo.h>
30 #include <asm/reboot.h>
33 unsigned int sni_brd_type
;
34 EXPORT_SYMBOL(sni_brd_type
);
36 extern void sni_machine_restart(char *command
);
37 extern void sni_machine_power_off(void);
39 static void __init
sni_display_setup(void)
41 #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) && defined(CONFIG_FW_ARC)
42 struct screen_info
*si
= &screen_info
;
45 di
= ArcGetDisplayStatus(1);
48 si
->orig_x
= di
->CursorXPosition
;
49 si
->orig_y
= di
->CursorYPosition
;
50 si
->orig_video_cols
= di
->CursorMaxXPosition
;
51 si
->orig_video_lines
= di
->CursorMaxYPosition
;
52 si
->orig_video_isVGA
= VIDEO_TYPE_VGAC
;
53 si
->orig_video_points
= 16;
58 static void __init
sni_console_setup(void)
65 static char options
[8] __initdata
;
67 cdev
= prom_getenv("console_dev");
68 if (strncmp(cdev
, "tty", 3) == 0) {
69 ctype
= prom_getenv("console");
74 baud
= prom_getenv("lbaud");
78 baud
= prom_getenv("rbaud");
82 strcpy(options
, baud
);
83 if (strncmp(cdev
, "tty552", 6) == 0)
84 add_preferred_console("ttyS", port
,
85 baud
? options
: NULL
);
87 add_preferred_console("ttySC", port
,
88 baud
? options
: NULL
);
94 static void __init
sni_idprom_dump(void)
98 pr_debug("SNI IDProm dump:\n");
99 for (i
= 0; i
< 256; i
++) {
101 pr_debug("%04x ", i
);
103 printk("%02x ", *(unsigned char *) (SNI_IDPROM_BASE
+ i
));
111 void __init
plat_mem_setup(void)
115 set_io_port_base(SNI_PORT_BASE
);
116 // ioport_resource.end = sni_io_resource.end;
119 * Setup (E)ISA I/O memory access stuff
125 sni_brd_type
= *(unsigned char *)SNI_IDPROM_BRDTYPE
;
126 cputype
= *(unsigned char *)SNI_IDPROM_CPUTYPE
;
127 switch (sni_brd_type
) {
128 case SNI_BRD_TOWER_OASIC
:
131 system_type
= "RM400-330";
134 system_type
= "RM400-430";
137 system_type
= "RM400-530";
140 system_type
= "RM400-730";
143 system_type
= "RM400-xxx";
147 case SNI_BRD_MINITOWER
:
151 system_type
= "RM400-120";
154 system_type
= "RM400-220";
157 system_type
= "RM400-225";
160 system_type
= "RM400-420";
163 system_type
= "RM400-xxx";
167 case SNI_BRD_PCI_TOWER
:
168 system_type
= "RM400-Cxx";
171 system_type
= "RM200-xxx";
173 case SNI_BRD_PCI_MTOWER
:
174 system_type
= "RM300-Cxx";
176 case SNI_BRD_PCI_DESKTOP
:
177 switch (read_c0_prid() & PRID_IMP_MASK
) {
180 system_type
= "RM200-C20";
183 system_type
= "RM200-C40";
186 system_type
= "RM200-Cxx";
190 case SNI_BRD_PCI_TOWER_CPLUS
:
191 system_type
= "RM400-Exx";
193 case SNI_BRD_PCI_MTOWER_CPLUS
:
194 system_type
= "RM300-Exx";
197 pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type
, system_type
);
203 switch (sni_brd_type
) {
206 case SNI_BRD_TOWER_OASIC
:
207 case SNI_BRD_MINITOWER
:
211 case SNI_BRD_PCI_TOWER
:
212 case SNI_BRD_PCI_TOWER_CPLUS
:
220 case SNI_BRD_PCI_MTOWER
:
221 case SNI_BRD_PCI_DESKTOP
:
222 case SNI_BRD_PCI_MTOWER_CPLUS
:
227 _machine_restart
= sni_machine_restart
;
228 pm_power_off
= sni_machine_power_off
;
236 #include <linux/pci.h>
237 #include <video/vga.h>
238 #include <video/cirrus.h>
240 static void quirk_cirrus_ram_size(struct pci_dev
*dev
)
245 * firmware doesn't set the ram size correct, so we
246 * need to do it here, otherwise we get screen corruption
247 * on older Cirrus chips
249 pci_read_config_word(dev
, PCI_COMMAND
, &cmd
);
250 if ((cmd
& (PCI_COMMAND_IO
|PCI_COMMAND_MEMORY
))
251 == (PCI_COMMAND_IO
|PCI_COMMAND_MEMORY
)) {
252 vga_wseq(NULL
, CL_SEQR6
, 0x12); /* unlock all extension registers */
253 vga_wseq(NULL
, CL_SEQRF
, 0x18);
257 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS
, PCI_DEVICE_ID_CIRRUS_5434_8
,
258 quirk_cirrus_ram_size
);
259 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS
, PCI_DEVICE_ID_CIRRUS_5436
,
260 quirk_cirrus_ram_size
);
261 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS
, PCI_DEVICE_ID_CIRRUS_5446
,
262 quirk_cirrus_ram_size
);