|
@@ -32,7 +32,7 @@
|
|
|
|
|
|
#include "pci.h"
|
|
|
|
|
|
-static int __initdata s7a_workaround;
|
|
|
+static int __initdata s7a_workaround = -1;
|
|
|
|
|
|
#if 0
|
|
|
void pcibios_name_device(struct pci_dev *dev)
|
|
@@ -65,6 +65,7 @@ static void __init check_s7a(void)
|
|
|
struct device_node *root;
|
|
|
char *model;
|
|
|
|
|
|
+ s7a_workaround = 0;
|
|
|
root = of_find_node_by_path("/");
|
|
|
if (root) {
|
|
|
model = get_property(root, "model", NULL);
|
|
@@ -74,6 +75,24 @@ static void __init check_s7a(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void __devinit pSeries_irq_bus_setup(struct pci_bus *bus)
|
|
|
+{
|
|
|
+ struct pci_dev *dev;
|
|
|
+
|
|
|
+ if (s7a_workaround < 0)
|
|
|
+ check_s7a();
|
|
|
+ list_for_each_entry(dev, &bus->devices, bus_list) {
|
|
|
+ pci_read_irq_line(dev);
|
|
|
+ if (s7a_workaround) {
|
|
|
+ if (dev->irq > 16) {
|
|
|
+ dev->irq -= 3;
|
|
|
+ pci_write_config_byte(dev, PCI_INTERRUPT_LINE,
|
|
|
+ dev->irq);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void __init pSeries_request_regions(void)
|
|
|
{
|
|
|
if (!isa_io_base)
|
|
@@ -89,20 +108,6 @@ static void __init pSeries_request_regions(void)
|
|
|
|
|
|
void __init pSeries_final_fixup(void)
|
|
|
{
|
|
|
- struct pci_dev *dev = NULL;
|
|
|
-
|
|
|
- check_s7a();
|
|
|
-
|
|
|
- for_each_pci_dev(dev) {
|
|
|
- pci_read_irq_line(dev);
|
|
|
- if (s7a_workaround) {
|
|
|
- if (dev->irq > 16) {
|
|
|
- dev->irq -= 3;
|
|
|
- pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
phbs_remap_io();
|
|
|
pSeries_request_regions();
|
|
|
|