interrupts.c 763 B

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