xref: /linux/arch/sh/drivers/pci/fixups-titan.c (revision 597473720f4dc69749542bfcfed4a927a43d935e)
1*ff4a7481SKuninori Morimoto // SPDX-License-Identifier: GPL-2.0
284972ec0SPaul Mundt /*
384972ec0SPaul Mundt  * arch/sh/drivers/pci/ops-titan.c
484972ec0SPaul Mundt  *
584972ec0SPaul Mundt  * Ported to new API by Paul Mundt <lethal@linux-sh.org>
684972ec0SPaul Mundt  *
784972ec0SPaul Mundt  * Modified from ops-snapgear.c written by  David McCullough
884972ec0SPaul Mundt  * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
984972ec0SPaul Mundt  *
1084972ec0SPaul Mundt  * PCI initialization for the Titan boards
1184972ec0SPaul Mundt  */
1284972ec0SPaul Mundt #include <linux/kernel.h>
1384972ec0SPaul Mundt #include <linux/types.h>
1484972ec0SPaul Mundt #include <linux/init.h>
1584972ec0SPaul Mundt #include <linux/pci.h>
1684972ec0SPaul Mundt #include <linux/io.h>
1784972ec0SPaul Mundt #include <mach/titan.h>
1884972ec0SPaul Mundt #include "pci-sh4.h"
1984972ec0SPaul Mundt 
202b8ff9f2SMatthew Minter static char titan_irq_tab[] = {
2184972ec0SPaul Mundt 	TITAN_IRQ_WAN,
2284972ec0SPaul Mundt 	TITAN_IRQ_LAN,
2384972ec0SPaul Mundt 	TITAN_IRQ_MPCIA,
2484972ec0SPaul Mundt 	TITAN_IRQ_MPCIB,
2584972ec0SPaul Mundt 	TITAN_IRQ_USB,
2684972ec0SPaul Mundt };
2784972ec0SPaul Mundt 
pcibios_map_platform_irq(const struct pci_dev * pdev,u8 slot,u8 pin)282b8ff9f2SMatthew Minter int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
2984972ec0SPaul Mundt {
3084972ec0SPaul Mundt 	int irq = titan_irq_tab[slot];
3184972ec0SPaul Mundt 
3284972ec0SPaul Mundt 	printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n",
3384972ec0SPaul Mundt 		slot, pin - 1 + 'A', irq);
3484972ec0SPaul Mundt 
3584972ec0SPaul Mundt 	return irq;
3684972ec0SPaul Mundt }
37