setup.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * Machine specific setup for generic
  3. */
  4. #include <linux/smp.h>
  5. #include <linux/init.h>
  6. #include <linux/interrupt.h>
  7. #include <asm/acpi.h>
  8. #include <asm/arch_hooks.h>
  9. #include <asm/e820.h>
  10. #include <asm/setup.h>
  11. #include <mach_ipi.h>
  12. #ifdef CONFIG_HOTPLUG_CPU
  13. #define DEFAULT_SEND_IPI (1)
  14. #else
  15. #define DEFAULT_SEND_IPI (0)
  16. #endif
  17. int no_broadcast = DEFAULT_SEND_IPI;
  18. /**
  19. * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
  20. *
  21. * Description:
  22. * Perform any necessary interrupt initialisation prior to setting up
  23. * the "ordinary" interrupt call gates. For legacy reasons, the ISA
  24. * interrupts should be initialised here if the machine emulates a PC
  25. * in any way.
  26. **/
  27. void __init pre_intr_init_hook(void)
  28. {
  29. if (x86_quirks->arch_pre_intr_init) {
  30. if (x86_quirks->arch_pre_intr_init())
  31. return;
  32. }
  33. init_ISA_irqs();
  34. }
  35. /*
  36. * IRQ2 is cascade interrupt to second interrupt controller
  37. */
  38. static struct irqaction irq2 = {
  39. .handler = no_action,
  40. .mask = CPU_MASK_NONE,
  41. .name = "cascade",
  42. };
  43. /**
  44. * intr_init_hook - post gate setup interrupt initialisation
  45. *
  46. * Description:
  47. * Fill in any interrupts that may have been left out by the general
  48. * init_IRQ() routine. interrupts having to do with the machine rather
  49. * than the devices on the I/O bus (like APIC interrupts in intel MP
  50. * systems) are started here.
  51. **/
  52. void __init intr_init_hook(void)
  53. {
  54. if (x86_quirks->arch_intr_init) {
  55. if (x86_quirks->arch_intr_init())
  56. return;
  57. }
  58. #ifdef CONFIG_X86_LOCAL_APIC
  59. apic_intr_init();
  60. #endif
  61. if (!acpi_ioapic)
  62. setup_irq(2, &irq2);
  63. }
  64. /**
  65. * pre_setup_arch_hook - hook called prior to any setup_arch() execution
  66. *
  67. * Description:
  68. * generally used to activate any machine specific identification
  69. * routines that may be needed before setup_arch() runs. On Voyager
  70. * this is used to get the board revision and type.
  71. **/
  72. void __init pre_setup_arch_hook(void)
  73. {
  74. }
  75. /**
  76. * trap_init_hook - initialise system specific traps
  77. *
  78. * Description:
  79. * Called as the final act of trap_init(). Used in VISWS to initialise
  80. * the various board specific APIC traps.
  81. **/
  82. void __init trap_init_hook(void)
  83. {
  84. if (x86_quirks->arch_trap_init) {
  85. if (x86_quirks->arch_trap_init())
  86. return;
  87. }
  88. }
  89. static struct irqaction irq0 = {
  90. .handler = timer_interrupt,
  91. .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
  92. .mask = CPU_MASK_NONE,
  93. .name = "timer"
  94. };
  95. /**
  96. * pre_time_init_hook - do any specific initialisations before.
  97. *
  98. **/
  99. void __init pre_time_init_hook(void)
  100. {
  101. if (x86_quirks->arch_pre_time_init)
  102. x86_quirks->arch_pre_time_init();
  103. }
  104. /**
  105. * time_init_hook - do any specific initialisations for the system timer.
  106. *
  107. * Description:
  108. * Must plug the system timer interrupt source at HZ into the IRQ listed
  109. * in irq_vectors.h:TIMER_IRQ
  110. **/
  111. void __init time_init_hook(void)
  112. {
  113. if (x86_quirks->arch_time_init) {
  114. /*
  115. * A nonzero return code does not mean failure, it means
  116. * that the architecture quirk does not want any
  117. * generic (timer) setup to be performed after this:
  118. */
  119. if (x86_quirks->arch_time_init())
  120. return;
  121. }
  122. irq0.mask = cpumask_of_cpu(0);
  123. setup_irq(0, &irq0);
  124. }
  125. #ifdef CONFIG_MCA
  126. /**
  127. * mca_nmi_hook - hook into MCA specific NMI chain
  128. *
  129. * Description:
  130. * The MCA (Microchannel Architecture) has an NMI chain for NMI sources
  131. * along the MCA bus. Use this to hook into that chain if you will need
  132. * it.
  133. **/
  134. void mca_nmi_hook(void)
  135. {
  136. /* If I recall correctly, there's a whole bunch of other things that
  137. * we can do to check for NMI problems, but that's all I know about
  138. * at the moment.
  139. */
  140. printk("NMI generated from unknown source!\n");
  141. }
  142. #endif
  143. static __init int no_ipi_broadcast(char *str)
  144. {
  145. get_option(&str, &no_broadcast);
  146. printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
  147. "IPI Broadcast");
  148. return 1;
  149. }
  150. __setup("no_ipi_broadcast=", no_ipi_broadcast);
  151. static int __init print_ipi_mode(void)
  152. {
  153. printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" :
  154. "Shortcut");
  155. return 0;
  156. }
  157. late_initcall(print_ipi_mode);