irq.h 2.6 KB

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