irq.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * arch/arm/mach-orion5x/irq.c
  3. *
  4. * Core IRQ functions for Marvell Orion System On Chip
  5. *
  6. * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/irq.h>
  15. #include <linux/io.h>
  16. #include <asm/gpio.h>
  17. #include <mach/bridge-regs.h>
  18. #include <plat/irq.h>
  19. #include "common.h"
  20. static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
  21. {
  22. BUG_ON(irq < IRQ_ORION5X_GPIO_0_7 || irq > IRQ_ORION5X_GPIO_24_31);
  23. orion_gpio_irq_handler((irq - IRQ_ORION5X_GPIO_0_7) << 3);
  24. }
  25. void __init orion5x_init_irq(void)
  26. {
  27. orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK);
  28. /*
  29. * Initialize gpiolib for GPIOs 0-31.
  30. */
  31. orion_gpio_init(0, 32, GPIO_VIRT_BASE, 0, IRQ_ORION5X_GPIO_START);
  32. irq_set_chained_handler(IRQ_ORION5X_GPIO_0_7, gpio_irq_handler);
  33. irq_set_chained_handler(IRQ_ORION5X_GPIO_8_15, gpio_irq_handler);
  34. irq_set_chained_handler(IRQ_ORION5X_GPIO_16_23, gpio_irq_handler);
  35. irq_set_chained_handler(IRQ_ORION5X_GPIO_24_31, gpio_irq_handler);
  36. }