13 #include <linux/kernel.h>
14 #include <linux/types.h>
16 #include <linux/sched.h>
17 #include <linux/pci.h>
19 #include <linux/screen_info.h>
21 #include <asm/compiler.h>
22 #include <asm/ptrace.h>
25 #include <asm/mmu_context.h>
27 #include <asm/pgtable.h>
30 #include <asm/tlbflush.h>
38 #if defined(ALPHA_RESTORE_SRM_SETUP)
42 unsigned int orig_route_tab;
58 alphabook1_init_arch(
void)
87 unsigned int orig_route_tab;
92 printk(
"%s: PIRQ original 0x%x new 0x%x\n", __func__,
93 orig_route_tab, alpha_mv.sys.sio.route_tab);
95 #if defined(ALPHA_RESTORE_SRM_SETUP)
96 saved_config.orig_route_tab = orig_route_tab;
101 alpha_mv.sys.sio.route_tab);
104 static unsigned int __init
105 sio_collect_irq_levels(
void)
107 unsigned int level_bits = 0;
117 level_bits |= (1 << dev->
irq);
123 sio_fixup_irq_levels(
unsigned int level_bits)
125 unsigned int old_level_bits;
139 old_level_bits =
inb(0x4d0) | (
inb(0x4d1) << 8);
141 level_bits |= (old_level_bits & 0x71ff);
143 outb((level_bits >> 0) & 0xff, 0x4d0);
144 outb((level_bits >> 8) & 0xff, 0x4d1);
171 {-1, -1, -1, -1, -1},
173 {-1, -1, -1, -1, -1},
174 {-1, -1, -1, -1, -1},
180 const long min_idsel = 6, max_idsel = 14, irqs_per_slot = 5;
183 return irq >= 0 ? tmp : -1;
192 {-1, -1, -1, -1, -1},
195 {-1, -1, -1, -1, -1},
196 {-1, -1, -1, -1, -1},
199 const long min_idsel = 6, max_idsel = 12, irqs_per_slot = 5;
202 return irq >= 0 ? tmp : -1;
206 noname_init_pci(
void)
210 sio_fixup_irq_levels(sio_collect_irq_levels());
224 #if !defined(CONFIG_ALPHA_AVANTI)
235 alphabook1_init_pci(
void)
238 unsigned char orig,
config;
261 unsigned char ctest4;
264 ctest4 =
inb(io_port+0x21);
265 if (!(ctest4 & 0x80)) {
266 printk(
"AlphaBook1 NCR init: setting"
268 outb(ctest4 | 0x80, io_port+0x21);
274 sio_fixup_irq_levels(0);
277 outb(0x0f, 0x3ce); orig =
inb(0x3cf);
278 outb(0x0f, 0x3ce);
outb(0x05, 0x3cf);
279 outb(0x0b, 0x3ce); config =
inb(0x3cf);
280 if ((config & 0xc0) != 0xc0) {
281 printk(
"AlphaBook1 VGA init: setting 1Mb memory\n");
283 outb(0x0b, 0x3ce);
outb(config, 0x3cf);
285 outb(0x0f, 0x3ce);
outb(orig, 0x3cf);
291 #if defined(ALPHA_RESTORE_SRM_SETUP)
299 saved_config.orig_route_tab);
308 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_BOOK1)
309 struct alpha_machine_vector alphabook1_mv
__initmv = {
310 .vector_name =
"AlphaBook1",
322 .init_arch = alphabook1_init_arch,
323 .init_irq = sio_init_irq,
325 .init_pci = alphabook1_init_pci,
327 .pci_map_irq = noname_map_irq,
332 .route_tab = 0x0e0f0a0a,
338 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_AVANTI)
339 struct alpha_machine_vector avanti_mv __initmv = {
340 .vector_name =
"Avanti",
353 .init_irq = sio_init_irq,
355 .init_pci = noname_init_pci,
357 .pci_map_irq = noname_map_irq,
361 .route_tab = 0x0b0a050f,
367 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_NONAME)
368 struct alpha_machine_vector noname_mv __initmv = {
369 .vector_name =
"Noname",
382 .init_irq = sio_init_irq,
384 .init_pci = noname_init_pci,
386 .pci_map_irq = noname_map_irq,
399 .route_tab = 0x0b0a0f0d,
405 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_P2K)
406 struct alpha_machine_vector p2k_mv __initmv = {
407 .vector_name =
"Platform2000",
420 .init_irq = sio_init_irq,
422 .init_pci = noname_init_pci,
424 .pci_map_irq = p2k_map_irq,
428 .route_tab = 0x0b0a090f,
434 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_XL)
435 struct alpha_machine_vector xl_mv __initmv = {
449 .init_irq = sio_init_irq,
451 .init_pci = noname_init_pci,
453 .pci_map_irq = noname_map_irq,
457 .route_tab = 0x0b0a090f,