irq.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * linux/arch/sh/boards/se/770x/irq.c
  3. *
  4. * Copyright (C) 2000 Kazumoto Kojima
  5. * Copyright (C) 2006 Nobuhiro Iwamatsu
  6. *
  7. * Hitachi SolutionEngine Support.
  8. *
  9. */
  10. #include <linux/init.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/irq.h>
  13. #include <asm/irq.h>
  14. #include <asm/io.h>
  15. #include <mach-se/mach/se.h>
  16. static struct ipr_data ipr_irq_table[] = {
  17. /*
  18. * Super I/O (Just mimic PC):
  19. * 1: keyboard
  20. * 3: serial 0
  21. * 4: serial 1
  22. * 5: printer
  23. * 6: floppy
  24. * 8: rtc
  25. * 12: mouse
  26. * 14: ide0
  27. */
  28. #if defined(CONFIG_CPU_SUBTYPE_SH7705)
  29. /* This is default value */
  30. { 13, 0, 8, 0x0f-13, },
  31. { 5 , 0, 4, 0x0f- 5, },
  32. { 10, 1, 0, 0x0f-10, },
  33. { 7 , 2, 4, 0x0f- 7, },
  34. { 3 , 2, 0, 0x0f- 3, },
  35. { 1 , 3, 12, 0x0f- 1, },
  36. { 12, 3, 4, 0x0f-12, }, /* LAN */
  37. { 2 , 4, 8, 0x0f- 2, }, /* PCIRQ2 */
  38. { 6 , 4, 4, 0x0f- 6, }, /* PCIRQ1 */
  39. { 14, 4, 0, 0x0f-14, }, /* PCIRQ0 */
  40. { 0 , 5, 12, 0x0f , },
  41. { 4 , 5, 4, 0x0f- 4, },
  42. { 8 , 6, 12, 0x0f- 8, },
  43. { 9 , 6, 8, 0x0f- 9, },
  44. { 11, 6, 4, 0x0f-11, },
  45. #else
  46. { 14, 0, 8, 0x0f-14, },
  47. { 12, 0, 4, 0x0f-12, },
  48. { 8, 1, 4, 0x0f- 8, },
  49. { 6, 2, 12, 0x0f- 6, },
  50. { 5, 2, 8, 0x0f- 5, },
  51. { 4, 2, 4, 0x0f- 4, },
  52. { 3, 2, 0, 0x0f- 3, },
  53. { 1, 3, 12, 0x0f- 1, },
  54. #if defined(CONFIG_STNIC)
  55. /* ST NIC */
  56. { 10, 3, 4, 0x0f-10, }, /* LAN */
  57. #endif
  58. /* MRSHPC IRQs setting */
  59. { 0, 4, 12, 0x0f- 0, }, /* PCIRQ3 */
  60. { 11, 4, 8, 0x0f-11, }, /* PCIRQ2 */
  61. { 9, 4, 4, 0x0f- 9, }, /* PCIRQ1 */
  62. { 7, 4, 0, 0x0f- 7, }, /* PCIRQ0 */
  63. /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
  64. /* NOTE: #2 and #13 are not used on PC */
  65. { 13, 6, 4, 0x0f-13, }, /* SLOTIRQ2 */
  66. { 2, 6, 0, 0x0f- 2, }, /* SLOTIRQ1 */
  67. #endif
  68. };
  69. static unsigned long ipr_offsets[] = {
  70. BCR_ILCRA,
  71. BCR_ILCRB,
  72. BCR_ILCRC,
  73. BCR_ILCRD,
  74. BCR_ILCRE,
  75. BCR_ILCRF,
  76. BCR_ILCRG,
  77. };
  78. static struct ipr_desc ipr_irq_desc = {
  79. .ipr_offsets = ipr_offsets,
  80. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  81. .ipr_data = ipr_irq_table,
  82. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  83. .chip = {
  84. .name = "IPR-se770x",
  85. },
  86. };
  87. /*
  88. * Initialize IRQ setting
  89. */
  90. void __init init_se_IRQ(void)
  91. {
  92. /* Disable all interrupts */
  93. __raw_writew(0, BCR_ILCRA);
  94. __raw_writew(0, BCR_ILCRB);
  95. __raw_writew(0, BCR_ILCRC);
  96. __raw_writew(0, BCR_ILCRD);
  97. __raw_writew(0, BCR_ILCRE);
  98. __raw_writew(0, BCR_ILCRF);
  99. __raw_writew(0, BCR_ILCRG);
  100. register_ipr_controller(&ipr_irq_desc);
  101. }