irq.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* arch/arm/plat-s5pc1xx/irq.c
  2. *
  3. * Copyright 2009 Samsung Electronics Co.
  4. * Byungho Min <bhmin@samsung.com>
  5. *
  6. * S5PC1XX - Interrupt handling
  7. *
  8. * Based on plat-s3c64xx/irq.c
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/irq.h>
  17. #include <linux/io.h>
  18. #include <asm/hardware/vic.h>
  19. #include <mach/map.h>
  20. #include <plat/irq-vic-timer.h>
  21. #include <plat/irq-uart.h>
  22. #include <plat/cpu.h>
  23. /* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
  24. * are consecutive when looking up the interrupt in the demux routines.
  25. */
  26. static struct s3c_uart_irq uart_irqs[] = {
  27. [0] = {
  28. .regs = (void *)S3C_VA_UART0,
  29. .base_irq = IRQ_S3CUART_BASE0,
  30. .parent_irq = IRQ_UART0,
  31. },
  32. [1] = {
  33. .regs = (void *)S3C_VA_UART1,
  34. .base_irq = IRQ_S3CUART_BASE1,
  35. .parent_irq = IRQ_UART1,
  36. },
  37. [2] = {
  38. .regs = (void *)S3C_VA_UART2,
  39. .base_irq = IRQ_S3CUART_BASE2,
  40. .parent_irq = IRQ_UART2,
  41. },
  42. [3] = {
  43. .regs = (void *)S3C_VA_UART3,
  44. .base_irq = IRQ_S3CUART_BASE3,
  45. .parent_irq = IRQ_UART3,
  46. },
  47. };
  48. void __init s5pc1xx_init_irq(u32 *vic_valid, int num)
  49. {
  50. int i;
  51. printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
  52. /* initialise the pair of VICs */
  53. for (i = 0; i < num; i++)
  54. vic_init((void *)S5PC1XX_VA_VIC(i), S3C_IRQ(i * S3C_IRQ_OFFSET),
  55. vic_valid[i], 0);
  56. /* add the timer sub-irqs */
  57. s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0);
  58. s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1);
  59. s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2);
  60. s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3);
  61. s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4);
  62. s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
  63. }