irq-r7780rp.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Renesas Solutions Highlander R7780RP-1 Support.
  4. *
  5. * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
  6. * Copyright (C) 2006 Paul Mundt
  7. * Copyright (C) 2008 Magnus Damm
  8. */
  9. #include <linux/init.h>
  10. #include <linux/irq.h>
  11. #include <linux/io.h>
  12. #include <mach/highlander.h>
  13. enum {
  14. UNUSED = 0,
  15. /* board specific interrupt sources */
  16. AX88796, /* Ethernet controller */
  17. PSW, /* Push Switch */
  18. CF, /* Compact Flash */
  19. PCI_A,
  20. PCI_B,
  21. PCI_C,
  22. PCI_D,
  23. };
  24. static struct intc_vect vectors[] __initdata = {
  25. INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */
  26. INTC_IRQ(PCI_B, 66),
  27. INTC_IRQ(PCI_C, 67),
  28. INTC_IRQ(PCI_D, 68),
  29. INTC_IRQ(CF, IRQ_CF),
  30. INTC_IRQ(PSW, IRQ_PSW),
  31. INTC_IRQ(AX88796, IRQ_AX88796),
  32. };
  33. static struct intc_mask_reg mask_registers[] __initdata = {
  34. { 0xa5000000, 0, 16, /* IRLMSK */
  35. { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0,
  36. 0, 0, 0, 0, 0, 0, PSW, AX88796 } },
  37. };
  38. static unsigned char irl2irq[HL_NR_IRL] __initdata = {
  39. 65, 66, 67, 68,
  40. IRQ_CF, 0, 0, 0,
  41. 0, 0, 0, 0,
  42. IRQ_AX88796, IRQ_PSW
  43. };
  44. static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
  45. NULL, mask_registers, NULL, NULL);
  46. unsigned char * __init highlander_plat_irq_setup(void)
  47. {
  48. if (__raw_readw(0xa5000600)) {
  49. printk(KERN_INFO "Using r7780rp interrupt controller.\n");
  50. register_intc_controller(&intc_desc);
  51. return irl2irq;
  52. }
  53. return NULL;
  54. }