irq.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2000 RidgeRun, Inc.
  3. * Author: RidgeRun, Inc.
  4. * glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
  5. *
  6. * Copyright 2001 MontaVista Software Inc.
  7. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  8. * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org)
  9. *
  10. * Copyright 2004 PMC-Sierra
  11. * Author: Manish Lachwani (lachwani@pmc-sierra.com)
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU General Public License as published by the
  15. * Free Software Foundation; either version 2 of the License, or (at your
  16. * option) any later version.
  17. *
  18. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  19. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  20. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  21. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  24. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  25. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *
  29. * You should have received a copy of the GNU General Public License along
  30. * with this program; if not, write to the Free Software Foundation, Inc.,
  31. * 675 Mass Ave, Cambridge, MA 02139, USA.
  32. *
  33. * Copyright (C) 2004 MontaVista Software Inc.
  34. * Author: Manish Lachwani, mlachwani@mvista.com
  35. *
  36. */
  37. #include <linux/errno.h>
  38. #include <linux/init.h>
  39. #include <linux/kernel_stat.h>
  40. #include <linux/module.h>
  41. #include <linux/signal.h>
  42. #include <linux/sched.h>
  43. #include <linux/types.h>
  44. #include <linux/interrupt.h>
  45. #include <linux/ioport.h>
  46. #include <linux/timex.h>
  47. #include <linux/slab.h>
  48. #include <linux/random.h>
  49. #include <asm/bitops.h>
  50. #include <asm/bootinfo.h>
  51. #include <asm/io.h>
  52. #include <asm/irq.h>
  53. #include <asm/mipsregs.h>
  54. #include <asm/system.h>
  55. extern asmlinkage void ocelot3_handle_int(void);
  56. static struct irqaction cascade_mv64340 = {
  57. no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
  58. };
  59. void __init arch_init_irq(void)
  60. {
  61. /*
  62. * Clear all of the interrupts while we change the able around a bit.
  63. * int-handler is not on bootstrap
  64. */
  65. clear_c0_status(ST0_IM | ST0_BEV);
  66. /* Sets the first-level interrupt dispatcher. */
  67. set_except_vector(0, ocelot3_handle_int);
  68. mips_cpu_irq_init(0);
  69. rm7k_cpu_irq_init(8);
  70. /* set up the cascading interrupts */
  71. setup_irq(8, &cascade_mv64340); /* unmask intControl IM8, IRQ 9 */
  72. mv64340_irq_init(16);
  73. set_c0_status(ST0_IM); /* IE in the status register */
  74. }