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 | c17afc0 | 2011-06-01 10:44:51 +0100 | [diff] [blame] | 28 | /* setup the sources the vic should advertise resume for, even though it |
| 29 | * is not doing the wake (set_irq_wake needs to be valid) */ |
| 30 | #define IRQ_VIC0_RESUME (1 << (IRQ_RTC_TIC - IRQ_VIC0_BASE)) |
| 31 | #define IRQ_VIC1_RESUME (1 << (IRQ_RTC_ALARM - IRQ_VIC1_BASE) | \ |
| 32 | 1 << (IRQ_PENDN - IRQ_VIC1_BASE) | \ |
| 33 | 1 << (IRQ_HSMMC0 - IRQ_VIC1_BASE) | \ |
| 34 | 1 << (IRQ_HSMMC1 - IRQ_VIC1_BASE) | \ |
| 35 | 1 << (IRQ_HSMMC2 - IRQ_VIC1_BASE)) |
Ben Dooks | 3e694d4 | 2008-10-21 14:07:05 +0100 | [diff] [blame] | 36 | |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 37 | void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid) |
| 38 | { |
Ben Dooks | 39669f5 | 2008-10-21 14:07:12 +0100 | [diff] [blame] | 39 | printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 40 | |
| 41 | /* initialise the pair of VICs */ |
Ben Dooks | c17afc0 | 2011-06-01 10:44:51 +0100 | [diff] [blame] | 42 | vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME); |
| 43 | vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME); |
Ben Dooks | f982dc5 | 2008-10-21 14:06:57 +0100 | [diff] [blame] | 44 | |
| 45 | /* add the timer sub-irqs */ |
Thomas Gleixner | 2d2e1d3 | 2011-05-09 10:09:26 +0200 | [diff] [blame] | 46 | s3c_init_vic_timer_irq(5, IRQ_TIMER0); |
Ben Dooks | d9b79fb | 2008-10-21 14:06:51 +0100 | [diff] [blame] | 47 | } |