| Paul Mundt | 32351a2 | 2007-03-12 14:38:59 +0900 | [diff] [blame] | 1 | /* | 
|  | 2 | * Renesas Solutions Highlander R7780RP-1 Support. | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2002  Atom Create Engineering Co., Ltd. | 
|  | 5 | * Copyright (C) 2006  Paul Mundt | 
| Magnus Damm | da2d7f4 | 2008-01-25 16:04:29 +0900 | [diff] [blame] | 6 | * Copyright (C) 2008  Magnus Damm | 
| Paul Mundt | 32351a2 | 2007-03-12 14:38:59 +0900 | [diff] [blame] | 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> | 
| Magnus Damm | da2d7f4 | 2008-01-25 16:04:29 +0900 | [diff] [blame] | 13 | #include <linux/irq.h> | 
| Paul Mundt | c3fae6d | 2007-09-14 09:26:07 +0900 | [diff] [blame] | 14 | #include <linux/io.h> | 
| Paul Mundt | 7639a45 | 2008-10-20 13:02:48 +0900 | [diff] [blame] | 15 | #include <mach/highlander.h> | 
| Paul Mundt | 32351a2 | 2007-03-12 14:38:59 +0900 | [diff] [blame] | 16 |  | 
| Magnus Damm | da2d7f4 | 2008-01-25 16:04:29 +0900 | [diff] [blame] | 17 | enum { | 
|  | 18 | UNUSED = 0, | 
|  | 19 |  | 
|  | 20 | /* board specific interrupt sources */ | 
|  | 21 |  | 
|  | 22 | AX88796,          /* Ethernet controller */ | 
|  | 23 | PSW,              /* Push Switch */ | 
|  | 24 | CF,               /* Compact Flash */ | 
|  | 25 |  | 
|  | 26 | PCI_A, | 
|  | 27 | PCI_B, | 
|  | 28 | PCI_C, | 
|  | 29 | PCI_D, | 
|  | 30 | }; | 
|  | 31 |  | 
|  | 32 | static struct intc_vect vectors[] __initdata = { | 
|  | 33 | INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */ | 
|  | 34 | INTC_IRQ(PCI_B, 66), | 
|  | 35 | INTC_IRQ(PCI_C, 67), | 
|  | 36 | INTC_IRQ(PCI_D, 68), | 
|  | 37 | INTC_IRQ(CF, IRQ_CF), | 
|  | 38 | INTC_IRQ(PSW, IRQ_PSW), | 
|  | 39 | INTC_IRQ(AX88796, IRQ_AX88796), | 
|  | 40 | }; | 
|  | 41 |  | 
|  | 42 | static struct intc_mask_reg mask_registers[] __initdata = { | 
|  | 43 | { 0xa5000000, 0, 16, /* IRLMSK */ | 
|  | 44 | { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0, | 
|  | 45 | 0, 0, 0, 0, 0, 0, PSW, AX88796 } }, | 
|  | 46 | }; | 
|  | 47 |  | 
|  | 48 | static unsigned char irl2irq[HL_NR_IRL] __initdata = { | 
|  | 49 | 65, 66, 67, 68, | 
|  | 50 | IRQ_CF, 0, 0, 0, | 
|  | 51 | 0, 0, 0, 0, | 
|  | 52 | IRQ_AX88796, IRQ_PSW | 
|  | 53 | }; | 
|  | 54 |  | 
|  | 55 | static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors, | 
|  | 56 | NULL, mask_registers, NULL, NULL); | 
|  | 57 |  | 
| Paul Mundt | ae8a534 | 2008-04-25 17:58:21 +0900 | [diff] [blame] | 58 | unsigned char * __init highlander_plat_irq_setup(void) | 
| Paul Mundt | 32351a2 | 2007-03-12 14:38:59 +0900 | [diff] [blame] | 59 | { | 
| Paul Mundt | 9d56dd3 | 2010-01-26 12:58:40 +0900 | [diff] [blame] | 60 | if (__raw_readw(0xa5000600)) { | 
| Magnus Damm | da2d7f4 | 2008-01-25 16:04:29 +0900 | [diff] [blame] | 61 | printk(KERN_INFO "Using r7780rp interrupt controller.\n"); | 
|  | 62 | register_intc_controller(&intc_desc); | 
|  | 63 | return irl2irq; | 
|  | 64 | } | 
| Magnus Damm | 897cfcd8 | 2007-09-10 12:06:03 +0900 | [diff] [blame] | 65 |  | 
|  | 66 | return NULL; | 
| Paul Mundt | 32351a2 | 2007-03-12 14:38:59 +0900 | [diff] [blame] | 67 | } |