irq-r7780mp.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 <asm/r7780rp.h>
  16. enum {
  17. UNUSED = 0,
  18. /* board specific interrupt sources */
  19. AX88796, /* Ethernet controller */
  20. CF, /* Compact Flash */
  21. PSW, /* Push Switch */
  22. EXT1, /* EXT1n IRQ */
  23. EXT4, /* EXT4n IRQ */
  24. };
  25. static struct intc_vect vectors[] __initdata = {
  26. INTC_IRQ(CF, IRQ_CF),
  27. INTC_IRQ(PSW, IRQ_PSW),
  28. INTC_IRQ(AX88796, IRQ_AX88796),
  29. INTC_IRQ(EXT1, IRQ_EXT1),
  30. INTC_IRQ(EXT4, IRQ_EXT4),
  31. };
  32. static struct intc_mask_reg mask_registers[] __initdata = {
  33. { 0xa4000000, 0, 16, /* IRLMSK */
  34. { 0, 0, 0, 0, CF, 0, 0, 0,
  35. 0, 0, 0, EXT4, 0, EXT1, PSW, AX88796 } },
  36. };
  37. static unsigned char irl2irq[HL_NR_IRL] __initdata = {
  38. 0, IRQ_CF, 0, 0,
  39. 0, 0, 0, 0,
  40. 0, IRQ_EXT4, 0, IRQ_EXT1,
  41. 0, IRQ_AX88796, IRQ_PSW,
  42. };
  43. static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
  44. NULL, NULL, mask_registers, NULL, NULL);
  45. unsigned char * __init highlander_init_irq_r7780mp(void)
  46. {
  47. if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) {
  48. printk(KERN_INFO "Using r7780mp interrupt controller.\n");
  49. register_intc_controller(&intc_desc);
  50. return irl2irq;
  51. }
  52. return NULL;
  53. }