18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * arch/sh/boards/mach-landisk/irq.c
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * I-O DATA Device, Inc. LANDISK Support
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2005-2007 kogiidena
88c2ecf20Sopenharmony_ci * Copyright (C) 2011 Nobuhiro Iwamatsu
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
118c2ecf20Sopenharmony_ci * Based largely on io_se.c.
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/init.h>
158c2ecf20Sopenharmony_ci#include <linux/irq.h>
168c2ecf20Sopenharmony_ci#include <linux/interrupt.h>
178c2ecf20Sopenharmony_ci#include <linux/io.h>
188c2ecf20Sopenharmony_ci#include <mach-landisk/mach/iodata_landisk.h>
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cienum {
218c2ecf20Sopenharmony_ci	UNUSED = 0,
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	PCI_INTA, /* PCI int A */
248c2ecf20Sopenharmony_ci	PCI_INTB, /* PCI int B */
258c2ecf20Sopenharmony_ci	PCI_INTC, /* PCI int C */
268c2ecf20Sopenharmony_ci	PCI_INTD, /* PCI int D */
278c2ecf20Sopenharmony_ci	ATA,	  /* ATA */
288c2ecf20Sopenharmony_ci	FATA,	  /* CF */
298c2ecf20Sopenharmony_ci	POWER,	  /* Power swtich */
308c2ecf20Sopenharmony_ci	BUTTON,	  /* Button swtich */
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* Vectors for LANDISK */
348c2ecf20Sopenharmony_cistatic struct intc_vect vectors_landisk[] __initdata = {
358c2ecf20Sopenharmony_ci	INTC_IRQ(PCI_INTA, IRQ_PCIINTA),
368c2ecf20Sopenharmony_ci	INTC_IRQ(PCI_INTB, IRQ_PCIINTB),
378c2ecf20Sopenharmony_ci	INTC_IRQ(PCI_INTC, IRQ_PCIINTC),
388c2ecf20Sopenharmony_ci	INTC_IRQ(PCI_INTD, IRQ_PCIINTD),
398c2ecf20Sopenharmony_ci	INTC_IRQ(ATA, IRQ_ATA),
408c2ecf20Sopenharmony_ci	INTC_IRQ(FATA, IRQ_FATA),
418c2ecf20Sopenharmony_ci	INTC_IRQ(POWER, IRQ_POWER),
428c2ecf20Sopenharmony_ci	INTC_IRQ(BUTTON, IRQ_BUTTON),
438c2ecf20Sopenharmony_ci};
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* IRLMSK mask register layout for LANDISK */
468c2ecf20Sopenharmony_cistatic struct intc_mask_reg mask_registers_landisk[] __initdata = {
478c2ecf20Sopenharmony_ci	{ PA_IMASK, 0, 8, /* IRLMSK */
488c2ecf20Sopenharmony_ci	  {  BUTTON, POWER, FATA, ATA,
498c2ecf20Sopenharmony_ci	     PCI_INTD, PCI_INTC, PCI_INTB, PCI_INTA,
508c2ecf20Sopenharmony_ci	  }
518c2ecf20Sopenharmony_ci	},
528c2ecf20Sopenharmony_ci};
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_cistatic DECLARE_INTC_DESC(intc_desc_landisk, "landisk", vectors_landisk, NULL,
558c2ecf20Sopenharmony_ci			mask_registers_landisk, NULL, NULL);
568c2ecf20Sopenharmony_ci/*
578c2ecf20Sopenharmony_ci * Initialize IRQ setting
588c2ecf20Sopenharmony_ci */
598c2ecf20Sopenharmony_civoid __init init_landisk_IRQ(void)
608c2ecf20Sopenharmony_ci{
618c2ecf20Sopenharmony_ci	register_intc_controller(&intc_desc_landisk);
628c2ecf20Sopenharmony_ci	__raw_writeb(0x00, PA_PWRINT_CLR);
638c2ecf20Sopenharmony_ci}
64