Bug 6827 - tpm driver can't find broadcom 1.1 tpm chip
Summary: tpm driver can't find broadcom 1.1 tpm chip
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-12 20:30 UTC by Michael PS
Modified: 2009-03-18 08:45 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.17.4
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
my little modified tpm_infineon (12.82 KB, text/plain)
2006-07-13 19:48 UTC, Michael PS
Details
dump of my dmesg after modprobe (782 bytes, text/plain)
2006-07-13 19:49 UTC, Michael PS
Details
my acpi dsdt table decompiled with iasm (171.80 KB, text/plain)
2006-07-13 19:51 UTC, Michael PS
Details
Randy's Dell D610 DSDT (iasl disassembled) (178.92 KB, text/plain)
2006-07-21 11:58 UTC, Randy Dunlap
Details
Dell D610 config for 2.6.18-rc4 (44.41 KB, text/plain)
2006-08-21 11:35 UTC, Randy Dunlap
Details
my current tpm_broadcom.c source file (13.06 KB, text/plain)
2006-08-21 11:37 UTC, Randy Dunlap
Details

Description Michael PS 2006-07-12 20:30:03 UTC
Most recent kernel where this bug did not occur:
Distribution: Gentoo
Hardware Environment: Dell latitude d610
Software Environment: Gentoo latest stable
Problem Description: TPM kernel driver can't find the Broadcom v1.7 TPM 1.1b chip 

tcsd -f (from trousers) responds " TDDL tddl.c:66 ERROR: Could not find a device
to open!"

I don't know how to solve this, can i debug the TPM driver somehow? Is it
possible to lookup my TPM hardware addresses and stuff somehow and then add
those to TPM.h or TPM.c ?  can't find anything in /proc or /sys

I would be very thankfull for some tips,

// best regards Michael
Comment 1 Randy Dunlap 2006-07-12 21:20:54 UTC
On Wed, 12 Jul 2006 20:32:57 -0700 bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=6827
> 
>            Summary: tpm driver can't find broadcom 1.1 tpm chip
>     Kernel Version: 2.6.17.4
>             Status: NEW
>           Severity: normal
>              Owner: drivers_other@kernel-bugs.osdl.org
>          Submitter: ps@member.fsf.org
> 
> 
> Most recent kernel where this bug did not occur:
> Distribution: Gentoo
> Hardware Environment: Dell latitude d610
> Software Environment: Gentoo latest stable
> Problem Description: TPM kernel driver can't find the Broadcom v1.7 TPM 1.1b chip 
> 
> tcsd -f (from trousers) responds " TDDL tddl.c:66 ERROR: Could not find a device
> to open!"

What TPM drivers are you trying to use?

Please attach your .config file to the bugzilla entry.

You could test this tpm patch which was just posted to lkml:
http://marc.theaimsgroup.com/?l=linux-kernel&m=115273837902316&w=2

I don't see any TPM debug driver facilities.

---
~Randy

Comment 2 Kylene J Hall 2006-07-13 08:08:05 UTC
There are only 1.1 drivers for Atmel, National/Winbond and Infineon and the 1.2
driver is vendor agnostic but only for 1.2 devices.
Comment 3 Randy Dunlap 2006-07-13 08:47:45 UTC
so is that a Rejected, WILL_NOT_FIX, or do we just leave it sitting here?
Comment 4 Michael PS 2006-07-13 10:09:51 UTC
yes. i am using driver tpm.ko and that automaticly loads tpm_bios.ko.
tpm_tis.ko finds the chip but tpm_tis.ko is for TPM version 2.0 and my chip is
TPM version 1.1b.so it produces a read/write errror to the chip when running
tcsd -f.

The patch you attached the url to is for tpm_tis. Therefore it is not for any
use to me. i'm sorry =(

I have all available tpm drivers compiled as modules and i have tried them all
without any success.

IS there some way i can write a tpm driver for the broadcom 1.1b TPM chip? 
isn't it possible to just add some specs to tpm.ko to make it find the broadcom
tpm v 1.1b chip?

Kylene: you ment 2.0 and not 1.2 right ????  in your post "the 1.2
driver is vendor agnostic but only for 1.2 devices."  ????

Thank you very much !

best regards Michael  

Comment 5 Kylene J Hall 2006-07-13 10:20:19 UTC
No the correct device version number is 1.2 not 2.0.  However you are correct
that if you have Broadcom 1.1 there is not a Linux kernel driver that I know of.
 If you want to write one.  I'd recommend modifying one of the exisiting 1.1
drivers.  The atmel one is the simplest but the infineon one has the pnp
register stuff based on an ACPI entry which is sounds like you do in fact have.
 I'd recommend modifying one of those two.
Comment 6 Michael PS 2006-07-13 19:48:51 UTC
Created attachment 8544 [details]
my little modified tpm_infineon
Comment 7 Michael PS 2006-07-13 19:49:44 UTC
Created attachment 8545 [details]
dump of my dmesg after modprobe
Comment 8 Michael PS 2006-07-13 19:51:18 UTC
Created attachment 8546 [details]
my acpi dsdt table decompiled with iasm

device BCM0101

cat acpi.dsdt | grep BCM0101
Comment 9 Michael PS 2006-07-13 19:56:24 UTC
Hi!

Yeah yoy are correct offcourse, TPM v 1.2 is correct. My bad =)

I am trying to create a driver for the TPM chip from a modified infineon driver
but i am not doing very well =(

modprobe fails with the msg "tpm_inf_pnp: probe of 00:0d failed with error -22"

I would realy appreciate some help, i don't know anything about programming or  
coding, never the less about kernel hacking =) if we can manage to create a
driver that can be shipped with the public kernel sources i think it would be a
great thing.

I hope you have time to help out.

best regards Michael
Comment 10 Kylene J Hall 2006-07-14 07:18:29 UTC
I just wanted to let you know I will take a look at it but it might be next week
before I can get to it.
Comment 11 Michael PS 2006-07-15 17:48:12 UTC
OK!

Very nice of you!

I'm absolutely not requesting you to do all the work, my ide
Comment 12 Kylene J Hall 2006-07-19 12:44:51 UTC
Ok the first couple of things to try.  The ven value that you got by attempting
to load the tpm_tis of 0XFFFF is most likely not correct.  Probably just comment
out that check for now.  Also where the values of TPM_INF_BASE and TPM_INF_LEN
are set can you print out their values.  I think from looking at ACPI the value
of TPM_INF_BASE should be 0x0930.  If it is not this value, try hard coding it
to that for now and seeing if you can get any farther.
Comment 13 Randy Dunlap 2006-07-21 10:48:33 UTC
I'm testing on a Dell D610 notebook with Broadcom TPM.
I modified the driver to use
#define	TPM_BROADCOM_DEV_VEN_VALUE	0x1166	// or 0x14e4 or 0x166d
My ACPI DSDT also reports base address = 0x930 and length - 0xc.
However, I'm never seeing the probe function being called.
Any clues on how to make that happen?
Comment 14 Kylene J Hall 2006-07-21 11:22:02 UTC
Randy- Can you show me what the dsdt table entry for TPM looks like on your
system?  The HID values that the driver is looking for is BCM0101 and BCM0102. 
You might try adding PNP0C31 which is the generic TPM device.  

Have you tried the tpm_tis driver to see if you have a 1.2 chip?  If you don't
have an ACPI entry at all you might try the force=1 option to that driver (new
in 2.6.18-rc2).

Comment 15 Randy Dunlap 2006-07-21 11:58:16 UTC
Created attachment 8595 [details]
Randy's Dell  D610 DSDT (iasl disassembled)
Comment 16 Randy Dunlap 2006-07-21 12:17:30 UTC
tpm_tis doesn't find anything.  force=1 didn't help (2.6.18-rc2).
The ACPI DSDT ID is BCM0101, which is already in the source file.

[  121.600000] pnp: the driver 'tpm_tis' has been registered
[  138.440000] pnp: the driver 'tpm_tis' has been unregistered

with force=1:
[  143.550000] tpm_tis tpm_tis: 1.2 TPM (device-id 0xFFFF, rev-id 255)
[  143.550000] tpm_tis tpm_tis: Unable to request irq: 255 for use
[  143.550000] tpm_tis tpm_tis: tpm_transmit: tpm_send: error 4294967291
[  143.550000] tpm_tis tpm_tis: tpm_transmit: tpm_send: error 4294967291
[  143.550000] tpm_tis tpm_tis: tpm_transmit: tpm_send: error 4294967291

tpm_broadcom:
[  257.140000] pnp: the driver 'tpm_bcm_pnp' has been registered
Comment 17 Michael PS 2006-07-21 21:12:40 UTC
Trying to uncomment #define TPM_BROADCOM_DEV_VEN_VALUE 0xFFFF results in a lot
of compiler errors, i've tried removing only 0xFFFF and commenting out the line
with a */

Kylene you wrote:  "Also where the values of TPM_INF_BASE and TPM_INF_LEN
are set can you print out their values."  i guessed that you ment i should try
and set the value of TPM_INF_BASE in the tpm_broadcom.c file so i tried removing
the ; and adding a =0x930 but that also resulted in a lot of compiler errors.

Have i missunderstood you and done totaly wrong? 

I am going away for two weeks now, but i'l continue when i get back.

Have a nice summer holliday!

best regards Michael
Comment 18 Kylene J Hall 2006-07-24 11:55:07 UTC
Ok I think you misunderstood my suggestions.

I'll try to clarify (working from the .c file you attached above).  Change the
if that contains == TPM_BROADCOM_DEV_VEN_VALUE on about line 436 to if(1) {.

Also, after lines 381 and 382 where TPM_INF_BASE and TPM_INF_PORT_LEN are set. 
Try putting something like: printk("TPM BASE: %02X, %02X\n", TPM_INF_BASE,
TPM_INF_PORT_LEN);  Then look for TPM_BASE in dmesg when you modprobe the
driver.  If you don't get sane values (probably something like 0x0930 and 0xC)
try replacing lines 381 and 382 with:
TPM_INF_BASE = 0x0903;
TPM_INF_PORT_LEN = 0x0C;

Hope that helps.
Comment 19 Randy Dunlap 2006-07-31 14:23:05 UTC
Kylene,
Any clues/hints on why the probe function is never being called for
tpm_broadcom on my Dell D610 notebook?
Thanks.
Comment 20 Kylene J Hall 2006-07-31 14:52:17 UTC
Sorry for getting side tracked when I initially looked at your question.  I
don't see anything obvious.  Try adding PNP0C01 to the id_table, since that
appears to be a duplicate entry of BCM0101 in your dsdt.
Comment 21 Randy Dunlap 2006-07-31 15:42:00 UTC
Darn, that didn't help.
Comment 22 Kylene J Hall 2006-07-31 17:10:52 UTC
If you just want to see if the driver works for your device you might try doing
something like the tis driver (which has an option for) or the atmel/nsc drivers
(use exclusively) and create a platform driver and device.

Comment 23 Michael PS 2006-08-19 09:00:15 UTC
I have no luck i'm afraid. 

i don't get any values or comments at all in dmesg.

Have you had any luck?

i'm feeling maybe to give this task a rest and not return to kernel hacking
until i get some years of experience in coding c...

Thanks for all the help!

best regards Michael
Comment 24 Randy Dunlap 2006-08-19 09:17:31 UTC
Nope, none at all.  The register & probe functions do nothing for me
as far as finding the device.
Comment 25 Kylene J Hall 2006-08-21 08:56:14 UTC
Randy- Do you have CONFIG_PNP_ACPI in you configuration?
Comment 26 Randy Dunlap 2006-08-21 11:35:34 UTC
Created attachment 8839 [details]
Dell D610 config for 2.6.18-rc4

Yes, CONFIG_PNPACPI=y.
Comment 27 Randy Dunlap 2006-08-21 11:37:34 UTC
Created attachment 8840 [details]
my current tpm_broadcom.c source file

tpm_broadcom.c source file that I am using.
Maybe I have something wrong...?
Comment 28 Kylene J Hall 2006-08-22 16:54:44 UTC
Ok a couple of things.  I don't see any type of CONFIG_TCG_BCM in your config
file.  Second the tpm driver has never worked to just load itself you must
explicitly modprobe tpm_broadcom.
Comment 29 Randy Dunlap 2006-08-22 17:02:38 UTC
Yes, there is no CONFIG_TPM_BCM or whatever since I don't have the driver
integrated into the kernel source tree.  I just build it and modprobe it.
I get the following messages when the module loads (due to PNP_DEBUG):

[  371.340000] pnp: the driver 'tpm_bcm' has been registered
[  371.340000] bus pnp: add driver tpm_bcm

and nothing else.  The driver's probe function is never called.
Comment 30 Natalie Protasevich 2008-03-26 00:23:48 UTC
Any updates on this problem? Did you have any luck updating the driver?
Thanks.
Comment 31 Randy Dunlap 2008-03-26 08:56:21 UTC
I had no luck and the TPM driver experts stopped responding or just got
busy on other things.

Note You need to log in before you can comment on or make changes to this bug.