| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 1 | /* | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 2 |  * arch/sh/boards/mach-landisk/irq.c | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 3 |  * | 
| kogiidena | 00e8c49 | 2007-03-19 16:24:12 +0900 | [diff] [blame] | 4 |  * I-O DATA Device, Inc. LANDISK Support | 
 | 5 |  * | 
 | 6 |  * Copyright (C) 2005-2007 kogiidena | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 7 |  * Copyright (C) 2011 Nobuhiro Iwamatsu | 
| kogiidena | 00e8c49 | 2007-03-19 16:24:12 +0900 | [diff] [blame] | 8 |  * | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 9 |  * Copyright (C) 2001  Ian da Silva, Jeremy Siegel | 
 | 10 |  * Based largely on io_se.c. | 
 | 11 |  * | 
| kogiidena | 00e8c49 | 2007-03-19 16:24:12 +0900 | [diff] [blame] | 12 |  * This file is subject to the terms and conditions of the GNU General Public | 
 | 13 |  * License.  See the file "COPYING" in the main directory of this archive | 
 | 14 |  * for more details. | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 15 |  */ | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 16 |  | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 17 | #include <linux/init.h> | 
 | 18 | #include <linux/irq.h> | 
| Paul Mundt | b6250e3 | 2006-12-07 17:27:18 +0900 | [diff] [blame] | 19 | #include <linux/interrupt.h> | 
 | 20 | #include <linux/io.h> | 
| Paul Mundt | 0764bff | 2008-07-29 22:10:01 +0900 | [diff] [blame] | 21 | #include <mach-landisk/mach/iodata_landisk.h> | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 22 |  | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 23 | enum { | 
 | 24 | 	UNUSED = 0, | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 25 |  | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 26 | 	PCI_INTA, /* PCI int A */ | 
 | 27 | 	PCI_INTB, /* PCI int B */ | 
 | 28 | 	PCI_INTC, /* PCI int C */ | 
 | 29 | 	PCI_INTD, /* PCI int D */ | 
 | 30 | 	ATA,	  /* ATA */ | 
 | 31 | 	FATA,	  /* CF */ | 
 | 32 | 	POWER,	  /* Power swtich */ | 
 | 33 | 	BUTTON,	  /* Button swtich */ | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 34 | }; | 
 | 35 |  | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 36 | /* Vectors for LANDISK */ | 
 | 37 | static struct intc_vect vectors_landisk[] __initdata = { | 
 | 38 | 	INTC_IRQ(PCI_INTA, IRQ_PCIINTA), | 
 | 39 | 	INTC_IRQ(PCI_INTB, IRQ_PCIINTB), | 
 | 40 | 	INTC_IRQ(PCI_INTC, IRQ_PCIINTC), | 
 | 41 | 	INTC_IRQ(PCI_INTD, IRQ_PCIINTD), | 
 | 42 | 	INTC_IRQ(ATA, IRQ_ATA), | 
 | 43 | 	INTC_IRQ(FATA, IRQ_FATA), | 
 | 44 | 	INTC_IRQ(POWER, IRQ_POWER), | 
 | 45 | 	INTC_IRQ(BUTTON, IRQ_BUTTON), | 
 | 46 | }; | 
 | 47 |  | 
 | 48 | /* IRLMSK mask register layout for LANDISK */ | 
 | 49 | static struct intc_mask_reg mask_registers_landisk[] __initdata = { | 
 | 50 | 	{ PA_IMASK, 0, 8, /* IRLMSK */ | 
 | 51 | 	  {  BUTTON, POWER, FATA, ATA, | 
 | 52 | 	     PCI_INTD, PCI_INTC, PCI_INTB, PCI_INTA, | 
 | 53 | 	  } | 
 | 54 | 	}, | 
 | 55 | }; | 
 | 56 |  | 
 | 57 | static DECLARE_INTC_DESC(intc_desc_landisk, "landisk", vectors_landisk, NULL, | 
 | 58 | 			mask_registers_landisk, NULL, NULL); | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 59 | /* | 
 | 60 |  * Initialize IRQ setting | 
 | 61 |  */ | 
 | 62 | void __init init_landisk_IRQ(void) | 
 | 63 | { | 
| Nobuhiro Iwamatsu | 144cd59 | 2011-01-07 03:02:14 +0000 | [diff] [blame] | 64 | 	register_intc_controller(&intc_desc_landisk); | 
| Paul Mundt | 9d56dd3 | 2010-01-26 12:58:40 +0900 | [diff] [blame] | 65 | 	__raw_writeb(0x00, PA_PWRINT_CLR); | 
| kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 66 | } |