xref: /openbmc/linux/arch/sh/drivers/pci/fixups-sdk7780.c (revision 2b8ff9f2769135a08fc7b9c989560f759b80cc1a)
14862ec07SNicholas Beck /*
24862ec07SNicholas Beck  * arch/sh/drivers/pci/fixups-sdk7780.c
34862ec07SNicholas Beck  *
44862ec07SNicholas Beck  * PCI fixups for the SDK7780SE03
54862ec07SNicholas Beck  *
64862ec07SNicholas Beck  * Copyright (C) 2003  Lineo uSolutions, Inc.
74862ec07SNicholas Beck  * Copyright (C) 2004 - 2006  Paul Mundt
8a6d377b6SPaul Mundt  * Copyright (C) 2006  Nobuhiro Iwamatsu
94862ec07SNicholas Beck  *
104862ec07SNicholas Beck  * This file is subject to the terms and conditions of the GNU General Public
114862ec07SNicholas Beck  * License.  See the file "COPYING" in the main directory of this archive
124862ec07SNicholas Beck  * for more details.
134862ec07SNicholas Beck  */
144862ec07SNicholas Beck #include <linux/pci.h>
15a6d377b6SPaul Mundt #include <linux/io.h>
1658796ce6SPaul Mundt #include <linux/sh_intc.h>
174862ec07SNicholas Beck #include "pci-sh4.h"
184862ec07SNicholas Beck 
1958796ce6SPaul Mundt #define IRQ_INTA	evt2irq(0xa20)
2058796ce6SPaul Mundt #define IRQ_INTB	evt2irq(0xa40)
2158796ce6SPaul Mundt #define IRQ_INTC	evt2irq(0xa60)
2258796ce6SPaul Mundt #define IRQ_INTD	evt2irq(0xa80)
2358796ce6SPaul Mundt 
24a6d377b6SPaul Mundt /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
25*2b8ff9f2SMatthew Minter static char sdk7780_irq_tab[4][16] = {
26a6d377b6SPaul Mundt 	/* INTA */
2758796ce6SPaul Mundt 	{ IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1,
2858796ce6SPaul Mundt 	  -1, -1, -1, -1, -1, -1 },
29a6d377b6SPaul Mundt 	/* INTB */
3058796ce6SPaul Mundt 	{ IRQ_INTB, IRQ_INTA, -1, IRQ_INTA, -1, -1, -1, -1, -1, -1, -1, -1,
3158796ce6SPaul Mundt 	  -1, -1, -1, -1 },
32a6d377b6SPaul Mundt 	/* INTC */
3358796ce6SPaul Mundt 	{ IRQ_INTC, IRQ_INTB, -1, IRQ_INTB, -1, -1, -1, -1, -1, -1, -1, -1,
3458796ce6SPaul Mundt 	  -1, -1, -1, -1 },
35a6d377b6SPaul Mundt 	/* INTD */
3658796ce6SPaul Mundt 	{ IRQ_INTD, IRQ_INTC, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3758796ce6SPaul Mundt 	  -1, -1, -1 },
38a6d377b6SPaul Mundt };
39a6d377b6SPaul Mundt 
40*2b8ff9f2SMatthew Minter int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
41a6d377b6SPaul Mundt {
42a6d377b6SPaul Mundt        return sdk7780_irq_tab[pin-1][slot];
43a6d377b6SPaul Mundt }
44