setup.c 3.7 KB

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