setup.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * Machine specific setup for generic
  3. */
  4. #include <linux/config.h>
  5. #include <linux/smp.h>
  6. #include <linux/init.h>
  7. #include <linux/interrupt.h>
  8. #include <asm/acpi.h>
  9. #include <asm/arch_hooks.h>
  10. #ifdef CONFIG_HOTPLUG_CPU
  11. #define DEFAULT_SEND_IPI (1)
  12. #else
  13. #define DEFAULT_SEND_IPI (0)
  14. #endif
  15. int no_broadcast=DEFAULT_SEND_IPI;
  16. /**
  17. * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
  18. *
  19. * Description:
  20. * Perform any necessary interrupt initialisation prior to setting up
  21. * the "ordinary" interrupt call gates. For legacy reasons, the ISA
  22. * interrupts should be initialised here if the machine emulates a PC
  23. * in any way.
  24. **/
  25. void __init pre_intr_init_hook(void)
  26. {
  27. init_ISA_irqs();
  28. }
  29. /*
  30. * IRQ2 is cascade interrupt to second interrupt controller
  31. */
  32. static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
  33. /**
  34. * intr_init_hook - post gate setup interrupt initialisation
  35. *
  36. * Description:
  37. * Fill in any interrupts that may have been left out by the general
  38. * init_IRQ() routine. interrupts having to do with the machine rather
  39. * than the devices on the I/O bus (like APIC interrupts in intel MP
  40. * systems) are started here.
  41. **/
  42. void __init intr_init_hook(void)
  43. {
  44. #ifdef CONFIG_X86_LOCAL_APIC
  45. apic_intr_init();
  46. #endif
  47. if (!acpi_ioapic)
  48. setup_irq(2, &irq2);
  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 VISWS
  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. }
  71. static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
  72. /**
  73. * time_init_hook - do any specific initialisations for the system timer.
  74. *
  75. * Description:
  76. * Must plug the system timer interrupt source at HZ into the IRQ listed
  77. * in irq_vectors.h:TIMER_IRQ
  78. **/
  79. void __init time_init_hook(void)
  80. {
  81. setup_irq(0, &irq0);
  82. }
  83. #ifdef CONFIG_MCA
  84. /**
  85. * mca_nmi_hook - hook into MCA specific NMI chain
  86. *
  87. * Description:
  88. * The MCA (Microchannel Arcitecture) has an NMI chain for NMI sources
  89. * along the MCA bus. Use this to hook into that chain if you will need
  90. * it.
  91. **/
  92. void __init mca_nmi_hook(void)
  93. {
  94. /* If I recall correctly, there's a whole bunch of other things that
  95. * we can do to check for NMI problems, but that's all I know about
  96. * at the moment.
  97. */
  98. printk("NMI generated from unknown source!\n");
  99. }
  100. #endif
  101. static __init int no_ipi_broadcast(char *str)
  102. {
  103. get_option(&str, &no_broadcast);
  104. printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
  105. "IPI Broadcast");
  106. return 1;
  107. }
  108. __setup("no_ipi_broadcast", no_ipi_broadcast);
  109. static int __init print_ipi_mode(void)
  110. {
  111. printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" :
  112. "Shortcut");
  113. return 0;
  114. }
  115. late_initcall(print_ipi_mode);