interrupts.c 834 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. *
  3. * (C) Copyright 2000-2004
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. *
  6. * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
  7. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. /* CPU specific interrupt routine */
  12. #include <common.h>
  13. #include <asm/immap.h>
  14. #include <asm/io.h>
  15. int interrupt_init(void)
  16. {
  17. int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
  18. /* Make sure all interrupts are disabled */
  19. setbits_be32(&intp->imrh0, 0xffffffff);
  20. setbits_be32(&intp->imrl0, 0xffffffff);
  21. enable_interrupts();
  22. return 0;
  23. }
  24. #if defined(CONFIG_MCFTMR)
  25. void dtimer_intr_setup(void)
  26. {
  27. int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
  28. out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
  29. clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
  30. }
  31. #endif