irq.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #include <linux/platform_device.h>
  2. #include <asm/btfixup.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. };
  58. extern struct sparc_config sparc_config;
  59. unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
  60. void irq_link(unsigned int irq);
  61. void irq_unlink(unsigned int irq);
  62. void handler_irq(unsigned int pil, struct pt_regs *regs);
  63. /* Dave Redman (djhr@tadpole.co.uk)
  64. * changed these to function pointers.. it saves cycles and will allow
  65. * the irq dependencies to be split into different files at a later date
  66. * sun4m_irq.c etc so we could reduce the kernel size.
  67. * Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  68. * Changed these to btfixup entities... It saves cycles :)
  69. */
  70. BTFIXUPDEF_CALL(void, clear_clock_irq, void)
  71. BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
  72. static inline void clear_clock_irq(void)
  73. {
  74. BTFIXUP_CALL(clear_clock_irq)();
  75. }
  76. static inline void load_profile_irq(int cpu, int limit)
  77. {
  78. BTFIXUP_CALL(load_profile_irq)(cpu, limit);
  79. }
  80. unsigned long leon_get_irqmask(unsigned int irq);
  81. #ifdef CONFIG_SMP
  82. /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
  83. #define SUN4D_IPI_IRQ 13
  84. extern void sun4d_ipi_interrupt(void);
  85. #endif