interrupts.c 767 B

1234567891011121314151617181920212223242526272829303132333435
  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->imrh0, 0xffffffff);
  17. setbits_be32(&intp->imrl0, 0xffffffff);
  18. enable_interrupts();
  19. return 0;
  20. }
  21. #if defined(CONFIG_SLTTMR)
  22. void dtimer_intr_setup(void)
  23. {
  24. int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
  25. out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
  26. clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
  27. }
  28. #endif