Kukjin Kim | b7db51b | 2010-01-14 08:14:40 +0900 | [diff] [blame] | 1 | /* arch/arm/plat-s5p/irq.c |
| 2 | * |
| 3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ |
| 5 | * |
| 6 | * S5P - Interrupt handling |
| 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 version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/irq.h> |
| 16 | #include <linux/io.h> |
| 17 | |
| 18 | #include <asm/hardware/vic.h> |
| 19 | |
| 20 | #include <linux/serial_core.h> |
| 21 | #include <mach/map.h> |
| 22 | #include <plat/regs-timer.h> |
| 23 | #include <plat/regs-serial.h> |
| 24 | #include <plat/cpu.h> |
| 25 | #include <plat/irq-vic-timer.h> |
| 26 | #include <plat/irq-uart.h> |
| 27 | |
Kukjin Kim | b7db51b | 2010-01-14 08:14:40 +0900 | [diff] [blame] | 28 | /* |
| 29 | * Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3] |
| 30 | * are consecutive when looking up the interrupt in the demux routines. |
| 31 | */ |
| 32 | static struct s3c_uart_irq uart_irqs[] = { |
| 33 | [0] = { |
| 34 | .regs = S5P_VA_UART0, |
| 35 | .base_irq = IRQ_S5P_UART_BASE0, |
| 36 | .parent_irq = IRQ_UART0, |
| 37 | }, |
| 38 | [1] = { |
| 39 | .regs = S5P_VA_UART1, |
| 40 | .base_irq = IRQ_S5P_UART_BASE1, |
| 41 | .parent_irq = IRQ_UART1, |
| 42 | }, |
| 43 | [2] = { |
| 44 | .regs = S5P_VA_UART2, |
| 45 | .base_irq = IRQ_S5P_UART_BASE2, |
| 46 | .parent_irq = IRQ_UART2, |
| 47 | }, |
Kukjin Kim | d9f18a9 | 2010-01-29 10:17:20 +0900 | [diff] [blame] | 48 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 3 |
Kukjin Kim | b7db51b | 2010-01-14 08:14:40 +0900 | [diff] [blame] | 49 | [3] = { |
| 50 | .regs = S5P_VA_UART3, |
| 51 | .base_irq = IRQ_S5P_UART_BASE3, |
| 52 | .parent_irq = IRQ_UART3, |
| 53 | }, |
Kukjin Kim | d9f18a9 | 2010-01-29 10:17:20 +0900 | [diff] [blame] | 54 | #endif |
Kukjin Kim | b7db51b | 2010-01-14 08:14:40 +0900 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | void __init s5p_init_irq(u32 *vic, u32 num_vic) |
| 58 | { |
Changhwan Youn | 84bbc16 | 2010-07-16 12:12:07 +0900 | [diff] [blame] | 59 | #ifdef CONFIG_ARM_VIC |
Kukjin Kim | b7db51b | 2010-01-14 08:14:40 +0900 | [diff] [blame] | 60 | int irq; |
| 61 | |
| 62 | /* initialize the VICs */ |
| 63 | for (irq = 0; irq < num_vic; irq++) |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame] | 64 | vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); |
Changhwan Youn | 84bbc16 | 2010-07-16 12:12:07 +0900 | [diff] [blame] | 65 | #endif |
Kukjin Kim | b7db51b | 2010-01-14 08:14:40 +0900 | [diff] [blame] | 66 | |
| 67 | s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0); |
| 68 | s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1); |
| 69 | s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2); |
| 70 | s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3); |
| 71 | s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4); |
| 72 | |
| 73 | s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs)); |
| 74 | } |