From owner-freebsd-arch@FreeBSD.ORG Mon Jan 26 14:17:33 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E88D916A4CE for ; Mon, 26 Jan 2004 14:17:33 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1A1D43D1F for ; Mon, 26 Jan 2004 14:17:32 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id i0QMHWET082623; Mon, 26 Jan 2004 15:17:32 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 26 Jan 2004 15:17:28 -0700 (MST) Message-Id: <20040126.151728.133912536.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <20040126140100.T29680@root.org> References: <20040126140100.T29680@root.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org Subject: Re: newbus ioport usage X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 22:17:34 -0000 In message: <20040126140100.T29680@root.org> Nate Lawson writes: : I have a driver that knows the IO port it wants. It's not set up by a : parent bus, so I can't use bus_set_resource(). This call returns NULL. : Any idea how to debug why newbus is rejecting this request? The io port : is not in use and the rid is unique. : : bus_alloc_resource(dev, SYS_RES_IOPORT, rid, 0x101c, 0x101c, 1, : RF_ACTIVE); Ummm, you can use bus_set_resource() in the driver to do this (I've done it before). bus_set_resource() should return 0 to indicate success. bus_alloc_resource should then succeed. There may be one other step to do as well to make this work, but I'm not sure if it is an internal convention or actually required. The pci bus code does a resource_list_add for each of the resources the child uses, but I think that's an internal thing to the pci bus (that other busses do also). Warner