dn_ints.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <linux/interrupt.h>
  2. #include <linux/irq.h>
  3. #include <asm/traps.h>
  4. #include <asm/apollohw.h>
  5. unsigned int apollo_irq_startup(struct irq_data *data)
  6. {
  7. unsigned int irq = data->irq;
  8. if (irq < 8)
  9. *(volatile unsigned char *)(pica+1) &= ~(1 << irq);
  10. else
  11. *(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
  12. return 0;
  13. }
  14. void apollo_irq_shutdown(struct irq_data *data)
  15. {
  16. unsigned int irq = data->irq;
  17. if (irq < 8)
  18. *(volatile unsigned char *)(pica+1) |= (1 << irq);
  19. else
  20. *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
  21. }
  22. void apollo_irq_eoi(struct irq_data *data)
  23. {
  24. *(volatile unsigned char *)(pica) = 0x20;
  25. *(volatile unsigned char *)(picb) = 0x20;
  26. }
  27. static struct irq_chip apollo_irq_chip = {
  28. .name = "apollo",
  29. .irq_startup = apollo_irq_startup,
  30. .irq_shutdown = apollo_irq_shutdown,
  31. .irq_eoi = apollo_irq_eoi,
  32. };
  33. void __init dn_init_IRQ(void)
  34. {
  35. m68k_setup_user_interrupt(VEC_USER + 96, 16);
  36. m68k_setup_irq_controller(&apollo_irq_chip, handle_fasteoi_irq,
  37. IRQ_APOLLO, 16);
  38. }