1 /*
2  * FILE NAME
3  *	arch/mips/vr41xx/tanbac-tb0229/pci_fixup.c
4  *
5  * BRIEF MODULE DESCRIPTION
6  *	The TANBAC TB0229(VR4131DIMM) specific PCI fixups.
7  *
8  * Copyright 2003 Megasolution Inc.
9  *                matsu@megasolution.jp
10  *
11  *  This program is free software; you can redistribute it and/or modify it
12  *  under the terms of the GNU General Public License as published by the
13  *  Free Software Foundation; either version 2 of the License, or (at your
14  *  option) any later version.
15  */
16 #include <linux/config.h>
17 #include <linux/init.h>
18 #include <linux/pci.h>
19 
20 #include <asm/vr41xx/tb0229.h>
21 
pcibios_fixup_resources(struct pci_dev * dev)22 void __init pcibios_fixup_resources(struct pci_dev *dev)
23 {
24 }
25 
pcibios_fixup(void)26 void __init pcibios_fixup(void)
27 {
28 }
29 
pcibios_fixup_irqs(void)30 void __init pcibios_fixup_irqs(void)
31 {
32 #ifdef CONFIG_TANBAC_TB0219
33 	struct pci_dev *dev;
34 	u8 slot;
35 
36 	pci_for_each_dev(dev) {
37 		slot = PCI_SLOT(dev->devfn);
38 		dev->irq = 0;
39 
40 		switch (slot) {
41 		case 12:
42 			vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN , TRIGGER_LEVEL,
43 			                       SIGNAL_THROUGH);
44 			vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN, LEVEL_LOW);
45 			dev->irq = TB0219_PCI_SLOT1_IRQ;
46 			break;
47 		case 13:
48 			vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN , TRIGGER_LEVEL,
49 			                       SIGNAL_THROUGH);
50 			vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN, LEVEL_LOW);
51 			dev->irq = TB0219_PCI_SLOT2_IRQ;
52 			break;
53 		case 14:
54 			vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN , TRIGGER_LEVEL,
55 			                       SIGNAL_THROUGH);
56 			vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, LEVEL_LOW);
57 			dev->irq = TB0219_PCI_SLOT3_IRQ;
58 			break;
59 		default:
60 			break;
61 		}
62 
63 		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
64 	}
65 #endif
66 }
67 
pcibios_assign_all_busses(void)68 unsigned int pcibios_assign_all_busses(void)
69 {
70 	return 0;
71 }
72