setup.c 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Renesas Technology SH7710 VoIP Gateway
  3. *
  4. * Copyright (C) 2006 Ranjit Deshpande
  5. * Kenati Technologies Inc.
  6. *
  7. * May be copied or modified under the terms of the GNU General Public
  8. * License. See linux/COPYING for more information.
  9. */
  10. #include <linux/init.h>
  11. #include <asm/machvec.h>
  12. #include <asm/irq.h>
  13. #include <asm/io.h>
  14. #include <asm/irq.h>
  15. static struct ipr_data sh7710voipgw_ipr_map[] = {
  16. { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY },
  17. { WDT_IRQ, WDT_IPR_ADDR, WDT_IPR_POS, WDT_PRIORITY },
  18. /* SCIF0 */
  19. { SCIF0_ERI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
  20. { SCIF0_RXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
  21. { SCIF0_BRI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
  22. { SCIF0_TXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
  23. /* DMAC-1 */
  24. { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
  25. { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
  26. { DMTE2_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
  27. { DMTE3_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
  28. /* DMAC-2 */
  29. { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
  30. { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
  31. /* IPSEC */
  32. { IPSEC_IRQ, IPSEC_IPR_ADDR, IPSEC_IPR_POS, IPSEC_PRIORITY },
  33. /* EDMAC */
  34. { EDMAC0_IRQ, EDMAC0_IPR_ADDR, EDMAC0_IPR_POS, EDMAC0_PRIORITY },
  35. { EDMAC1_IRQ, EDMAC1_IPR_ADDR, EDMAC1_IPR_POS, EDMAC1_PRIORITY },
  36. { EDMAC2_IRQ, EDMAC2_IPR_ADDR, EDMAC2_IPR_POS, EDMAC2_PRIORITY },
  37. /* SIOF0 */
  38. { SIOF0_ERI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
  39. { SIOF0_TXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
  40. { SIOF0_RXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
  41. { SIOF0_CCI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
  42. /* SIOF1 */
  43. { SIOF1_ERI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
  44. { SIOF1_TXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
  45. { SIOF1_RXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
  46. { SIOF1_CCI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
  47. /* SLIC IRQ's */
  48. { IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY },
  49. { IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY },
  50. };
  51. /*
  52. * Initialize IRQ setting
  53. */
  54. static void __init sh7710voipgw_init_irq(void)
  55. {
  56. /* Disable all interrupts in IPR registers */
  57. ctrl_outw(0x0, INTC_IPRA);
  58. ctrl_outw(0x0, INTC_IPRB);
  59. ctrl_outw(0x0, INTC_IPRC);
  60. ctrl_outw(0x0, INTC_IPRD);
  61. ctrl_outw(0x0, INTC_IPRE);
  62. ctrl_outw(0x0, INTC_IPRF);
  63. ctrl_outw(0x0, INTC_IPRG);
  64. ctrl_outw(0x0, INTC_IPRH);
  65. ctrl_outw(0x0, INTC_IPRI);
  66. /* Ack all interrupt sources in the IRR0 register */
  67. ctrl_outb(0x3f, INTC_IRR0);
  68. /* Use IRQ0 - IRQ3 as active low interrupt lines i.e. disable
  69. * IRL mode.
  70. */
  71. ctrl_outw(0x2aa, INTC_ICR1);
  72. make_ipr_irq(sh7710voipgw_ipr_map, ARRAY_SIZE(sh7710voipgw_ipr_map));
  73. }
  74. /*
  75. * The Machine Vector
  76. */
  77. static struct sh_machine_vector mv_sh7710voipgw __initmv = {
  78. .mv_name = "SH7710 VoIP Gateway",
  79. .mv_nr_irqs = 104,
  80. .mv_init_irq = sh7710voipgw_init_irq,
  81. };