From owner-freebsd-sparc Mon Mar 24 4:51:49 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C98337B401 for ; Mon, 24 Mar 2003 04:51:44 -0800 (PST) Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id A949543F75 for ; Mon, 24 Mar 2003 04:51:43 -0800 (PST) (envelope-from jake@k6.locore.ca) Received: from k6.locore.ca (localhost.locore.ca [127.0.0.1]) by k6.locore.ca (8.12.8/8.12.8) with ESMTP id h2OCvDxS078870; Mon, 24 Mar 2003 07:57:13 -0500 (EST) (envelope-from jake@k6.locore.ca) Received: (from jake@localhost) by k6.locore.ca (8.12.8/8.12.8/Submit) id h2OCv8ag078869; Mon, 24 Mar 2003 07:57:08 -0500 (EST) Date: Mon, 24 Mar 2003 07:57:08 -0500 From: Jake Burkholder To: Hidetoshi Shimokawa Cc: freebsd-sparc Subject: Re: PCI-PCI bridge Message-ID: <20030324075708.X76446@locore.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from simokawa@sat.t.u-tokyo.ac.jp on Mon, Mar 24, 2003 at 02:04:35PM +0900 X-Spam-Status: No, hits=-32.0 required=5.0 tests=IN_REP_TO,PATCH_UNIFIED_DIFF,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Apparently, On Mon, Mar 24, 2003 at 02:04:35PM +0900, Hidetoshi Shimokawa said words to the effect of; > Hi, > > I have a problem with PCI-PCI bridge on sparc64(sun ultra5) while > tesing firewire driver. > > I have a Adaptec card which has a firewire and a USB2 chips behind > PCI-PCI bridge. With this card the DMA trasfer speed is poor and > it sometimes causes timeout which leads to panic(*1). > > I finally found that this is because the PCI-PCI bridge > is not configured correctly and setting the cache line size in the > bridge by pciconf fixes the problem. > (pciconf -w -b pci1:1:0 0x0c 16) > > Sun's APB PCI-PCI bridges seem to be configured correctly but the one on > the card doesn't. > Who should configure such bridges? > Does upgrading firmware fix the problem? I think this is the firmware's job but it doesn't always do it. Updating the firmware may or may not help. We try to fix this up on startup by walking the device tree and initializing all the cache line size registers, but I notice that we don't do it for subordinate bridges, only for their child devices. You might try something like this (untested): Index: sparc64/pci/ofw_pci.c =================================================================== RCS file: /home/ncvs/src/sys/sparc64/pci/ofw_pci.c,v retrieving revision 1.9 diff -u -r1.9 ofw_pci.c --- sparc64/pci/ofw_pci.c 19 Feb 2003 05:47:44 -0000 1.9 +++ sparc64/pci/ofw_pci.c 24 Mar 2003 12:48:39 -0000 @@ -216,6 +216,8 @@ panic("ofw_pci_init: OF_getprop failed"); slot = OFW_PCI_PHYS_HI_DEVICE(pcir.phys_hi); func = OFW_PCI_PHYS_HI_FUNCTION(pcir.phys_hi); + PCIB_WRITE_CONFIG(dev, busno, slot, func, PCIR_CACHELNSZ, + clnsz / 4, 1); if (strcmp(type, OFW_PCI_PCIBUS) == 0) { /* * This is a pci-pci bridge, initalize the bus number and @@ -269,8 +271,6 @@ PCIB_WRITE_CONFIG(dev, busno, slot, func, PCIR_LATTIMER, imin(lat, 255), 1); } - PCIB_WRITE_CONFIG(dev, busno, slot, func, - PCIR_CACHELNSZ, clnsz / 4, 1); /* Initialize the intline registers. */ if ((intr = ofw_pci_route_intr(node, ign)) != 255) { Jake To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message