From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 21 15:26:15 2005 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 DD3A716A4CE for ; Fri, 21 Jan 2005 15:26:15 +0000 (GMT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1721C43D46 for ; Fri, 21 Jan 2005 15:26:15 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0)j0LFPaHo021411 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 21 Jan 2005 16:25:38 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j0LFOkU3063508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Jan 2005 16:24:47 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j0LFOkwL016689; Fri, 21 Jan 2005 16:24:46 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j0LFOiKP016688; Fri, 21 Jan 2005 16:24:44 +0100 (CET) (envelope-from ticso) Date: Fri, 21 Jan 2005 16:24:44 +0100 From: Bernd Walter To: Milan Obuch Message-ID: <20050121152443.GK8860@cicely12.cicely.de> References: <200501141015.37516.bsd@dino.sk> <200501191000.51574.bsd@dino.sk> <20050120235104.GV19624@funkthat.com> <200501210652.42328.bsd@dino.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501210652.42328.bsd@dino.sk> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.64 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on cicely12.cicely.de cc: freebsd-hackers@freebsd.org Subject: Re: Geode integrated peripherals support? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2005 15:26:16 -0000 On Fri, Jan 21, 2005 at 06:52:41AM +0100, Milan Obuch wrote: > On Friday 21 January 2005 00:51, John-Mark Gurney wrote: > > Milan Obuch wrote this message on Wed, Jan 19, 2005 at 10:00 +0100: > > > > [skip] > > > Great, could we cooperate? > > > > Sure, though Joerg Wunsch has been doing work w/ I2C more recently than > > me, so you might want to drop him an email. > > > > Is he on this list? I have no other idea how coould I reach him. > > > > I know there are two modes - bit banging software i2c bus and real > > > hardware controller. Which one would be easier to begin with? With geode, > > > both are possible. Pins designed for ACCESS.bus (at least the second, > > > there are two buses integrated) can be used as GPIO pins. > > > > The hardware I worked on was bit banging only, so I used that interface > > and it was surprisingly easy, since you just define an interface that > > will get called by the i2c bus to do the necessary toggling... Of course > > this is more cpu intensive since it requires timing and other things > > like that.. > > > > Maybe I will try to make bit banged version first. Just when I find all the > subtle details necessary to toggle pins... You just need to know 3 things: - how to drive the line low - how to toggle the line into high impedance - how to ask line status > > Take a look at sys/dev/iicbus/iic*_if.m. Those are the two different > > programming interfaces. You of course just need to do one of the two... > > > > I did. Actually first I must figure how this all contributes to total > picture... I am on my way. I must first know the hardware part, which is not > that easy on the first stage, but I am reading through specs, some examples, > mostly in assembly. I am doing my homework :) > > [skip] > > > > You can take a look at lpbb for a simple example of the bit banging > > interface... sys/dev/ppbus/lpbb.c The other controllers also implement > > iicbus directly.. You can look at the modules/i2c/contollers/*/Makefile > > to see who uses iicbus_if.h to see examples that implement it.. > > > > On the other side - what is sys/dev/pcf directory for? I do not see those > files referenced elsewhere... Other than that, device pcf looks like the best > candidate to work with. I would like to use integrated controller, naturally. pcf(4) ist the driver for Philips PCF8584 i2c controller chips. Those or compatible of them are often used on non i386 hardware or add on cards - they are also often used in european consumer hardware such as video recordes and TVs. x86 chipsets usually do bit bang on GPIO or implement smbus controllers. smbbus is a special variant of i2c with specified command cycles. While smbus controllers can do more for you than i2c it is less generic when talking to plain i2c hardware. It is largely preferable to support hardware controllers if you have one - not only for performance and efficiency reason, but also because it is almost impossible to get the timming correct for doing multi master support. FreeBSD bit bang driver also doesn't support multi master for that reason, but it just requires you to implement line toggling functions. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de