irq.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/platform_device.h>
  3. #include <asm/cpu_type.h>
  4. struct irq_bucket {
  5. struct irq_bucket *next;
  6. unsigned int real_irq;
  7. unsigned int irq;
  8. unsigned int pil;
  9. };
  10. #define SUN4M_HARD_INT(x) (0x000000001 << (x))
  11. #define SUN4M_SOFT_INT(x) (0x000010000 << (x))
  12. #define SUN4D_MAX_BOARD 10
  13. #define SUN4D_MAX_IRQ ((SUN4D_MAX_BOARD + 2) << 5)
  14. /* Map between the irq identifier used in hw to the
  15. * irq_bucket. The map is sufficient large to hold
  16. * the sun4d hw identifiers.
  17. */
  18. extern struct irq_bucket *irq_map[SUN4D_MAX_IRQ];
  19. /* sun4m specific type definitions */
  20. /* This maps direct to CPU specific interrupt registers */
  21. struct sun4m_irq_percpu {
  22. u32 pending;
  23. u32 clear;
  24. u32 set;
  25. };
  26. /* This maps direct to global interrupt registers */
  27. struct sun4m_irq_global {
  28. u32 pending;
  29. u32 mask;
  30. u32 mask_clear;
  31. u32 mask_set;
  32. u32 interrupt_target;
  33. };
  34. extern struct sun4m_irq_percpu __iomem *sun4m_irq_percpu[SUN4M_NCPUS];
  35. extern struct sun4m_irq_global __iomem *sun4m_irq_global;
  36. /* The following definitions describe the individual platform features: */
  37. #define FEAT_L10_CLOCKSOURCE (1 << 0) /* L10 timer is used as a clocksource */
  38. #define FEAT_L10_CLOCKEVENT (1 << 1) /* L10 timer is used as a clockevent */
  39. #define FEAT_L14_ONESHOT (1 << 2) /* L14 timer clockevent can oneshot */
  40. /*
  41. * Platform specific configuration
  42. * The individual platforms assign their platform
  43. * specifics in their init functions.
  44. */
  45. struct sparc_config {
  46. void (*init_timers)(void);
  47. unsigned int (*build_device_irq)(struct platform_device *op,
  48. unsigned int real_irq);
  49. /* generic clockevent features - see FEAT_* above */
  50. int features;
  51. /* clock rate used for clock event timer */
  52. int clock_rate;
  53. /* one period for clock source timer */
  54. unsigned int cs_period;
  55. /* function to obtain offsett for cs period */
  56. unsigned int (*get_cycles_offset)(void);
  57. void (*clear_clock_irq)(void);
  58. void (*load_profile_irq)(int cpu, unsigned int limit);
  59. };
  60. extern struct sparc_config sparc_config;
  61. unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
  62. void irq_link(unsigned int irq);
  63. void irq_unlink(unsigned int irq);
  64. void handler_irq(unsigned int pil, struct pt_regs *regs);
  65. unsigned long leon_get_irqmask(unsigned int irq);
  66. /* irq_32.c */
  67. void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs);
  68. /* sun4m_irq.c */
  69. void sun4m_nmi(struct pt_regs *regs);
  70. /* sun4d_irq.c */
  71. void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs);
  72. #ifdef CONFIG_SMP
  73. /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
  74. #define SUN4D_IPI_IRQ 13
  75. void sun4d_ipi_interrupt(void);
  76. #endif