From owner-freebsd-sparc64@FreeBSD.ORG Sun May 9 14:35:00 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE1F616A4CE for ; Sun, 9 May 2004 14:35:00 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id E6E4343D39 for ; Sun, 9 May 2004 14:34:59 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 28196 invoked by uid 65534); 9 May 2004 21:34:58 -0000 Received: from p50906FB8.dip.t-dialin.net (EHLO timesink.dyndns.org) (80.144.111.184) by mail.gmx.net (mp002) with SMTP; 09 May 2004 23:34:58 +0200 X-Authenticated: #5374206 Received: by abel (Postfix, from userid 1001) id E952E520; Sun, 9 May 2004 23:34:55 +0200 (CEST) Date: Sun, 9 May 2004 23:34:55 +0200 From: Thomas Moestl To: Joerg Wunsch Message-ID: <20040509213455.GA744@timesink.dyndns.org> References: <20040509171444.B63877@ida.interface-business.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040509171444.B63877@ida.interface-business.de> User-Agent: Mutt/1.5.6i cc: sparc64@freebsd.org Subject: Re: ebus resource allocation error? X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2004 21:35:01 -0000 On Sun, 2004/05/09 at 17:14:44 +0200, Joerg Wunsch wrote: > I'm currently investigating the chances of writing a driver for the > SUNW,envctrl device of my E450. Supposedly, this is an I²C bus, so > it's my hope to eventually setup the driver as a glue interface > between the Sun hardware and iicbus/smbus. > > This hardware has the curious (for me at least) situation that it > gets two IRQs assigned: > > SUNW,envctrl0: addr 0x1400600000-0x1400600003 irq 2021,2024 on ebus0 > > However, when trying to bus_alloc_resource the second IRQ, I always > get a resource allocation error. Since the code used for resource > allocation is basically the same as I've successfully been using to > allocate multiple IO port ranges in my auxio driver, I rather suspect > a problem in the ebus code itself. > > Below are the current probe messages, attached is the source code. > (Please do not redistribute by now, it's really only a stub driver.) > > SUNW,envctrl0: addr 0x1400600000-0x1400600003 irq 2021,2024 on ebus0 > SUNW,envctrl0: Got IRQ rid 0, start 0x7e8, count 0x1 > SUNW,envctrl0: Got IRQ rid 1, start 0x7e5, count 0x1 > SUNW,envctrl0: could not allocate resources: 2nd IRQ > device_probe_and_attach: SUNW,envctrl0 attach returned 6 >From e450 firmware property dumps I have lying around it seems likely that 0x7e5 is the power failure notification interrupt of one of the Psycho PCI bridges. The Psycho driver does not allocate it with RF_SHAREABLE (and neither does your code), thus the error. Would an envctrl driver actually need this interrupt, or does this just indicate that envctrl is the device that really triggers power failure interrupts? - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ "Where do we keep all our chainsaws, Mom?" -- Calvin and Hobbes