From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 28 17:04:05 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B3D916A422 for ; Mon, 28 Nov 2005 17:04:05 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id E34E643D53 for ; Mon, 28 Nov 2005 17:04:03 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2741921 for multiple; Mon, 28 Nov 2005 12:04:12 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jASH3rCJ058457; Mon, 28 Nov 2005 12:03:56 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 28 Nov 2005 11:15:27 -0500 User-Agent: KMail/1.8.2 References: <20051123092045.GA48216@mygiea.ham01.thiemo.net> <20051124111241.GB75190@mygiea.ham01.thiemo.net> <20051124.112632.65222526.imp@bsdimp.com> In-Reply-To: <20051124.112632.65222526.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511281115.28735.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: listmember@thiemo.net Subject: Re: Writing a driver for a card reader controller - how? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2005 17:04:05 -0000 On Thursday 24 November 2005 01:26 pm, M. Warner Losh wrote: > In message: <20051124111241.GB75190@mygiea.ham01.thiemo.net> > > Thiemo Nordenholz writes: > : Hi Warner, > : > : > to be set. Can you send me a pointer to the winbond datasheet you are > : > using? IIRC, this chip has an odd API since it appears to be derived > : > : As I have to wait for some spare time before trying to use the hints I > : have received here, for now I can only answer that question - I found a > : datasheet at > : http://www.winbond.com/e-winbondhtm/partner/PDFresult.asp?Pname=863 which > : is what I try to work with. (That page sends a file "PDFresult.asp", > : which is actually a PDF.) > > I've read through this pdf. As far as I can find, it just talks about > how to setup the base address for each of the sets of registers > without actually talking about the sets of registers themselves. Nor > can I find in the document a pointer to the different register sets. > Do you have one of those as well? It looks fairly easy to program > this device's base addresses or inquire what they are. It is done in > much the same way that super I/O chips are programmed. For an ACPI device you want to use _PRS and _SRS. _PRS will give you a list of candidate resource sets, possibly in groups via DPF tags. You then build a resource and do an _SRS to set it. The problem is that our ACPI bus isn't smart enough to allocate resources for a device when bus_alloc_resource() is called to choose available resources when a device is not configured. This is similar to how you fixed the PCI bus recently to allocate resources for BARs that weren't already allocated by the BIOS. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org