setup.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Machine specific setup for generic
  3. */
  4. #include <linux/init.h>
  5. #include <linux/interrupt.h>
  6. #include <asm/arch_hooks.h>
  7. #include <asm/voyager.h>
  8. #include <asm/e820.h>
  9. #include <asm/io.h>
  10. #include <asm/setup.h>
  11. void __init pre_intr_init_hook(void)
  12. {
  13. init_ISA_irqs();
  14. }
  15. /*
  16. * IRQ2 is cascade interrupt to second interrupt controller
  17. */
  18. static struct irqaction irq2 = {
  19. .handler = no_action,
  20. .mask = CPU_MASK_NONE,
  21. .name = "cascade",
  22. };
  23. void __init intr_init_hook(void)
  24. {
  25. #ifdef CONFIG_SMP
  26. smp_intr_init();
  27. #endif
  28. setup_irq(2, &irq2);
  29. }
  30. void __init pre_setup_arch_hook(void)
  31. {
  32. /* Voyagers run their CPUs from independent clocks, so disable
  33. * the TSC code because we can't sync them */
  34. setup_clear_cpu_cap(X86_FEATURE_TSC);
  35. }
  36. void __init trap_init_hook(void)
  37. {
  38. }
  39. static struct irqaction irq0 = {
  40. .handler = timer_interrupt,
  41. .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
  42. .mask = CPU_MASK_NONE,
  43. .name = "timer"
  44. };
  45. void __init time_init_hook(void)
  46. {
  47. irq0.mask = cpumask_of_cpu(safe_smp_processor_id());
  48. setup_irq(0, &irq0);
  49. }
  50. /* Hook for machine specific memory setup. */
  51. char *__init machine_specific_memory_setup(void)
  52. {
  53. char *who;
  54. int new_nr;
  55. who = "NOT VOYAGER";
  56. if (voyager_level == 5) {
  57. __u32 addr, length;
  58. int i;
  59. who = "Voyager-SUS";
  60. e820.nr_map = 0;
  61. for (i = 0; voyager_memory_detect(i, &addr, &length); i++) {
  62. e820_add_region(addr, length, E820_RAM);
  63. }
  64. return who;
  65. } else if (voyager_level == 4) {
  66. __u32 tom;
  67. __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT) << 8;
  68. /* select the DINO config space */
  69. outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT);
  70. /* Read DINO top of memory register */
  71. tom = ((inb(catbase + 0x4) & 0xf0) << 16)
  72. + ((inb(catbase + 0x5) & 0x7f) << 24);
  73. if (inb(catbase) != VOYAGER_DINO) {
  74. printk(KERN_ERR
  75. "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n");
  76. tom = (boot_params.screen_info.ext_mem_k) << 10;
  77. }
  78. who = "Voyager-TOM";
  79. e820_add_region(0, 0x9f000, E820_RAM);
  80. /* map from 1M to top of memory */
  81. e820_add_region(1 * 1024 * 1024, tom - 1 * 1024 * 1024,
  82. E820_RAM);
  83. /* FIXME: Should check the ASICs to see if I need to
  84. * take out the 8M window. Just do it at the moment
  85. * */
  86. e820_add_region(8 * 1024 * 1024, 8 * 1024 * 1024,
  87. E820_RESERVED);
  88. return who;
  89. }
  90. return default_machine_specific_memory_setup();
  91. }