linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lanners <mlan@cpu.lu>
To: benh@kernel.crashing.org
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Problem in pmac PCI fixup
Date: Mon, 29 Apr 2002 21:34:43 +0200 (CEST)	[thread overview]
Message-ID: <E172GvB-00007O-00@piglet.grunz.lu> (raw)
In-Reply-To: <20020428151609.30064@smtp.wanadoo.fr>

[-- Attachment #1: Type: TEXT/plain, Size: 1369 bytes --]

Hi Ben,

On  28 Apr, this message from Benjamin Herrenschmidt echoed through cyberspace:
>>--- 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
>>@@ -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);
>>
>>Anybody have any problem with that approach?
>
> No problem with that, it's actually what we do in chrp.

Good then, can you apply the attached patch to any kernel tree within
your reach :) ?

I'll send off the Plan diff privately to you (it's quite a few K in
size...).

Cheers, and thanks

Michel

-------------------------------------------------------------------------
Michel Lanners                 |  " Read Philosophy.  Study Art.
23, Rue Paul Henkes            |    Ask Questions.  Make Mistakes.
L-1710 Luxembourg              |
email   mlan@cpu.lu            |
http://www.cpu.lu/~mlan        |                     Learn Always. "

[-- Attachment #2: pci-irq.diff --]
[-- Type: TEXT/plain, Size: 4316 bytes --]

--- 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 <asm/prom.h>
 #include <asm/pci-bridge.h>
 #include <asm/machdep.h>
-#include <asm/pmac_feature.h>
+#include <asm/feature.h>
 
 #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;
 	}
 }

      reply	other threads:[~2002-04-29 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-28 15:25 Problem in pmac PCI fixup Michel Lanners
2002-04-28 15:16 ` Benjamin Herrenschmidt
2002-04-29 19:34   ` Michel Lanners [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E172GvB-00007O-00@piglet.grunz.lu \
    --to=mlan@cpu.lu \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).