[MinnowBoard] Using a TPM on the MinnowBoard connected with I2C

John Hawley john.hawley at intel.com
Tue Nov 17 18:53:17 UTC 2015


Good to hear, and yes I2C numbering is, slightly, non-deterministic
because of driver loading ordering.  I.E. we are running into exactly
the same issue that ethernet and storage devices have already run into
on i2c, spi, gpio, etc.

Best way to look it up (for anyone stumbling over this in the future) is
to run `i2cdetect -l` thusly:
	# 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
	i2c-7   i2c             Synopsys DesignWare I2C adapter
	I2C adapter
	i2c-8   i2c             Synopsys DesignWare I2C adapter
	I2C adapter
	i2c-9   smbus           SMBus I801 adapter at 2000
	SMBus adapter

And the busses (for the MinnowBoard MAX / Turbot anyway) are the
DesignWare ones, which as you can see above are on 7 and 8, and it's
known that several Debian based kernels (Debian itself and Ubuntu
seemingly) tend to enumerate the DesignWare adapters at 1 & 2 respectively.

Need to sit down and create some better auto detection code into our
example modules so that it's not hard coded like it is now.

- John

On 11/17/2015 09:40 AM, Sebastien Duc wrote:
> Quick update.
> I managed to figure out that bus 7 was not the right one and discovered
> that it was bus 1 (/dev/i2c-1).
> I used it in my kernel module with slave address 0x29 and I can now to
> talk to the TPM.
> Thanks a lot John for the help.
> 
> Sebastien
> 
> On 17 November 2015 at 15:40, Sebastien Duc <sebastien.duc at yoti.com
> <mailto:sebastien.duc at yoti.com>> wrote:
> 
>     Thanks John for the reply.
>     I created a kernel module very similar to ones on github as you
>     said. But I cannot load it successfully.
>     From what you said my understanding is that I need to find the i2c
>     bus and the slave address of the TPM chip.
>     I found on Google that the bus should be i2c-7. When using
>     i2c-detect on 7 I get  i2c slaves at multiple addresses:
>     0x37, 0x3a, 0x49, 0x50 and 0x59.
>     How do I know which one I should use? I found on this
>     page https://github.com/theopolis/tpm-i2c-atmel that the address
>     should be 0x29 but that address does not appear in i2c-detect. Any
>     clue why?
> 
>     Thanks,
>     Sebastien
> 
>     On 16 November 2015 at 18:00, John "Warthog9" Hawley
>     <warthog19 at eaglescrag.net <mailto:warthog19 at eaglescrag.net>> wrote:
> 
>         Apologies for briefness in this, I'm traveling, but the reason
>         this isn't working is the kernel needs to be informed where the
>         Atmel chip is. The quickest way is to write a small kernel
>         module typically referred to as a board file. You can find an
>         example of several of these in the minnow-max-extras repo on
>         github. Basically you need to load the bus, and address of where
>         the Atmel chip is, since it can't be auto discovered like pci,
>         usb, etc.
> 
>         - John "Warthog9" Hawley
> 
> 
>         On November 16, 2015 10:11:49 AM CST, Sebastien Duc
>         <sebastien.duc at yoti.com <mailto:sebastien.duc at yoti.com>> wrote:
> 
>             Hi all,
> 
>             Please bare with me if something I am saying is wrong, I
>             don't have much experience with TPMs or I2C.
> 
>             I recently acquired a minnowboard max to attempt some
>             experimentation with TPMs.
>             I have also bought a separate TPM from Atmel (it's the TPM
>             i2c development Kit AT97SC3205T).
> 
>             So far I have connected the TPM board to the Minnowboard
>             through i2c. I made sure to connect pin 2 (the ground) and 4
>             (+3V3) of the Minnowboard to the corresponding GND and VCC
>             of my TPM board. I also connected pin 13 (SCL) and 15 (SDA)
>             to the corresponding SCL and SDA of the TPM board.
> 
>             I have installed Debian on the board and made sure to build
>             a kernel that has tpm_i2c_atmel as a module. The version of
>             my kernel is 4.3.0.
> 
>             Now I am trying to load the kernel module as so:
>             # insmod tpm_i2c_atmel.ko
> 
>             The insmod is being executed without any errors and I cannot
>             see anything in dmesg.
>             However when looking at my devices, I don't see any tpm0 in
>             /dev.
> 
>             I can also see tpm_i2c atmel.ko in the list of loaded
>             modules when looking at
>             # lsmod
> 
>             Therefore when I am trying to start tcsd, it fails:
>             # tcsd -f
>             # TCSD TDDL ERROR: Could not find a device to open!
> 
>             I also made sure in the BIOS  to enable Discrete TPM.
> 
>             So my guess is that either my TPM is not properly connect
>             but I don't really know how to test this. Or I am missing
>             some software configuration somewhere.
> 
>             I was hoping that someone could help me with this. How can I
>             know if I did the connectivity properly? What configuration
>             do I need to do before being able to talk to the TPM,
>             especially to use the i2c pins on the Minnowboard?
>             __
>             Let me know if you need more information.
> 
>             Thanks,
>             Sebastien
> 
>         ------------------------------------------------------------------------
> 
>         elinux-MinnowBoard mailing list
>         elinux-MinnowBoard at lists.elinux.org
>         <mailto:elinux-MinnowBoard at lists.elinux.org>
>         http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
> 
> 
> 
> 
> 
> _______________________________________________
> elinux-MinnowBoard mailing list
> elinux-MinnowBoard at lists.elinux.org
> http://lists.elinux.org/mailman/listinfo/elinux-minnowboard
> 


More information about the elinux-MinnowBoard mailing list