diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-10 13:30:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-10 13:30:08 -0400 |
commit | 3dd392a407d15250a501fa109cc1f93fee95ef85 (patch) | |
tree | c1faca3fa8bd0f7c8790b3e0887229b4a5a90e8b /arch/mips/pci/pci-ip27.c | |
parent | b27a43c1e90582facad44de67d02bc9e9f900289 (diff) | |
parent | d403a6484f0341bf0624d17ece46f24f741b6a92 (diff) |
Merge branch 'linus' into x86/pat2
Conflicts:
arch/x86/mm/init_64.c
Diffstat (limited to 'arch/mips/pci/pci-ip27.c')
-rw-r--r-- | arch/mips/pci/pci-ip27.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index bd78368c82bf..f97ab1461012 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c | |||
@@ -143,25 +143,47 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid) | |||
143 | */ | 143 | */ |
144 | int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 144 | int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
145 | { | 145 | { |
146 | return 0; | ||
147 | } | ||
148 | |||
149 | /* Most MIPS systems have straight-forward swizzling needs. */ | ||
150 | static inline u8 bridge_swizzle(u8 pin, u8 slot) | ||
151 | { | ||
152 | return (((pin - 1) + slot) % 4) + 1; | ||
153 | } | ||
154 | |||
155 | static inline struct pci_dev *bridge_root_dev(struct pci_dev *dev) | ||
156 | { | ||
157 | while (dev->bus->parent) { | ||
158 | /* Move up the chain of bridges. */ | ||
159 | dev = dev->bus->self; | ||
160 | } | ||
161 | |||
162 | return dev; | ||
163 | } | ||
164 | |||
165 | /* Do platform specific device initialization at pci_enable_device() time */ | ||
166 | int pcibios_plat_dev_init(struct pci_dev *dev) | ||
167 | { | ||
146 | struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus); | 168 | struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus); |
147 | int irq = bc->pci_int[slot]; | 169 | struct pci_dev *rdev = bridge_root_dev(dev); |
170 | int slot = PCI_SLOT(rdev->devfn); | ||
171 | int irq; | ||
148 | 172 | ||
173 | irq = bc->pci_int[slot]; | ||
149 | if (irq == -1) { | 174 | if (irq == -1) { |
150 | irq = bc->pci_int[slot] = request_bridge_irq(bc); | 175 | irq = request_bridge_irq(bc); |
151 | if (irq < 0) | 176 | if (irq < 0) |
152 | panic("Can't allocate interrupt for PCI device %s\n", | 177 | return irq; |
153 | pci_name(dev)); | 178 | |
179 | bc->pci_int[slot] = irq; | ||
154 | } | 180 | } |
155 | 181 | ||
156 | irq_to_bridge[irq] = bc; | 182 | irq_to_bridge[irq] = bc; |
157 | irq_to_slot[irq] = slot; | 183 | irq_to_slot[irq] = slot; |
158 | 184 | ||
159 | return irq; | 185 | dev->irq = irq; |
160 | } | ||
161 | 186 | ||
162 | /* Do platform specific device initialization at pci_enable_device() time */ | ||
163 | int pcibios_plat_dev_init(struct pci_dev *dev) | ||
164 | { | ||
165 | return 0; | 187 | return 0; |
166 | } | 188 | } |
167 | 189 | ||