irq.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * linux/arch/sh/boards/se/7780/irq.c
  3. *
  4. * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
  5. *
  6. * Hitachi UL SolutionEngine 7780 Support.
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/irq.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/irq.h>
  16. #include <linux/io.h>
  17. #include <mach-se/mach/se7780.h>
  18. #define INTC_BASE 0xffd00000
  19. #define INTC_ICR1 (INTC_BASE+0x1c)
  20. /*
  21. * Initialize IRQ setting
  22. */
  23. void __init init_se7780_IRQ(void)
  24. {
  25. /* enable all interrupt at FPGA */
  26. ctrl_outw(0, FPGA_INTMSK1);
  27. /* mask SM501 interrupt */
  28. ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
  29. /* enable all interrupt at FPGA */
  30. ctrl_outw(0, FPGA_INTMSK2);
  31. /* set FPGA INTSEL register */
  32. /* FPGA + 0x06 */
  33. ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
  34. (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
  35. /* FPGA + 0x08 */
  36. ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
  37. (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
  38. (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
  39. (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
  40. /* FPGA + 0x0A */
  41. ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
  42. plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
  43. /* ICR1: detect low level(for 2ndcut) */
  44. ctrl_outl(0xAAAA0000, INTC_ICR1);
  45. /*
  46. * FPGA PCISEL register initialize
  47. *
  48. * CPU || SLOT1 | SLOT2 | S-ATA | USB
  49. * -------------------------------------
  50. * INTA || INTA | INTD | -- | INTB
  51. * -------------------------------------
  52. * INTB || INTB | INTA | -- | INTC
  53. * -------------------------------------
  54. * INTC || INTC | INTB | INTA | --
  55. * -------------------------------------
  56. * INTD || INTD | INTC | -- | INTA
  57. * -------------------------------------
  58. */
  59. ctrl_outw(0x0013, FPGA_PCI_INTSEL1);
  60. ctrl_outw(0xE402, FPGA_PCI_INTSEL2);
  61. }