interrupts.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * (C) Copyright 2003 Josef Baumgartner <josef.baumgartner@telex.de>
  3. *
  4. * (C) Copyright 2000-2004
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <watchdog.h>
  27. #include <asm/processor.h>
  28. #include <asm/immap.h>
  29. #ifdef CONFIG_M5272
  30. int interrupt_init(void)
  31. {
  32. volatile intctrl_t *intp = (intctrl_t *) (MMAP_INTC);
  33. /* disable all external interrupts */
  34. intp->int_icr1 = 0x88888888;
  35. intp->int_icr2 = 0x88888888;
  36. intp->int_icr3 = 0x88888888;
  37. intp->int_icr4 = 0x88888888;
  38. intp->int_pitr = 0x00000000;
  39. /* initialize vector register */
  40. intp->int_pivr = 0x40;
  41. enable_interrupts();
  42. return 0;
  43. }
  44. #if defined(CONFIG_MCFTMR)
  45. void dtimer_intr_setup(void)
  46. {
  47. volatile intctrl_t *intp = (intctrl_t *) (CFG_INTR_BASE);
  48. intp->int_icr1 &= ~INT_ICR1_TMR3MASK;
  49. intp->int_icr1 |= CFG_TMRINTR_PRI;
  50. }
  51. #endif /* CONFIG_MCFTMR */
  52. #endif /* CONFIG_M5272 */
  53. #if defined(CONFIG_M5282) || defined(CONFIG_M5271)
  54. int interrupt_init(void)
  55. {
  56. volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE);
  57. /* Make sure all interrupts are disabled */
  58. intp->imrl0 |= 0x1;
  59. enable_interrupts();
  60. return 0;
  61. }
  62. #if defined(CONFIG_MCFTMR)
  63. void dtimer_intr_setup(void)
  64. {
  65. volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE);
  66. intp->icr0[CFG_TMRINTR_NO] = CFG_TMRINTR_PRI;
  67. intp->imrl0 &= ~0xFFFFFFFE;
  68. intp->imrl0 &= ~CFG_TMRINTR_MASK;
  69. }
  70. #endif /* CONFIG_MCFTMR */
  71. #endif /* CONFIG_M5282 | CONFIG_M5271 */
  72. #ifdef CONFIG_M5249
  73. int interrupt_init(void)
  74. {
  75. enable_interrupts();
  76. return 0;
  77. }
  78. #if defined(CONFIG_MCFTMR)
  79. void dtimer_intr_setup(void)
  80. {
  81. mbar_writeLong(MCFSIM_IMR, mbar_readLong(MCFSIM_IMR) & ~0x00000400);
  82. mbar_writeByte(MCFSIM_TIMER2ICR,
  83. MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 |
  84. MCFSIM_ICR_PRI3);
  85. }
  86. #endif /* CONFIG_MCFTMR */
  87. #endif /* CONFIG_M5249 */