xref: /openbmc/linux/arch/sh/drivers/pci/fixups-sdk7780.c (revision 597473720f4dc69749542bfcfed4a927a43d935e)
1*ff4a7481SKuninori Morimoto // SPDX-License-Identifier: GPL-2.0
24862ec07SNicholas Beck /*
34862ec07SNicholas Beck  * arch/sh/drivers/pci/fixups-sdk7780.c
44862ec07SNicholas Beck  *
54862ec07SNicholas Beck  * PCI fixups for the SDK7780SE03
64862ec07SNicholas Beck  *
74862ec07SNicholas Beck  * Copyright (C) 2003  Lineo uSolutions, Inc.
84862ec07SNicholas Beck  * Copyright (C) 2004 - 2006  Paul Mundt
9a6d377b6SPaul Mundt  * Copyright (C) 2006  Nobuhiro Iwamatsu
104862ec07SNicholas Beck  */
114862ec07SNicholas Beck #include <linux/pci.h>
12a6d377b6SPaul Mundt #include <linux/io.h>
1358796ce6SPaul Mundt #include <linux/sh_intc.h>
144862ec07SNicholas Beck #include "pci-sh4.h"
154862ec07SNicholas Beck 
1658796ce6SPaul Mundt #define IRQ_INTA	evt2irq(0xa20)
1758796ce6SPaul Mundt #define IRQ_INTB	evt2irq(0xa40)
1858796ce6SPaul Mundt #define IRQ_INTC	evt2irq(0xa60)
1958796ce6SPaul Mundt #define IRQ_INTD	evt2irq(0xa80)
2058796ce6SPaul Mundt 
21a6d377b6SPaul Mundt /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
222b8ff9f2SMatthew Minter static char sdk7780_irq_tab[4][16] = {
23a6d377b6SPaul Mundt 	/* INTA */
2458796ce6SPaul Mundt 	{ IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1,
2558796ce6SPaul Mundt 	  -1, -1, -1, -1, -1, -1 },
26a6d377b6SPaul Mundt 	/* INTB */
2758796ce6SPaul Mundt 	{ IRQ_INTB, IRQ_INTA, -1, IRQ_INTA, -1, -1, -1, -1, -1, -1, -1, -1,
2858796ce6SPaul Mundt 	  -1, -1, -1, -1 },
29a6d377b6SPaul Mundt 	/* INTC */
3058796ce6SPaul Mundt 	{ IRQ_INTC, IRQ_INTB, -1, IRQ_INTB, -1, -1, -1, -1, -1, -1, -1, -1,
3158796ce6SPaul Mundt 	  -1, -1, -1, -1 },
32a6d377b6SPaul Mundt 	/* INTD */
3358796ce6SPaul Mundt 	{ IRQ_INTD, IRQ_INTC, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3458796ce6SPaul Mundt 	  -1, -1, -1 },
35a6d377b6SPaul Mundt };
36a6d377b6SPaul Mundt 
pcibios_map_platform_irq(const struct pci_dev * pdev,u8 slot,u8 pin)372b8ff9f2SMatthew Minter int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
38a6d377b6SPaul Mundt {
39a6d377b6SPaul Mundt        return sdk7780_irq_tab[pin-1][slot];
40a6d377b6SPaul Mundt }
41