--- linux-2.4.19-pre6-lvm-gentoo/arch/ppc/kernel/pmac_pci.c Sun Apr 28 09:14:09 2002 +++ linux-2.4.16-planb/arch/ppc/kernel/pmac_pci.c Sun Apr 28 17:18:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_pci.c 1.34 03/22/02 10:45:30 benh + * BK Id: SCCS/s.pmac_pci.c 1.27 09/08/01 15:47:42 paulus */ /* * Support for PCI bridges found on Power Macintoshes. @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "pci.h" @@ -258,12 +258,21 @@ rev = in_8(bp->cfg_data); if (rev != BANDIT_REVID) printk(KERN_WARNING - "Unknown revision %d for bandit\n", rev); + "Unknown revision %d for bandit at %08lx\n", + rev, bp->io_base_phys); } else if (vendev != (BANDIT_DEVID_2 << 16) + PCI_VENDOR_ID_APPLE) { printk(KERN_WARNING "bandit isn't? (%x)\n", vendev); return; } + /* read the revision id */ + out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + PCI_REVISION_ID); + udelay(2); + rev = in_8(bp->cfg_data); + if (rev != BANDIT_REVID) + printk(KERN_WARNING "Unknown revision %d for bandit at %08lx\n", + rev, bp->io_base_phys); + /* read the word at offset 0x50 */ out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + BANDIT_MAGIC); udelay(2); @@ -273,7 +282,8 @@ magic |= BANDIT_COHERENT; udelay(2); out_le32((volatile unsigned int *)bp->cfg_data, magic); - printk(KERN_INFO "Cache coherency enabled for bandit/PSX\n"); + printk(KERN_INFO "Cache coherency enabled for bandit/PSX at %08lx\n", + bp->io_base_phys); } @@ -493,8 +503,6 @@ unsigned char pin; struct device_node* node; - if (pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin) || !pin) - continue; /* No interrupt generated -> no fixup */ node = pci_device_to_OF_node(dev); if (!node) { printk("No OF node for device %x:%x\n", dev->bus->number, dev->devfn >> 3); @@ -519,37 +527,29 @@ { struct device_node* node; int updatecfg = 0; - int uninorth_child; - + node = pci_device_to_OF_node(dev); - + /* We don't want to enable USB controllers absent from the OF tree * (iBook second controller) */ if (dev->vendor == PCI_VENDOR_ID_APPLE && dev->device == PCI_DEVICE_ID_APPLE_KL_USB && !node) return -EINVAL; - - if (!node) - return 0; - - uninorth_child = node->parent && - device_is_compatible(node->parent, "uni-north"); /* Firewire & GMAC were disabled after PCI probe, the driver is * claiming them, we must re-enable them now. */ - if (uninorth_child && !strcmp(node->name, "firewire") && + if (node && !strcmp(node->name, "firewire") && (device_is_compatible(node, "pci106b,18") || - device_is_compatible(node, "pci106b,30") || - device_is_compatible(node, "pci11c1,5811"))) { - pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, node, 0, 1); - pmac_call_feature(PMAC_FTR_1394_ENABLE, node, 0, 1); + device_is_compatible(node, "pci106b,30"))) { + feature_set_firewire_cable_power(node, 1); + feature_set_firewire_power(node, 1); updatecfg = 1; } - if (uninorth_child && !strcmp(node->name, "ethernet") && + if (node && !strcmp(node->name, "ethernet") && device_is_compatible(node, "gmac")) { - pmac_call_feature(PMAC_FTR_GMAC_ENABLE, node, 0, 1); + feature_set_gmac_power(node, 1); updatecfg = 1; } @@ -606,11 +606,10 @@ nd = find_devices("firewire"); while (nd) { if (nd->parent && (device_is_compatible(nd, "pci106b,18") || - device_is_compatible(nd, "pci106b,30") || - device_is_compatible(nd, "pci11c1,5811")) + device_is_compatible(nd, "pci106b,30")) && device_is_compatible(nd->parent, "uni-north")) { - pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0); - pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); + feature_set_firewire_power(nd, 0); + feature_set_firewire_cable_power(nd, 0); } nd = nd->next; } @@ -618,7 +617,7 @@ while (nd) { if (nd->parent && device_is_compatible(nd, "gmac") && device_is_compatible(nd->parent, "uni-north")) - pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); + feature_set_gmac_power(nd, 0); nd = nd->next; } }