^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * arch/sh/drivers/pci/ops-titan.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Ported to new API by Paul Mundt <lethal@linux-sh.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Modified from ops-snapgear.c written by David McCullough
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * PCI initialization for the Titan boards
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <mach/titan.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "pci-sh4.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static char titan_irq_tab[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) TITAN_IRQ_WAN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) TITAN_IRQ_LAN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) TITAN_IRQ_MPCIA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) TITAN_IRQ_MPCIB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) TITAN_IRQ_USB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) int irq = titan_irq_tab[slot];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) slot, pin - 1 + 'A', irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) return irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) }