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/console.h>
15 #include <linux/screen_info.h>
18 #include <asm/fw/arc/types.h>
19 #include <asm/sgialib.h>
23 #include <asm/mipsprom.h>
26 #include <asm/bootinfo.h>
28 #include <asm/reboot.h>
31 unsigned int sni_brd_type
;
32 EXPORT_SYMBOL(sni_brd_type
);
34 extern void sni_machine_restart(char *command
);
35 extern void sni_machine_power_off(void);
37 static void __init
sni_display_setup(void)
39 #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) && defined(CONFIG_ARC)
40 struct screen_info
*si
= &screen_info
;
43 di
= ArcGetDisplayStatus(1);
46 si
->orig_x
= di
->CursorXPosition
;
47 si
->orig_y
= di
->CursorYPosition
;
48 si
->orig_video_cols
= di
->CursorMaxXPosition
;
49 si
->orig_video_lines
= di
->CursorMaxYPosition
;
50 si
->orig_video_isVGA
= VIDEO_TYPE_VGAC
;
51 si
->orig_video_points
= 16;
56 static void __init
sni_console_setup(void)
63 static char options
[8];
65 cdev
= prom_getenv("console_dev");
66 if (strncmp(cdev
, "tty", 3) == 0) {
67 ctype
= prom_getenv("console");
72 baud
= prom_getenv("lbaud");
76 baud
= prom_getenv("rbaud");
80 strcpy(options
, baud
);
81 if (strncmp(cdev
, "tty552", 6) == 0)
82 add_preferred_console("ttyS", port
,
83 baud
? options
: NULL
);
85 add_preferred_console("ttySC", port
,
86 baud
? options
: NULL
);
92 static void __init
sni_idprom_dump(void)
96 pr_debug("SNI IDProm dump:\n");
97 for (i
= 0; i
< 256; i
++) {
101 printk("%02x ", *(unsigned char *) (SNI_IDPROM_BASE
+ i
));
109 void __init
plat_mem_setup(void)
113 set_io_port_base(SNI_PORT_BASE
);
114 // ioport_resource.end = sni_io_resource.end;
117 * Setup (E)ISA I/O memory access stuff
119 isa_slot_offset
= CKSEG1ADDR(0xb0000000);
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
:
130 system_type
= "RM400-330";
133 system_type
= "RM400-430";
136 system_type
= "RM400-530";
139 system_type
= "RM400-730";
142 system_type
= "RM400-xxx";
146 case SNI_BRD_MINITOWER
:
150 system_type
= "RM400-120";
153 system_type
= "RM400-220";
156 system_type
= "RM400-225";
159 system_type
= "RM400-420";
162 system_type
= "RM400-xxx";
166 case SNI_BRD_PCI_TOWER
:
167 system_type
= "RM400-Cxx";
170 system_type
= "RM200-xxx";
172 case SNI_BRD_PCI_MTOWER
:
173 system_type
= "RM300-Cxx";
175 case SNI_BRD_PCI_DESKTOP
:
176 switch (read_c0_prid() & 0xff00) {
179 system_type
= "RM200-C20";
182 system_type
= "RM200-C40";
185 system_type
= "RM200-Cxx";
189 case SNI_BRD_PCI_TOWER_CPLUS
:
190 system_type
= "RM400-Exx";
192 case SNI_BRD_PCI_MTOWER_CPLUS
:
193 system_type
= "RM300-Exx";
196 pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type
, system_type
);
202 switch (sni_brd_type
) {
205 case SNI_BRD_TOWER_OASIC
:
206 case SNI_BRD_MINITOWER
:
210 case SNI_BRD_PCI_TOWER
:
211 case SNI_BRD_PCI_TOWER_CPLUS
:
219 case SNI_BRD_PCI_MTOWER
:
220 case SNI_BRD_PCI_DESKTOP
:
221 case SNI_BRD_PCI_MTOWER_CPLUS
:
226 _machine_restart
= sni_machine_restart
;
227 pm_power_off
= sni_machine_power_off
;
235 #include <linux/pci.h>
236 #include <video/vga.h>
237 #include <video/cirrus.h>
239 static void __devinit
quirk_cirrus_ram_size(struct pci_dev
*dev
)
244 * firmware doesn't set the ram size correct, so we
245 * need to do it here, otherwise we get screen corruption
246 * on older Cirrus chips
248 pci_read_config_word(dev
, PCI_COMMAND
, &cmd
);
249 if ((cmd
& (PCI_COMMAND_IO
|PCI_COMMAND_MEMORY
))
250 == (PCI_COMMAND_IO
|PCI_COMMAND_MEMORY
)) {
251 vga_wseq(NULL
, CL_SEQR6
, 0x12); /* unlock all extension registers */
252 vga_wseq(NULL
, CL_SEQRF
, 0x18);
256 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS
, PCI_DEVICE_ID_CIRRUS_5434_8
,
257 quirk_cirrus_ram_size
);
258 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS
, PCI_DEVICE_ID_CIRRUS_5436
,
259 quirk_cirrus_ram_size
);
260 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS
, PCI_DEVICE_ID_CIRRUS_5446
,
261 quirk_cirrus_ram_size
);