xref: /linux/arch/sh/boards/mach-landisk/irq.c (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
1aaf9128aSKuninori Morimoto // SPDX-License-Identifier: GPL-2.0
2da2014a2SPaul Mundt /*
3144cd596SNobuhiro Iwamatsu  * arch/sh/boards/mach-landisk/irq.c
4da2014a2SPaul Mundt  *
5da2014a2SPaul Mundt  * I-O DATA Device, Inc. LANDISK Support
6da2014a2SPaul Mundt  *
7da2014a2SPaul Mundt  * Copyright (C) 2005-2007 kogiidena
8144cd596SNobuhiro Iwamatsu  * Copyright (C) 2011 Nobuhiro Iwamatsu
9da2014a2SPaul Mundt  *
10da2014a2SPaul Mundt  * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
11da2014a2SPaul Mundt  * Based largely on io_se.c.
12da2014a2SPaul Mundt  */
13144cd596SNobuhiro Iwamatsu 
14da2014a2SPaul Mundt #include <linux/init.h>
15da2014a2SPaul Mundt #include <linux/irq.h>
16da2014a2SPaul Mundt #include <linux/interrupt.h>
17da2014a2SPaul Mundt #include <linux/io.h>
180764bff4SPaul Mundt #include <mach-landisk/mach/iodata_landisk.h>
19da2014a2SPaul Mundt 
20144cd596SNobuhiro Iwamatsu enum {
21144cd596SNobuhiro Iwamatsu 	UNUSED = 0,
22da2014a2SPaul Mundt 
23144cd596SNobuhiro Iwamatsu 	PCI_INTA, /* PCI int A */
24144cd596SNobuhiro Iwamatsu 	PCI_INTB, /* PCI int B */
25144cd596SNobuhiro Iwamatsu 	PCI_INTC, /* PCI int C */
26144cd596SNobuhiro Iwamatsu 	PCI_INTD, /* PCI int D */
27144cd596SNobuhiro Iwamatsu 	ATA,	  /* ATA */
28144cd596SNobuhiro Iwamatsu 	FATA,	  /* CF */
29*0341bd39STang Bin 	POWER,	  /* Power switch */
30*0341bd39STang Bin 	BUTTON,	  /* Button switch */
31da2014a2SPaul Mundt };
32da2014a2SPaul Mundt 
33144cd596SNobuhiro Iwamatsu /* Vectors for LANDISK */
34144cd596SNobuhiro Iwamatsu static struct intc_vect vectors_landisk[] __initdata = {
35144cd596SNobuhiro Iwamatsu 	INTC_IRQ(PCI_INTA, IRQ_PCIINTA),
36144cd596SNobuhiro Iwamatsu 	INTC_IRQ(PCI_INTB, IRQ_PCIINTB),
37144cd596SNobuhiro Iwamatsu 	INTC_IRQ(PCI_INTC, IRQ_PCIINTC),
38144cd596SNobuhiro Iwamatsu 	INTC_IRQ(PCI_INTD, IRQ_PCIINTD),
39144cd596SNobuhiro Iwamatsu 	INTC_IRQ(ATA, IRQ_ATA),
40144cd596SNobuhiro Iwamatsu 	INTC_IRQ(FATA, IRQ_FATA),
41144cd596SNobuhiro Iwamatsu 	INTC_IRQ(POWER, IRQ_POWER),
42144cd596SNobuhiro Iwamatsu 	INTC_IRQ(BUTTON, IRQ_BUTTON),
43144cd596SNobuhiro Iwamatsu };
44144cd596SNobuhiro Iwamatsu 
45144cd596SNobuhiro Iwamatsu /* IRLMSK mask register layout for LANDISK */
46144cd596SNobuhiro Iwamatsu static struct intc_mask_reg mask_registers_landisk[] __initdata = {
47144cd596SNobuhiro Iwamatsu 	{ PA_IMASK, 0, 8, /* IRLMSK */
48144cd596SNobuhiro Iwamatsu 	  {  BUTTON, POWER, FATA, ATA,
49144cd596SNobuhiro Iwamatsu 	     PCI_INTD, PCI_INTC, PCI_INTB, PCI_INTA,
50144cd596SNobuhiro Iwamatsu 	  }
51144cd596SNobuhiro Iwamatsu 	},
52144cd596SNobuhiro Iwamatsu };
53144cd596SNobuhiro Iwamatsu 
54144cd596SNobuhiro Iwamatsu static DECLARE_INTC_DESC(intc_desc_landisk, "landisk", vectors_landisk, NULL,
55144cd596SNobuhiro Iwamatsu 			mask_registers_landisk, NULL, NULL);
56da2014a2SPaul Mundt /*
57da2014a2SPaul Mundt  * Initialize IRQ setting
58da2014a2SPaul Mundt  */
init_landisk_IRQ(void)59da2014a2SPaul Mundt void __init init_landisk_IRQ(void)
60da2014a2SPaul Mundt {
61144cd596SNobuhiro Iwamatsu 	register_intc_controller(&intc_desc_landisk);
629d56dd3bSPaul Mundt 	__raw_writeb(0x00, PA_PWRINT_CLR);
63da2014a2SPaul Mundt }
64