| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 1 | /* | 
 | 2 |  * Renesas Solutions Highlander R7780MP Support. | 
 | 3 |  * | 
 | 4 |  * Copyright (C) 2002  Atom Create Engineering Co., Ltd. | 
 | 5 |  * Copyright (C) 2006  Paul Mundt | 
 | 6 |  * Copyright (C) 2007  Magnus Damm | 
 | 7 |  * | 
 | 8 |  * This file is subject to the terms and conditions of the GNU General Public | 
 | 9 |  * License.  See the file "COPYING" in the main directory of this archive | 
 | 10 |  * for more details. | 
 | 11 |  */ | 
 | 12 | #include <linux/init.h> | 
 | 13 | #include <linux/irq.h> | 
 | 14 | #include <linux/io.h> | 
| Paul Mundt | 7639a45 | 2008-10-20 13:02:48 +0900 | [diff] [blame] | 15 | #include <mach/highlander.h> | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 16 |  | 
 | 17 | enum { | 
 | 18 | 	UNUSED = 0, | 
 | 19 |  | 
 | 20 | 	/* board specific interrupt sources */ | 
| Masayuki Hosokawa | d391c62 | 2008-03-21 13:38:00 +0900 | [diff] [blame] | 21 | 	CF,		/* Compact Flash */ | 
 | 22 | 	TP,		/* Touch panel */ | 
 | 23 | 	SCIF1,		/* FPGA SCIF1 */ | 
 | 24 | 	SCIF0,		/* FPGA SCIF0 */ | 
 | 25 | 	SMBUS,		/* SMBUS */ | 
 | 26 | 	RTC,		/* RTC Alarm */ | 
 | 27 | 	AX88796,	/* Ethernet controller */ | 
 | 28 | 	PSW,		/* Push Switch */ | 
 | 29 |  | 
 | 30 | 	/* external bus connector */ | 
 | 31 | 	EXT1, EXT2, EXT4, EXT5, EXT6, | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 32 | }; | 
 | 33 |  | 
 | 34 | static struct intc_vect vectors[] __initdata = { | 
 | 35 | 	INTC_IRQ(CF, IRQ_CF), | 
| Masayuki Hosokawa | d391c62 | 2008-03-21 13:38:00 +0900 | [diff] [blame] | 36 | 	INTC_IRQ(TP, IRQ_TP), | 
 | 37 | 	INTC_IRQ(SCIF1, IRQ_SCIF1), | 
 | 38 | 	INTC_IRQ(SCIF0, IRQ_SCIF0), | 
 | 39 | 	INTC_IRQ(SMBUS, IRQ_SMBUS), | 
 | 40 | 	INTC_IRQ(RTC, IRQ_RTC), | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 41 | 	INTC_IRQ(AX88796, IRQ_AX88796), | 
| Masayuki Hosokawa | d391c62 | 2008-03-21 13:38:00 +0900 | [diff] [blame] | 42 | 	INTC_IRQ(PSW, IRQ_PSW), | 
 | 43 |  | 
 | 44 | 	INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2), | 
 | 45 | 	INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5), | 
 | 46 | 	INTC_IRQ(EXT6, IRQ_EXT6), | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 47 | }; | 
 | 48 |  | 
 | 49 | static struct intc_mask_reg mask_registers[] __initdata = { | 
 | 50 | 	{ 0xa4000000, 0, 16, /* IRLMSK */ | 
| Masayuki Hosokawa | d391c62 | 2008-03-21 13:38:00 +0900 | [diff] [blame] | 51 | 	  { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS, | 
 | 52 | 	    0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } }, | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 53 | }; | 
 | 54 |  | 
 | 55 | static unsigned char irl2irq[HL_NR_IRL] __initdata = { | 
| Masayuki Hosokawa | d391c62 | 2008-03-21 13:38:00 +0900 | [diff] [blame] | 56 | 	0, IRQ_CF, IRQ_TP, IRQ_SCIF1, | 
 | 57 | 	IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6, | 
 | 58 | 	IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1, | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 59 | 	0, IRQ_AX88796, IRQ_PSW, | 
 | 60 | }; | 
 | 61 |  | 
 | 62 | static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors, | 
| Magnus Damm | 7f3edee | 2008-01-10 14:08:55 +0900 | [diff] [blame] | 63 | 			 NULL, mask_registers, NULL, NULL); | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 64 |  | 
| Paul Mundt | ae8a534 | 2008-04-25 17:58:21 +0900 | [diff] [blame] | 65 | unsigned char * __init highlander_plat_irq_setup(void) | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 66 | { | 
 | 67 | 	if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) { | 
 | 68 | 		printk(KERN_INFO "Using r7780mp interrupt controller.\n"); | 
 | 69 | 		register_intc_controller(&intc_desc); | 
 | 70 | 		return irl2irq; | 
 | 71 | 	} | 
 | 72 |  | 
 | 73 | 	return NULL; | 
 | 74 | } |