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)
10 #include <linux/eisa.h>
11 #include <linux/hdreg.h>
12 #include <linux/ioport.h>
13 #include <linux/sched.h>
14 #include <linux/init.h>
15 #include <linux/interrupt.h>
16 #include <linux/mc146818rtc.h>
18 #include <linux/pci.h>
19 #include <linux/console.h>
21 #include <linux/screen_info.h>
24 #include <asm/arc/types.h>
25 #include <asm/sgialib.h>
28 #include <asm/bcache.h>
29 #include <asm/bootinfo.h>
32 #include <asm/mc146818-time.h>
33 #include <asm/processor.h>
34 #include <asm/reboot.h>
37 #include <asm/traps.h>
39 extern void sni_machine_restart(char *command);
40 extern void sni_machine_halt(void);
41 extern void sni_machine_power_off(void);
43 void __init plat_timer_setup(struct irqaction *irq)
45 /* set the clock to 100 Hz */
46 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
47 outb_p(LATCH & 0xff , 0x40); /* LSB */
48 outb(LATCH >> 8 , 0x40); /* MSB */
53 * A bit more gossip about the iron we're running on ...
55 static inline void sni_pcimt_detect(void)
62 csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
64 p += sprintf(p, "%s PCI", (csmsr & 0x80) ? "RM200" : "RM300");
65 if ((csmsr & 0x80) == 0)
66 p += sprintf(p, ", board revision %s",
67 (csmsr & 0x20) ? "D" : "C");
69 asic = (csmsr & 0x08) ? asic : !asic;
70 p += sprintf(p, ", ASIC PCI Rev %s", asic ? "1.0" : "1.1");
71 printk("%s.\n", boardtype);
74 static void __init sni_display_setup(void)
76 #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) && defined(CONFIG_ARC)
77 struct screen_info *si = &screen_info;
80 di = ArcGetDisplayStatus(1);
83 si->orig_x = di->CursorXPosition;
84 si->orig_y = di->CursorYPosition;
85 si->orig_video_cols = di->CursorMaxXPosition;
86 si->orig_video_lines = di->CursorMaxYPosition;
87 si->orig_video_isVGA = VIDEO_TYPE_VGAC;
88 si->orig_video_points = 16;
93 static struct resource sni_io_resource = {
94 .start = 0x00001000UL,
96 .name = "PCIMT IO MEM",
97 .flags = IORESOURCE_IO,
100 static struct resource pcimt_io_resources[] = {
105 .flags = IORESOURCE_BUSY
110 .flags = IORESOURCE_BUSY
115 .flags = IORESOURCE_BUSY
119 .name = "dma page reg",
120 .flags = IORESOURCE_BUSY
125 .flags = IORESOURCE_BUSY
129 .name = "PCI config data",
130 .flags = IORESOURCE_BUSY
134 static struct resource sni_mem_resource = {
135 .start = 0x10000000UL,
137 .name = "PCIMT PCI MEM",
138 .flags = IORESOURCE_MEM
142 * The RM200/RM300 has a few holes in it's PCI/EISA memory address space used
143 * for other purposes. Be paranoid and allocate all of the before the PCI
144 * code gets a chance to to map anything else there ...
146 * This leaves the following areas available:
148 * 0x10000000 - 0x1009ffff (640kB) PCI/EISA/ISA Bus Memory
149 * 0x10100000 - 0x13ffffff ( 15MB) PCI/EISA/ISA Bus Memory
150 * 0x18000000 - 0x1fbfffff (124MB) PCI/EISA Bus Memory
151 * 0x1ff08000 - 0x1ffeffff (816kB) PCI/EISA Bus Memory
152 * 0xa0000000 - 0xffffffff (1.5GB) PCI/EISA Bus Memory
154 static struct resource pcimt_mem_resources[] = {
158 .name = "Video RAM area",
159 .flags = IORESOURCE_BUSY
163 .name = "ISA Reserved",
164 .flags = IORESOURCE_BUSY
169 .flags = IORESOURCE_BUSY
173 .name = "Cache Replacement Area",
174 .flags = IORESOURCE_BUSY
178 .name = "PCI INT Acknowledge",
179 .flags = IORESOURCE_BUSY
184 .flags = IORESOURCE_BUSY
189 .flags = IORESOURCE_BUSY
194 .flags = IORESOURCE_BUSY
199 .flags = IORESOURCE_BUSY
203 .name = "NVRAM / EEPROM",
204 .flags = IORESOURCE_BUSY
209 .flags = IORESOURCE_BUSY
214 .flags = IORESOURCE_BUSY
218 .name = "Main Memory",
219 .flags = IORESOURCE_BUSY
223 static void __init sni_resource_init(void)
227 /* request I/O space for devices used on all i[345]86 PCs */
228 for (i = 0; i < ARRAY_SIZE(pcimt_io_resources); i++)
229 request_resource(&ioport_resource, pcimt_io_resources + i);
231 /* request mem space for pcimt-specific devices */
232 for (i = 0; i < ARRAY_SIZE(pcimt_mem_resources); i++)
233 request_resource(&sni_mem_resource, pcimt_mem_resources + i);
235 ioport_resource.end = sni_io_resource.end;
238 extern struct pci_ops sni_pci_ops;
240 static struct pci_controller sni_controller = {
241 .pci_ops = &sni_pci_ops,
242 .mem_resource = &sni_mem_resource,
243 .mem_offset = 0x10000000UL,
244 .io_resource = &sni_io_resource,
245 .io_offset = 0x00000000UL
248 static inline void sni_pcimt_time_init(void)
250 rtc_mips_get_time = mc146818_get_cmos_time;
251 rtc_mips_set_time = mc146818_set_rtc_mmss;
254 void __init plat_mem_setup(void)
258 sni_pcimt_time_init();
260 set_io_port_base(SNI_PORT_BASE);
261 ioport_resource.end = sni_io_resource.end;
264 * Setup (E)ISA I/O memory access stuff
266 isa_slot_offset = 0xb0000000;
273 _machine_restart = sni_machine_restart;
274 _machine_halt = sni_machine_halt;
275 pm_power_off = sni_machine_power_off;
280 register_pci_controller(&sni_controller);