interrupts.c 744 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->imrh0, 0xffffffff);
  16. setbits_be32(&intp->imrl0, 0xffffffff);
  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->imrh0, CONFIG_SYS_TMRINTR_MASK);
  26. }
  27. #endif