21 #include <linux/module.h>
28 #include <asm/fixmap.h>
29 #include <asm/reboot.h>
30 #include <asm/setup.h>
38 #include <asm/i8259.h>
39 #include <asm/irq_vectors.h>
42 #include <linux/sched.h>
43 #include <linux/kernel.h>
44 #include <linux/pci.h>
52 static void __init visws_time_init(
void)
69 static void __init visws_pre_intr_init(
void);
73 #define MB (1024 * 1024)
82 static char *
__init visws_memory_setup(
void)
84 long long gfx_mem_size = 8 *
MB;
116 static void visws_machine_emergency_restart(
void)
125 static void visws_machine_power_off(
void)
137 #define PCI_CONF1_ADDRESS(bus, devfn, reg) \
138 (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
144 static void __init visws_get_smp_config(
unsigned int early)
156 int ver, logical_apicid;
162 logical_apicid = m->
apicid;
172 if ((ver >= 0x14 && m->
apicid >= 0xff) || m->
apicid >= 0xf) {
185 "fixing up to 0x10. (tell your hw vendor)\n",
192 static void __init visws_find_smp_config(
void)
207 #ifdef CONFIG_X86_LOCAL_APIC
211 MP_processor_info(mp++);
216 static void visws_trap_init(
void);
231 x86_init.resources.memory_setup = visws_memory_setup;
232 x86_init.mpparse.get_smp_config = visws_get_smp_config;
233 x86_init.mpparse.find_smp_config = visws_find_smp_config;
234 x86_init.irqs.pre_vector_init = visws_pre_intr_init;
235 x86_init.irqs.trap_init = visws_trap_init;
236 x86_init.timers.timer_init = visws_time_init;
251 #ifdef CONFIG_X86_IO_APIC
311 }
else if (raw < 0
xc) {
322 printk(
KERN_INFO "Silicon Graphics Visual Workstation %s (rev %d) detected\n",
328 #define A01234 (LI_INTA_0 | LI_INTA_1 | LI_INTA_2 | LI_INTA_3 | LI_INTA_4)
329 #define BCD (LI_INTB | LI_INTC | LI_INTD)
330 #define ALLDEVS (A01234 | BCD)
332 static __init void lithium_init(
void)
353 static __init void cobalt_init(
void)
363 (
unsigned int)apic_read(
APIC_ID));
377 static void __init visws_trap_init(
void)
393 static inline void co_apic_set(
int entry,
int irq)
402 static inline int co_apic_ide0_hack(
void)
407 if (visws_board_type ==
VISWS_320 && visws_board_rev == 5)
412 static int is_co_apic(
unsigned int irq)
431 co_apic_set(is_co_apic(data->
irq), data->
irq);
434 static void disable_cobalt_irq(
struct irq_data *data)
436 int entry = is_co_apic(data->
irq);
442 static void ack_cobalt_irq(
struct irq_data *data)
447 disable_cobalt_irq(data);
449 spin_unlock_irqrestore(&cobalt_lock, flags);
452 static struct irq_chip cobalt_irq_type = {
453 .name =
"Cobalt-APIC",
454 .irq_enable = enable_cobalt_irq,
455 .irq_disable = disable_cobalt_irq,
456 .irq_ack = ack_cobalt_irq,
470 static unsigned int startup_piix4_master_irq(
struct irq_data *data)
473 enable_cobalt_irq(data);
477 static struct irq_chip piix4_master_irq_type = {
478 .name =
"PIIX4-master",
479 .irq_startup = startup_piix4_master_irq,
480 .irq_ack = ack_cobalt_irq,
483 static void pii4_mask(
struct irq_data *data) { }
485 static struct irq_chip piix4_virtual_irq_type = {
486 .name =
"PIIX4-virtual",
487 .irq_mask = pii4_mask,
531 realirq = (realirq & 7) + 8;
539 outb(0x60 + (realirq & 7), 0xa0);
540 outb(0x60 + 2, 0x20);
544 outb(0x60 + realirq, 0x20);
561 static struct irqaction master_action = {
562 .handler = piix4_master_intr,
563 .name =
"PIIX4-8259",
567 static struct irqaction cascade_action = {
573 static inline void set_piix4_virtual_irq_type(
void)
580 static void __init visws_pre_intr_init(
void)
584 set_piix4_virtual_irq_type();
590 chip = &cobalt_irq_type;
592 chip = &cobalt_irq_type;
594 chip = &cobalt_irq_type;
596 chip = &piix4_master_irq_type;
598 chip = &piix4_virtual_irq_type;
600 chip = &cobalt_irq_type;