interrupts.c 540 B

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