irq.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2011-12 Synopsys, Inc. (www.synopsys.com)
  4. */
  5. #include <linux/interrupt.h>
  6. #include <linux/irqchip.h>
  7. #include <asm/mach_desc.h>
  8. #include <asm/irq_regs.h>
  9. #include <asm/smp.h>
  10. /*
  11. * Late Interrupt system init called from start_kernel for Boot CPU only
  12. *
  13. * Since slab must already be initialized, platforms can start doing any
  14. * needed request_irq( )s
  15. */
  16. void __init init_IRQ(void)
  17. {
  18. /*
  19. * process the entire interrupt tree in one go
  20. * Any external intc will be setup provided DT chains them
  21. * properly
  22. */
  23. irqchip_init();
  24. #ifdef CONFIG_SMP
  25. /* a SMP H/w block could do IPI IRQ request here */
  26. if (plat_smp_ops.init_per_cpu)
  27. plat_smp_ops.init_per_cpu(smp_processor_id());
  28. #endif
  29. if (machine_desc->init_per_cpu)
  30. machine_desc->init_per_cpu(smp_processor_id());
  31. }
  32. /*
  33. * "C" Entry point for any ARC ISR, called from low level vector handler
  34. * @irq is the vector number read from ICAUSE reg of on-chip intc
  35. */
  36. void arch_do_IRQ(unsigned int hwirq, struct pt_regs *regs)
  37. {
  38. struct pt_regs *old_regs;
  39. irq_enter();
  40. old_regs = set_irq_regs(regs);
  41. generic_handle_domain_irq(NULL, hwirq);
  42. set_irq_regs(old_regs);
  43. irq_exit();
  44. }