Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jun 2016 12:23:14 -0700
From:      "Lundberg, Johannes" <johannes@brilliantservice.co.jp>
To:        Ian Lepore <ian@freebsd.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Intel Atom I2C
Message-ID:  <CAASDrVmD8Z-vcRxvDRVaZ5HF7gdoMje6wVOnJgLf0mgmgUOgEg@mail.gmail.com>
In-Reply-To: <1466363501.34556.33.camel@freebsd.org>
References:  <CAASDrV==LFd1MxVP3ryXdZbvEuPdC%2Bevr4JwkBj-3KGDg4XR1Q@mail.gmail.com> <1466363501.34556.33.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Ian

Thanks for the info. I'll give it a try and see if I have more success.

I'm still uncertain about the role of the DMA controller though. If data
has to be relayed through it or if using it is optional..

Maybe some further testing will reveal the truth..

On Sunday, June 19, 2016, Ian Lepore <ian@freebsd.org> wrote:

> On Sun, 2016-06-19 at 11:36 -0700, Lundberg, Johannes wrote:
> > Hi
> >
> > I am trying to figure out how to get I2C support on Intel Atom x5
> > (Cherryview), which should be same for Baytrail platforms.
> >
> > On the Serial I/O device (PCI device 24) there are 8 devices.
> > #0 is DMA controller
> > #1-7 are I2C controllers (1 & 2 available on GPIO pins).
> >
> > I assume that all traffic to/from the I2C controllers must go via the
> > DMA
> > controller although I'm not 100% sure.
> >
> > In page 23 in the atom-z8000-datasheet-vol-2 there is a nice table of
> > the
> > PCI configuration space.
> >
> > On Linux they have
> > i2c/busses/i2c-designware-*
> > and
> > dma/dw/*
> > that takes care of the I2C and DMA parts.
> >
> > The ichiic (ig4) driver seems to be working on this platform and
> > looking
> > through the registers it seems to be basically the same as i2c
> > -designware
> > driver, but it doesn't not detect any devices on the I2C bus
> > (/dev/smbx).
> > (I have confirmed that the devices are recognized on Linux on the
> > same
> > device.)
> >
>
> There is no way to automatically detect devices on an i2c bus.  You
> can, with some incomplete success, detect which addresses are in use.
>  Even when you can detect there is a device at a given address, there
> is no way to figure out what that device is (and in some rare cases,
> even probing for the address being in use can perturb the device).
>
> So, in the linux case, something must be telling the OS which drivers
> to attach to which addresses.  I have no idea what that mechanism might
> be, if it's not FDT.
>
> In freebsd, you can specify i2c devices using FDT data, or hints.
>
> -- Ian
>
> > We also need a Mailbox (IOSF-SB MBI) driver and it is quite simple so
> > I
> > have already ported this.
> >
> > What is left to do I guess would be to implement a DMA driver that
> > works
> > with ig4 or create a new ig4 driver that is extended to use the DMA
> > controller, and implement the DMA controller driver.
> >
> > Implementing from scratch would be quite the undertaking. Can we
> > leverage
> > any existing DMA infrastructure for this?
> >
> > Any one interested in helping?
> >
> > I have a board called "UP" which is very similar to Raspberry Pi but
> > Intel
> > SoC. It has IC20 and IC21 available on the 40-pin connector.
> > Since it's Intel most stuff just works. Thanks to mmacy accelerated
> > graphics is also working (on separate branch).
> > It really is a great board for anyone who likes to tinker :)
> >
> >
> > References:
> > http://www.up-board.org/
> > http://lxr.linux.no/#linux+v4.6.2/drivers/i2c/busses
> > http://lxr.linux.no/#linux+v4.6.2/drivers/dma/dw
> > http://www.intel.com/content/www/us/en/processors/atom/atom-z8000-dat
> > asheet-vol-1.html
> > http://www.intel.com/content/www/us/en/processors/atom/atom-z8000-dat
> > asheet-vol-2.html
> >
> > Other TODO stuff:
> > Port Imer's GPIO driver from DragonFly
> > Add support for S0ix sleep states (would be useful for all new Intel
> > low
> > power laptops since Haswell)
> > And more...
> >
> > Thanks!
> > /Johannes
> >
>


--=20
Sent from Gmail Mobile

--=20
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
=E7=A7=98=E5=AF=86=E4=BF=9D=E6=8C=81=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=EF=
=BC=9A=E3=81=93=E3=81=AE=E9=9B=BB=E5=AD=90=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=
=AF=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E3=81=AB=E9=80=81=E4=BF=A1=E3=81=97=
=E3=81=9F=E3=82=82=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8A=E3=80=81=E7=A7=98=E5=
=8C=BF=E7=89=B9=E6=A8=A9=E3=81=AE=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81=AA=E3=82=
=8B=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=93=E3=81=A7=E3=81=84=E3=81=BE=
=E3=81=99=E3=80=82
=E3=82=82=E3=81=97=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E4=BB=A5=E5=A4=96=E3=
=81=AE=E6=96=B9=E3=81=8C=E5=8F=97=E4=BF=A1=E3=81=95=E3=82=8C=E3=81=9F=E5=A0=
=B4=E5=90=88=E3=80=81=E3=81=93=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AE=
=E7=A0=B4=E6=A3=84=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E3=81=93=E3=81=AE=E3=
=83=A1=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=B8=80=E5=88=
=87=E3=81=AE=E9=96=8B=E7=A4=BA=E3=80=81
=E8=A4=87=E5=86=99=E3=80=81=E9=85=8D=E5=B8=83=E3=80=81=E3=81=9D=E3=81=AE=E4=
=BB=96=E3=81=AE=E5=88=A9=E7=94=A8=E3=80=81=E3=81=BE=E3=81=9F=E3=81=AF=E8=A8=
=98=E8=BC=89=E5=86=85=E5=AE=B9=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8F=E3=81=84=
=E3=81=8B=E3=81=AA=E3=82=8B=E8=A1=8C=E5=8B=95=E3=82=82=E3=81=95=E3=82=8C=E3=
=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=8A=E9=A1=98=E3=81=84=E7=94=B3=E3=81=
=97=E4=B8=8A=E3=81=92=E3=81=BE=E3=81=99=E3=80=82
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAASDrVmD8Z-vcRxvDRVaZ5HF7gdoMje6wVOnJgLf0mgmgUOgEg>