interrupts.c 741 B

123456789101112131415161718192021222324252627282930313233
  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 <asm/immap.h>
  10. #include <asm/io.h>
  11. int interrupt_init(void)
  12. {
  13. int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
  14. /* Make sure all interrupts are disabled */
  15. setbits_be32(&intp->imrl0, 0x1);
  16. enable_interrupts();
  17. return 0;
  18. }
  19. #if defined(CONFIG_MCFTMR)
  20. void dtimer_intr_setup(void)
  21. {
  22. int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
  23. out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
  24. clrbits_be32(&intp->imrl0, INTC_IPRL_INT0);
  25. clrbits_be32(&intp->imrl0, CONFIG_SYS_TMRINTR_MASK);
  26. }
  27. #endif