irq.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * linux/arch/arm/mach-nuc93x/irq.c
  3. *
  4. * Copyright (c) 2008 Nuvoton technology corporation.
  5. *
  6. * Wan ZongShun <mcuos.com@gmail.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation;version 2 of the License.
  11. *
  12. */
  13. #include <linux/init.h>
  14. #include <linux/module.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/ioport.h>
  17. #include <linux/ptrace.h>
  18. #include <linux/sysdev.h>
  19. #include <linux/io.h>
  20. #include <asm/irq.h>
  21. #include <asm/mach/irq.h>
  22. #include <mach/hardware.h>
  23. #include <mach/regs-irq.h>
  24. static void nuc93x_irq_mask(unsigned int irq)
  25. {
  26. __raw_writel(1 << irq, REG_AIC_MDCR);
  27. }
  28. /*
  29. * By the w90p910 spec,any irq,only write 1
  30. * to REG_AIC_EOSCR for ACK
  31. */
  32. static void nuc93x_irq_ack(unsigned int irq)
  33. {
  34. __raw_writel(0x01, REG_AIC_EOSCR);
  35. }
  36. static void nuc93x_irq_unmask(unsigned int irq)
  37. {
  38. __raw_writel(1 << irq, REG_AIC_MECR);
  39. }
  40. static struct irq_chip nuc93x_irq_chip = {
  41. .ack = nuc93x_irq_ack,
  42. .mask = nuc93x_irq_mask,
  43. .unmask = nuc93x_irq_unmask,
  44. };
  45. void __init nuc93x_init_irq(void)
  46. {
  47. int irqno;
  48. __raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
  49. for (irqno = IRQ_WDT; irqno <= NR_IRQS; irqno++) {
  50. set_irq_chip(irqno, &nuc93x_irq_chip);
  51. set_irq_handler(irqno, handle_level_irq);
  52. set_irq_flags(irqno, IRQF_VALID);
  53. }
  54. }