irq-r7780mp.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Renesas Solutions Highlander R7780MP Support.
  3. *
  4. * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
  5. * Copyright (C) 2006 Paul Mundt
  6. * Copyright (C) 2007 Magnus Damm
  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/io.h>
  15. #include <mach/highlander.h>
  16. enum {
  17. UNUSED = 0,
  18. /* board specific interrupt sources */
  19. CF, /* Compact Flash */
  20. TP, /* Touch panel */
  21. SCIF1, /* FPGA SCIF1 */
  22. SCIF0, /* FPGA SCIF0 */
  23. SMBUS, /* SMBUS */
  24. RTC, /* RTC Alarm */
  25. AX88796, /* Ethernet controller */
  26. PSW, /* Push Switch */
  27. /* external bus connector */
  28. EXT1, EXT2, EXT4, EXT5, EXT6,
  29. };
  30. static struct intc_vect vectors[] __initdata = {
  31. INTC_IRQ(CF, IRQ_CF),
  32. INTC_IRQ(TP, IRQ_TP),
  33. INTC_IRQ(SCIF1, IRQ_SCIF1),
  34. INTC_IRQ(SCIF0, IRQ_SCIF0),
  35. INTC_IRQ(SMBUS, IRQ_SMBUS),
  36. INTC_IRQ(RTC, IRQ_RTC),
  37. INTC_IRQ(AX88796, IRQ_AX88796),
  38. INTC_IRQ(PSW, IRQ_PSW),
  39. INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
  40. INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
  41. INTC_IRQ(EXT6, IRQ_EXT6),
  42. };
  43. static struct intc_mask_reg mask_registers[] __initdata = {
  44. { 0xa4000000, 0, 16, /* IRLMSK */
  45. { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
  46. 0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
  47. };
  48. static unsigned char irl2irq[HL_NR_IRL] __initdata = {
  49. 0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
  50. IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
  51. IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
  52. 0, IRQ_AX88796, IRQ_PSW,
  53. };
  54. static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
  55. NULL, mask_registers, NULL, NULL);
  56. unsigned char * __init highlander_plat_irq_setup(void)
  57. {
  58. if ((__raw_readw(0xa4000700) & 0xf000) == 0x2000) {
  59. printk(KERN_INFO "Using r7780mp interrupt controller.\n");
  60. register_intc_controller(&intc_desc);
  61. return irl2irq;
  62. }
  63. return NULL;
  64. }