From owner-cvs-all@FreeBSD.ORG Tue Jan 27 13:16:29 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EAAD16A4CE; Tue, 27 Jan 2004 13:16:29 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFEB643D31; Tue, 27 Jan 2004 13:15:58 -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 i0RLDtET097490; Tue, 27 Jan 2004 14:13:55 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 27 Jan 2004 14:13:50 -0700 (MST) Message-Id: <20040127.141350.122061896.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <20040127112940.W37323@root.org> References: <200401270604.i0R64Fpc076025@repoman.freebsd.org> <20040127.091238.05978307.imp@bsdimp.com> <20040127112940.W37323@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: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 bus_alloc_resource.9 bus_set_resource.9 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 21:16:29 -0000 In message: <20040127112940.W37323@root.org> Nate Lawson writes: : On Tue, 27 Jan 2004, M. Warner Losh wrote: : > In message: <200401270604.i0R64Fpc076025@repoman.freebsd.org> : > Nate Lawson writes: : > : njl 2004/01/26 22:04:15 PST : > : : > : FreeBSD src repository : > : : > : Modified files: : > : share/man/man9 bus_alloc_resource.9 bus_set_resource.9 : > : Log: : > : Document my adventures in newbus land. Clarify some examples, especially : > : that count is in bytes, not bits. There are some drivers that I think make : > : this mistake. (I've seen counts of 16 in the tree). : > : > Counts of 16 in the tree are likely correct. Many devices have 8 or : > 16 or 32 io ports in ISA land. I've not seen any drivers make this : > mistake. Care to give an example? : : Well, for one ichsmb(4). It allocates 16 IO ports but only uses 8 : according to its .h. The netgraph bt3c driver allocates 8 but only uses : 5. I'm curious if wi/owi really need 64 IO ports. Yes, wi/owi really does need 64 ports! At least for some of the boards (32 is typically, although there's some that decode '48' which really means 64). Both the PCI and pccard code, however, do the right thing and ignore this number and allocate the actual size rounded to a power of 2. As far as allocating 16 and using 8, that's not a bits/bytes error. It might be an alignment requirement for the hardware (eg, there really are 16 bytes being decoded, the upper 8 being reserved). The using only 5 isn't unusual either: most hardware only decodes based on a multiple of 2. We have several hunks of hardware that have 6 or 7 registers, but decode either 8 or 16 I/O addresses. Remember, you must reserve what the hardware decodes, even if it only uses a subset of the register space for normal operations. Warner