interrupts.c 543 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. *
  6. */
  7. #include <common.h>
  8. #include <asm/immap.h>
  9. #include <asm/io.h>
  10. #ifdef CONFIG_M5307
  11. int interrupt_init(void)
  12. {
  13. enable_interrupts();
  14. return 0;
  15. }
  16. void dtimer_intr_setup(void)
  17. {
  18. intctrl_t *icr = (intctrl_t *)(MMAP_INTC);
  19. /* clearing TIMER2 mask, so enabling the related interrupt */
  20. out_be32(&icr->imr, in_be32(&icr->imr) & ~0x00000400);
  21. /* set TIMER2 interrupt priority */
  22. out_8(&icr->icr2, CONFIG_SYS_TMRINTR_PRI);
  23. }
  24. #endif