[MinnowBoard] [edk2] i2cdetect inconsistency/problem

John Hawley john.hawley at intel.com
Tue Aug 18 03:29:29 UTC 2015


On 8/17/2015 1:30 PM, Gerard Bucas wrote:
> 
> Hi All,
> 
> I have some problems and inconsistencies on i2c bus on my minnowBoard MAX.
> Two problems:
> 
> 1. When I run "i2cdetect -l"  on the same board with my yocto project build
> and then again with running Ubuntu 14.04.3 LTS I get different listing for
> i2c buses.

The biggest culprit here is a common problem inherent in many Linux
subsystems, and that boils down to in what order drivers get loaded
can/does determine what bus numbers things get.  Storage had/has this
problem, for instance if you have multiple drives on multiple
(different) controllers in a machine, what drive gets sda, sdb, etc?
What you are likely seeing between a Yocto Project derived distro and
Ubuntu, is a different ordering of the devices and/or one of the distros
having a different set of drivers for the devices on the board.

> 2. Even though I have no lures attached (so basic MinnowBoad MAX, "A2" with
> 0.81 or 0.82 firmware - same result), "i2cdetect -y N" (where N is different
> for yocto & Ubuntu) shows a number of i2c devices detected which I assume
> should not be there!?

I2C is used for things other than the High and Low Speed expansion
busses, it's used to read EDID information from monitors for instance,
and other devices on the motherboard (temperature sensors) could be
present on those buses (I don't remember if we have any on there, I'm
just pointing out that they could be there).  There are 7 or so I2C
buses on the MinnowBoard, we only have 2 dedicated to expansion boards.
 The other interfaces will be present if you load i2c-dev, they aren't
masked just because they aren't present on either of the expansion headers.

Also keep in mind that the I2C interfaces that are on the two expansion
headers do *NOT* have a full kernel SMBus implementation, and thus some
SMBus (not I2C) devices will not show up in a scan of the I2C bus via
i2cdetect, but are still usable by address them directly.  I've now run
into a couple of devices that make no claims to SMBus compatibility,
only I2C, but that are more SMBus than I2C in their interface (and thus
have that problem).

> I have two questions:
> 
> 1. Where does i2cdetect get the "i2c adapter" bus names? How can they be
> different with same firmware & hardware & linux kernel (between yocto &
> Ubuntu)? Is this from some firmware or OS config?

See my answer above on the ordering, different distros may load things
in different orders, and depending on how things boot it's actually
possible (though usually very unlikely) for the ordering to be random.
If this is an issue (and you are seeing random ordering), you can always
create udev rule (like the persistent network rules) to force a specific
name for the i2c-dev name for a bus.

> 2. Why are all those i2c devices detected by BOTH yocto linux and Ubuntu!?
> Where do they come from? Is this due to some firmware or OS config? 

There are other things using I2C outside of the expansion headers, and
some of the buses have devices attached.  I don't have an exhaustive
list of what they all are, some delay with display, some with other
aspects of the platform.

> Below are the i2cdetect outputs from both my yocto and Ubuntu OS's (NOTE:
> both are using the linux 3.19 kernel):
> 
> YOCTO:
> # uname -a
> Linux intel-corei7-64 3.19.5-yocto-standard #1 SMP PREEMPT Fri Aug 14
> 00:21:30 UTC 2015 x86_64 GNU/Linux
> 
> #modprobe i2c-dev
> #i2cdetect -l
> i2c-0	i2c       	i915 gmbus ssc                  	I2C adapter
> i2c-1	i2c       	i915 gmbus vga                  	I2C adapter
> i2c-2	i2c       	i915 gmbus panel                	I2C adapter
> i2c-3	i2c       	i915 gmbus dpc                  	I2C adapter
> i2c-4	i2c       	i915 gmbus dpb                  	I2C adapter
> i2c-5	i2c       	i915 gmbus dpd                  	I2C adapter
> i2c-6	i2c       	DPDDC-B                         	I2C adapter
> 
> #i2cdetect -y 4
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 30: 30 -- -- -- -- -- -- 37 -- -- 3a -- -- -- -- -- 
> 40: -- -- -- -- -- -- -- -- -- -- 4a 4b -- -- -- -- 
> 50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
> 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 70: -- -- -- -- -- -- -- --                         
> 
> UBUNTU:
> # uname -a
> Linux tekmagic 3.19.0-26-generic #28~14.04.1-Ubuntu SMP Wed Aug 12 14:09:17
> UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
> 
> # modprobe i2c-dev
> 
> # i2cdetect -l
> i2c-0	i2c       	Synopsys DesignWare I2C adapter 	I2C adapter
> i2c-1	i2c       	Synopsys DesignWare I2C adapter 	I2C adapter
> i2c-2	i2c       	i915 gmbus ssc                  	I2C adapter
> i2c-3	i2c       	i915 gmbus vga                  	I2C adapter
> i2c-4	i2c       	i915 gmbus panel                	I2C adapter
> i2c-5	i2c       	i915 gmbus dpc                  	I2C adapter
> i2c-6	i2c       	i915 gmbus dpb                  	I2C adapter
> i2c-7	i2c       	i915 gmbus dpd                  	I2C adapter
> i2c-8	i2c       	DPDDC-B                         	I2C adapter
> 
> # i2cdetect -y 6
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 30: 30 -- -- -- -- -- -- 37 -- -- 3a -- -- -- -- -- 
> 40: -- -- -- -- -- -- -- -- -- -- 4a 4b -- -- -- -- 
> 50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
> 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 70: -- -- -- -- -- -- -- --                         

That looks like, specifically, you don't have the Synopsys DesignWare
I2C adapter driver built in your Yocto based OS, I'd suggest adding it
as that's the chunk of SoC silicon that is attached to the HSE and LSE,
assuming you want to make use of those from under Yocto.

- John 'Warthog9' Hawley


More information about the elinux-MinnowBoard mailing list