blob: 75d9a0e49193eae2ff3a58cb2a07bca3eef718d9 [file] [log] [blame]
Ben Dooksd9b79fb2008-10-21 14:06:51 +01001/* 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 Dooks966bcc12008-12-12 00:24:32 +000017#include <linux/serial_core.h>
Ben Dooksf982dc52008-10-21 14:06:57 +010018#include <linux/irq.h>
Ben Dooksd9b79fb2008-10-21 14:06:51 +010019#include <linux/io.h>
20
21#include <asm/hardware/vic.h>
Ben Dooksd9b79fb2008-10-21 14:06:51 +010022
23#include <mach/map.h>
Ben Dooks7162ba02010-01-06 10:14:51 +090024#include <plat/irq-vic-timer.h>
Ben Dooks51022cf2010-01-06 11:18:44 +090025#include <plat/irq-uart.h>
Ben Dooksd9b79fb2008-10-21 14:06:51 +010026#include <plat/cpu.h>
27
Ben Dooks51022cf2010-01-06 11:18:44 +090028static struct s3c_uart_irq uart_irqs[] = {
Ben Dooks3e694d42008-10-21 14:07:05 +010029 [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 Dooksc17afc02011-06-01 10:44:51 +010051/* setup the sources the vic should advertise resume for, even though it
52 * is not doing the wake (set_irq_wake needs to be valid) */
53#define IRQ_VIC0_RESUME (1 << (IRQ_RTC_TIC - IRQ_VIC0_BASE))
54#define IRQ_VIC1_RESUME (1 << (IRQ_RTC_ALARM - IRQ_VIC1_BASE) | \
55 1 << (IRQ_PENDN - IRQ_VIC1_BASE) | \
56 1 << (IRQ_HSMMC0 - IRQ_VIC1_BASE) | \
57 1 << (IRQ_HSMMC1 - IRQ_VIC1_BASE) | \
58 1 << (IRQ_HSMMC2 - IRQ_VIC1_BASE))
Ben Dooks3e694d42008-10-21 14:07:05 +010059
Ben Dooksd9b79fb2008-10-21 14:06:51 +010060void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
61{
Ben Dooks39669f52008-10-21 14:07:12 +010062 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
Ben Dooksd9b79fb2008-10-21 14:06:51 +010063
64 /* initialise the pair of VICs */
Ben Dooksc17afc02011-06-01 10:44:51 +010065 vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
66 vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
Ben Dooksf982dc52008-10-21 14:06:57 +010067
68 /* add the timer sub-irqs */
Thomas Gleixner2d2e1d32011-05-09 10:09:26 +020069 s3c_init_vic_timer_irq(5, IRQ_TIMER0);
Ben Dooks3e694d42008-10-21 14:07:05 +010070
Ben Dooks51022cf2010-01-06 11:18:44 +090071 s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
Ben Dooksd9b79fb2008-10-21 14:06:51 +010072}