11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * arch/sh/drivers/pci/ops-snapgear.c
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Author:  David McCullough <davidm@snapgear.com>
5959f85f8a3223c116bbe95dd8a9b207790b5d4d3Paul Mundt *
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Ported to new API by Paul Mundt <lethal@linux-sh.org>
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * May be copied or modified under the terms of the GNU General Public
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * License.  See linux/COPYING for more information.
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * PCI initialization for the SnapGear boards
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/kernel.h>
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/types.h>
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/init.h>
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/pci.h>
1958796ce67a80e8725220af83c5a550bf6a4dab12Paul Mundt#include <linux/sh_intc.h>
20959f85f8a3223c116bbe95dd8a9b207790b5d4d3Paul Mundt#include "pci-sh4.h"
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
22d5341942d784134f2997b3ff82cd63cf71d1f932Ralf Baechleint __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int irq = -1;
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	switch (slot) {
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	case 8:  /* the PCI bridge */ break;
2858796ce67a80e8725220af83c5a550bf6a4dab12Paul Mundt	case 11: irq = evt2irq(0x300); break; /* USB    */
2958796ce67a80e8725220af83c5a550bf6a4dab12Paul Mundt	case 12: irq = evt2irq(0x360); break; /* PCMCIA */
3058796ce67a80e8725220af83c5a550bf6a4dab12Paul Mundt	case 13: irq = evt2irq(0x2a0); break; /* eth0   */
3158796ce67a80e8725220af83c5a550bf6a4dab12Paul Mundt	case 14: irq = evt2irq(0x300); break; /* eth1   */
3258796ce67a80e8725220af83c5a550bf6a4dab12Paul Mundt	case 15: irq = evt2irq(0x360); break; /* safenet (unused) */
331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	}
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n",
361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	       slot, pin - 1 + 'A', irq);
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	return irq;
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}
40