powerpc: Fix data-corrupting bug in __futex_atomic_op
[linux/fpc-iii.git] / arch / x86 / mach-voyager / setup.c
blob6bbdd633864cc34f8ded68bc37d9bdde0d7e8a1f
1 /*
2 * Machine specific setup for generic
3 */
5 #include <linux/init.h>
6 #include <linux/interrupt.h>
7 #include <asm/arch_hooks.h>
8 #include <asm/voyager.h>
9 #include <asm/e820.h>
10 #include <asm/io.h>
11 #include <asm/setup.h>
13 void __init pre_intr_init_hook(void)
15 init_ISA_irqs();
19 * IRQ2 is cascade interrupt to second interrupt controller
21 static struct irqaction irq2 = {
22 .handler = no_action,
23 .mask = CPU_MASK_NONE,
24 .name = "cascade",
27 void __init intr_init_hook(void)
29 #ifdef CONFIG_SMP
30 smp_intr_init();
31 #endif
33 setup_irq(2, &irq2);
36 void __init pre_setup_arch_hook(void)
38 /* Voyagers run their CPUs from independent clocks, so disable
39 * the TSC code because we can't sync them */
40 setup_clear_cpu_cap(X86_FEATURE_TSC);
43 void __init trap_init_hook(void)
47 static struct irqaction irq0 = {
48 .handler = timer_interrupt,
49 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
50 .mask = CPU_MASK_NONE,
51 .name = "timer"
54 void __init time_init_hook(void)
56 irq0.mask = cpumask_of_cpu(safe_smp_processor_id());
57 setup_irq(0, &irq0);
60 /* Hook for machine specific memory setup. */
62 char *__init machine_specific_memory_setup(void)
64 char *who;
65 int new_nr;
67 who = "NOT VOYAGER";
69 if (voyager_level == 5) {
70 __u32 addr, length;
71 int i;
73 who = "Voyager-SUS";
75 e820.nr_map = 0;
76 for (i = 0; voyager_memory_detect(i, &addr, &length); i++) {
77 e820_add_region(addr, length, E820_RAM);
79 return who;
80 } else if (voyager_level == 4) {
81 __u32 tom;
82 __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT) << 8;
83 /* select the DINO config space */
84 outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT);
85 /* Read DINO top of memory register */
86 tom = ((inb(catbase + 0x4) & 0xf0) << 16)
87 + ((inb(catbase + 0x5) & 0x7f) << 24);
89 if (inb(catbase) != VOYAGER_DINO) {
90 printk(KERN_ERR
91 "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n");
92 tom = (boot_params.screen_info.ext_mem_k) << 10;
94 who = "Voyager-TOM";
95 e820_add_region(0, 0x9f000, E820_RAM);
96 /* map from 1M to top of memory */
97 e820_add_region(1 * 1024 * 1024, tom - 1 * 1024 * 1024,
98 E820_RAM);
99 /* FIXME: Should check the ASICs to see if I need to
100 * take out the 8M window. Just do it at the moment
101 * */
102 e820_add_region(8 * 1024 * 1024, 8 * 1024 * 1024,
103 E820_RESERVED);
104 return who;
107 return default_machine_specific_memory_setup();