Geode integrated peripherals support?

John-Mark Gurney gurney_j at resnet.uoregon.edu
Thu Jan 20 15:51:08 PST 2005


Milan Obuch wrote this message on Wed, Jan 19, 2005 at 10:00 +0100:
> On Wednesday 19 January 2005 01:43, John-Mark Gurney wrote:
> > Milan Obuch wrote this message on Mon, Jan 17, 2005 at 13:14 +0100:
> > > On Monday 17 January 2005 12:55, Bruce M Simpson wrote:
> > > > On Sun, Jan 16, 2005 at 03:01:17PM +0100, Milan Obuch wrote:
> > > > > ACCESS.bus support (i2c bus compatible) and LPC bus bridge (for
> > > > > expansion). The first one is present in OpenBSD. I am currently
> > > > > studying that and FreeBSD kernel sources to try port it, however, any
> > > > > help would be great. No idea on LPC, through...
> > > >
> > > > There's some i2c support in FreeBSD already, whether or not this
> > > > applies to the i2c hardware in the Geode I don't know. iic(4) would be
> > > > a good place to start.
> > >
> > > I think so. However, I built kernel with device iic, iicbus, iicbb, but
> > > nothing shows. As said, I am doing my 'homework' now - astudying sources,
> > > but, as usual, any help appreciated.
> >
> > Well, as having used the i2c code, I know it works...  You probably
> > need to look at the hardware spec, and figure out if you need to write
> > a iicbb device driver (one that directly controls the SCL/SDA lines), or
> > a higher level one, that has hardware that can issue i2c reads and wrights
> > directly...
> >
> > I recently d/l'd the ACCESS.bus spec myself, since I have a firewire/usb2.0
> > card that says it's an ACCESS.bus card, but not quite (the subrev is
> > wrong for access.bus), and didn't realize that ACCESS.bus was so close
> > to i2c..  There might need to be a layer written on top of i2c to make
> > it appear as an access.bus and do access.bus type things..
> 
> 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.

> 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..

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...

The callback function is used to make sure you don't colide with
another consumer trying to drive the bus...

> Actually the first thing I need to get working is simple LM75 sensor reading, 
> which is just i2c device, so nothing else (higher level access.bus layer) is 
> necessary for me.

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..

It's pretty simple to work with...

Let me know if you need more help..

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-hackers mailing list