irq.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * linux/arch/sh/boards/se/770x/irq.c
  3. *
  4. * Copyright (C) 2000 Kazumoto Kojima
  5. *
  6. * Hitachi SolutionEngine Support.
  7. *
  8. */
  9. #include <linux/init.h>
  10. #include <linux/irq.h>
  11. #include <asm/irq.h>
  12. #include <asm/io.h>
  13. #include <asm/se.h>
  14. static struct ipr_data se770x_ipr_map[] = {
  15. #if defined(CONFIG_CPU_SUBTYPE_SH7705)
  16. /* This is default value */
  17. { 0xf-0x2, BCR_ILCRA, 2, 0x2 },
  18. { 0xf-0xa, BCR_ILCRA, 1, 0xa },
  19. { 0xf-0x5, BCR_ILCRB, 0, 0x5 },
  20. { 0xf-0x8, BCR_ILCRC, 1, 0x8 },
  21. { 0xf-0xc, BCR_ILCRC, 0, 0xc },
  22. { 0xf-0xe, BCR_ILCRD, 3, 0xe },
  23. { 0xf-0x3, BCR_ILCRD, 1, 0x3 }, /* LAN */
  24. { 0xf-0xd, BCR_ILCRE, 2, 0xd },
  25. { 0xf-0x9, BCR_ILCRE, 1, 0x9 },
  26. { 0xf-0x1, BCR_ILCRE, 0, 0x1 },
  27. { 0xf-0xf, BCR_ILCRF, 3, 0xf },
  28. { 0xf-0xb, BCR_ILCRF, 1, 0xb },
  29. { 0xf-0x7, BCR_ILCRG, 3, 0x7 },
  30. { 0xf-0x6, BCR_ILCRG, 2, 0x6 },
  31. { 0xf-0x4, BCR_ILCRG, 1, 0x4 },
  32. #else
  33. { 14, BCR_ILCRA, 2, 0x0f-14 },
  34. { 12, BCR_ILCRA, 1, 0x0f-12 },
  35. { 8, BCR_ILCRB, 1, 0x0f- 8 },
  36. { 6, BCR_ILCRC, 3, 0x0f- 6 },
  37. { 5, BCR_ILCRC, 2, 0x0f- 5 },
  38. { 4, BCR_ILCRC, 1, 0x0f- 4 },
  39. { 3, BCR_ILCRC, 0, 0x0f- 3 },
  40. { 1, BCR_ILCRD, 3, 0x0f- 1 },
  41. { 10, BCR_ILCRD, 1, 0x0f-10 }, /* LAN */
  42. { 0, BCR_ILCRE, 3, 0x0f- 0 }, /* PCIRQ3 */
  43. { 11, BCR_ILCRE, 2, 0x0f-11 }, /* PCIRQ2 */
  44. { 9, BCR_ILCRE, 1, 0x0f- 9 }, /* PCIRQ1 */
  45. { 7, BCR_ILCRE, 0, 0x0f- 7 }, /* PCIRQ0 */
  46. /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
  47. /* NOTE: #2 and #13 are not used on PC */
  48. { 13, BCR_ILCRG, 1, 0x0f-13 }, /* SLOTIRQ2 */
  49. { 2, BCR_ILCRG, 0, 0x0f- 2 }, /* SLOTIRQ1 */
  50. #endif
  51. };
  52. /*
  53. * Initialize IRQ setting
  54. */
  55. void __init init_se_IRQ(void)
  56. {
  57. /*
  58. * Super I/O (Just mimic PC):
  59. * 1: keyboard
  60. * 3: serial 0
  61. * 4: serial 1
  62. * 5: printer
  63. * 6: floppy
  64. * 8: rtc
  65. * 12: mouse
  66. * 14: ide0
  67. */
  68. #if defined(CONFIG_CPU_SUBTYPE_SH7705)
  69. /* Disable all interrupts */
  70. ctrl_outw(0, BCR_ILCRA);
  71. ctrl_outw(0, BCR_ILCRB);
  72. ctrl_outw(0, BCR_ILCRC);
  73. ctrl_outw(0, BCR_ILCRD);
  74. ctrl_outw(0, BCR_ILCRE);
  75. ctrl_outw(0, BCR_ILCRF);
  76. ctrl_outw(0, BCR_ILCRG);
  77. #endif
  78. make_ipr_irq(se770x_ipr_map, ARRAY_SIZE(se770x_ipr_map));
  79. }