From owner-freebsd-sparc64@FreeBSD.ORG Mon Feb 23 20:17:36 2009 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7F81065670 for ; Mon, 23 Feb 2009 20:17:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EEDE78FC16 for ; Mon, 23 Feb 2009 20:17:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 7AABA46B2A; Mon, 23 Feb 2009 15:17:35 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1NKHNhs018051; Mon, 23 Feb 2009 15:17:29 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marius Strobl Date: Mon, 23 Feb 2009 14:25:26 -0500 User-Agent: KMail/1.9.7 References: <1233668470.1364.45.camel@main.lerwick.hopto.org> <200902230905.23149.jhb@freebsd.org> <20090223181534.GB46006@alchemy.franken.de> In-Reply-To: <20090223181534.GB46006@alchemy.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902231425.26976.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 23 Feb 2009 15:17:29 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9034/Mon Feb 23 12:41:23 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-sparc64@freebsd.org Subject: Re: can anyone make available the whole usIII source tree from perforce please X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 20:17:36 -0000 On Monday 23 February 2009 1:15:34 pm Marius Strobl wrote: > On Mon, Feb 23, 2009 at 09:05:22AM -0500, John Baldwin wrote: > > On Sunday 22 February 2009 12:02:30 pm Marius Strobl wrote: > > > On Wed, Feb 18, 2009 at 01:24:00AM +0100, Florian Smeets wrote: > > > > On 04.02.2009 15:16 Uhr, Craig Butler wrote: > > > > >Hi Marius, > > > > > > > > > >Thanks for all your hard work and pointers so far. I have compiled and > > > > >installed the new kernel (cas is statically compiled in). Unfortunately > > > > >its panic'ing on boot with the following; > > > > > > > > > >cas0: at device 10.0 on pci0 > > > > >panic: trap: memory address not aligned > > > > >cpuid = 0 > > > > >Uptime: 1s > > > > > > > > > > > > > FWIW, i compiled a kernel with these changes and the cards probe fine. > > > > > > > > cas0: mem 0x2000000-0x21fffff at > > > > device 0.0 on pci1 > > > > miibus1: on cas0 > > > > cas0: 16kB RX FIFO, 9kB TX FIFO > > > > cas0: Ethernet address: 00:03:ba:XX:XX:XX > > > > cas0: [ITHREAD] > > > > cas1: mem 0x2400000-0x25fffff at > > > > device 1.0 on pci1 > > > > miibus2: on cas1 > > > > cas1: 16kB RX FIFO, 9kB TX FIFO > > > > cas1: Ethernet address: 00:03:ba:XX:XX:XX > > > > cas1: [ITHREAD] > > > > > > > > I don't have a cable connected yet, as the machine is remote, but I'll > > > > be sure to test it soon. > > > > > > > > > > FYI, the above panic likely isn't a problem of cas(4) but > > > arises from the fact that the resource of that NIC starts > > > at 0 according to its BAR, which is somewhat uncommon but > > > nevertheless should work yet seems to trigger a bug at > > > some other level. > > > > The PCI bus driver assumes a BAR of 0 is an invalid resource. There are many > > systems that use 0 to disable a BAR. I have no idea if "0" is a magic value > > to disable an individual BAR in the PCI spec itself, however. > > > > I'm aware of the former, my understanding of the pci(4) code > is that it won't pre-allocate such a resource but modulo bugs > treats it normally when a driver allocates it though. No, what will happen is that we don't create a resource list entry for it since it is zero. Then, when pci_alloc_resource() is called, it will see that there isn't a resource list entry and will attempt to allocate a fresh resource range for the BAR and assign it to the BAR. Perhaps we need to have some var in to indicate if 0 is a valid BAR address or not. Also, see pci_delete_resource() which assumes it can completely wipe a BAR by writing 0 to it. But you would need to patch pci_add_map() in a couple of places where it is testing base == 0 to basically ignore those tests to get it to use the 0 - N range. -- John Baldwin