From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 03:45:52 2003 Return-Path: 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 55A9837B401 for ; Wed, 6 Aug 2003 03:45:52 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EA1C43F3F for ; Wed, 6 Aug 2003 03:45:51 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h76AjhV3029325; Wed, 6 Aug 2003 10:45:43 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h76AjhPI040471; Wed, 6 Aug 2003 12:45:43 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: ticso@cicely.de From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 06 Aug 2003 12:40:01 +0200." <20030806104001.GD32228@cicely12.cicely.de> Date: Wed, 06 Aug 2003 12:45:43 +0200 Message-ID: <40470.1060166743@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 10:45:52 -0000 In message <20030806104001.GD32228@cicely12.cicely.de>, Bernd Walter writes: >On Wed, Aug 06, 2003 at 12:18:28PM +0200, Poul-Henning Kamp wrote: >> In message <20030806101148.GC32228@cicely12.cicely.de>, Bernd Walter writes: >> >I need to add I2C support for a Elan520 based soekris system. >> >The system has the required GPIO pins and there is the iicbb driver >> >to handle generic bitbang code - just needing a simple layer driver to >> >enable, disable and read pins. >> >But unlike normal isa/pci hardware probing the existence of the GPIO >> >line is a bit difficult. >> >The current elan-mmcr.c gets started from i386/pci/pci_bus.c at >> >host bridge probing, because that's seems to be the only place to >> >safely detect this special CPU. >> >> That's my doing, based on my reading of the datasheet from AMD. >> >> It would be better if we could detect the Elan in the normal CPU >> identification stuff, but I couldn't seem to find a reliable way. > >I could reread the datasheet, but don't give it much hope if you >hadn't find anything usefull. > >> >>From the logicaly standpoint the extensions had to be attached to >> >nexus, but nowhere is the current code path there is a handle for >> >nexus or any other device_t. >> >> In fact what you may want to do is hang the entire MMCR off the nexus >> as a bus, and hang the various drivers off that bus. > >What needs to be in *_probe() to conditionalize on elan existence? Well, my idea was to hang the mmcr bus on nexus when we find out it is an elan. It may be that you are not allowed to attach a bus to the nexus when we find out it is an elan in the host/pci bridge probe, but then I guess you could just hang it off that instead. Pressumably some newbus magic will then probe that bus. If its not an elan, there is no mmcr bus and nothing will get probed. I'm not the worlds greatest newbus specialist, so check this concept with somebody who know what they are talking about before you do it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.