Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 1 | /* arch/arm/plat-s3c64xx/irq.c |
| 2 | * |
| 3 | * Copyright 2008 Openmoko, Inc. |
| 4 | * Copyright 2008 Simtec Electronics |
| 5 | * Ben Dooks <ben@simtec.co.uk> |
| 6 | * http://armlinux.simtec.co.uk/ |
| 7 | * |
| 8 | * S3C64XX - Interrupt handling |
| 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 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/interrupt.h> |
Ben Dooks | 966bcc1 | 2008-12-12 00:24:32 +0000 | [diff] [blame] | 17 | #include <linux/serial_core.h> |
Ben Dooks | f982dc5 | 2008-10-21 14:06:57 +0100 | [diff] [blame] | 18 | #include <linux/irq.h> |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 19 | #include <linux/io.h> |
| 20 | |
| 21 | #include <asm/hardware/vic.h> |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 22 | |
| 23 | #include <mach/map.h> |
Ben Dooks | 7162ba0 | 2010-01-06 10:14:51 +0900 | [diff] [blame] | 24 | #include <plat/irq-vic-timer.h> |
Ben Dooks | 51022cf | 2010-01-06 11:18:44 +0900 | [diff] [blame] | 25 | #include <plat/irq-uart.h> |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 26 | #include <plat/cpu.h> |
| 27 | |
Ben Dooks | 51022cf | 2010-01-06 11:18:44 +0900 | [diff] [blame] | 28 | static struct s3c_uart_irq uart_irqs[] = { |
Ben Dooks | 3e694d4 | 2008-10-21 14:07:05 +0100 | [diff] [blame] | 29 | [0] = { |
| 30 | .regs = S3C_VA_UART0, |
| 31 | .base_irq = IRQ_S3CUART_BASE0, |
| 32 | .parent_irq = IRQ_UART0, |
| 33 | }, |
| 34 | [1] = { |
| 35 | .regs = S3C_VA_UART1, |
| 36 | .base_irq = IRQ_S3CUART_BASE1, |
| 37 | .parent_irq = IRQ_UART1, |
| 38 | }, |
| 39 | [2] = { |
| 40 | .regs = S3C_VA_UART2, |
| 41 | .base_irq = IRQ_S3CUART_BASE2, |
| 42 | .parent_irq = IRQ_UART2, |
| 43 | }, |
| 44 | [3] = { |
| 45 | .regs = S3C_VA_UART3, |
| 46 | .base_irq = IRQ_S3CUART_BASE3, |
| 47 | .parent_irq = IRQ_UART3, |
| 48 | }, |
| 49 | }; |
| 50 | |
Ben Dooks | 3e694d4 | 2008-10-21 14:07:05 +0100 | [diff] [blame] | 51 | |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 52 | void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid) |
| 53 | { |
Ben Dooks | 39669f5 | 2008-10-21 14:07:12 +0100 | [diff] [blame] | 54 | printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 55 | |
| 56 | /* initialise the pair of VICs */ |
Ben Dooks | 5b39be4 | 2010-01-07 08:59:26 +0900 | [diff] [blame^] | 57 | vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, 0); |
| 58 | vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, 0); |
Ben Dooks | f982dc5 | 2008-10-21 14:06:57 +0100 | [diff] [blame] | 59 | |
| 60 | /* add the timer sub-irqs */ |
| 61 | |
Ben Dooks | 7162ba0 | 2010-01-06 10:14:51 +0900 | [diff] [blame] | 62 | s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0); |
| 63 | s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1); |
| 64 | s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2); |
| 65 | s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3); |
| 66 | s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4); |
Ben Dooks | 3e694d4 | 2008-10-21 14:07:05 +0100 | [diff] [blame] | 67 | |
Ben Dooks | 51022cf | 2010-01-06 11:18:44 +0900 | [diff] [blame] | 68 | s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs)); |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 69 | } |