tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Regarding recently Added TPM2.0 support to the Nuvoton i2c driver
@ 2016-07-26 18:14 Nayna
       [not found] ` <5797A893.9020205-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Nayna @ 2016-07-26 18:14 UTC (permalink / raw)
  To: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: David Heller, George Wilson

Hi

I might not be aware of some background related to TPM device driver 
design and so have got few questions regarding recently added support in 
Nuvoton i2c driver for TPM2.0 
(http://git.infradead.org/users/jjs/linux-tpmdd.git/commit/82cc1a49b6358394938e759dc4c22b2be773bbad). 
I got these questions while testing some TPM2.0 stuff using the kernel 
code from repo having this patch and am using Nuvoton TPM.

#1. It seems that support is added only for following device-ids.
         {.compatible = "nuvoton,npct501"},
         {.compatible = "winbond,wpct301"},
         {.compatible = "nuvoton,npct601", .data = OF_IS_TPM2},

So, was wondering about why device id nuvoton,npct650  wasn't added for 
the support ?

Was it expected to work with some wild-card type device-id as specified 
in the first line of description comment of file i.e. npct6XX. ?
/**
* Nuvoton TPM I2C Device Driver Interface for WPCT301/NPCT501/NPCT6XX,
........
**/

Also, the patch log message says "tpm: Add TPM 2.0 support to the 
Nuvoton i2c driver (NPCT6xx family)" i.e. NPCT6xx family, so my 
assumption was that it will work with any NPCT6xx device id.

#2 Was also trying to understand why the .data is hardcoded for 
nuvoton,npct601, but not for other device ids ?

And I see that this device-id .data info is then used in 
i2c_nuvoton_probe() method to set the tpm_chip flag as TPM2 device
        if (dev->of_node) {
                 const struct of_device_id *of_id;
                 printk("dev->of_node if\n");
                 of_id = of_match_device(dev->driver->of_match_table, dev);
                 if (of_id && of_id->data == OF_IS_TPM2)
                 {
                         printk("of_id->data == OF_IS_TPM2\n");
                         chip->flags |= TPM_CHIP_FLAG_TPM2;
                 }
         } else
         {
                 printk("dev->of_node else\n");
                 if (id->driver_data == I2C_IS_TPM2)
                 {

                         printk("id->driver_data == I2C_IS_TPM2\n");
                         chip->flags |= TPM_CHIP_FLAG_TPM2;
                 }
         }


So, why is there hard-coded checking and not using tpm2_probe() method 
which is itself based on direct TPM hardware response for setting the 
TPM2 flag. ? Is there something I am missing in the design which 
mandates to have .data set as OF_IS_TPM2.

Please let me know.


Thanks & Regards,
    - Nayna


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-08-26  3:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-26 18:14 Regarding recently Added TPM2.0 support to the Nuvoton i2c driver Nayna
     [not found] ` <5797A893.9020205-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-07-26 20:17   ` Jason Gunthorpe
     [not found]     ` <20160726201711.GA17742-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-26 20:39       ` George Wilson
     [not found]         ` <20160726203902.GA17730-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2016-07-26 21:03           ` Jason Gunthorpe
     [not found]             ` <20160726210344.GA18332-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 16:05               ` George Wilson
     [not found]                 ` <20160727160511.GA26597-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2016-07-27 16:31                   ` Jason Gunthorpe
     [not found]                     ` <20160727163152.GA27915-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 21:46                       ` George Wilson
2016-07-27 14:30       ` Dave Heller
     [not found]         ` <5798C571.1000309-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-07-27 16:24           ` Jason Gunthorpe
     [not found]             ` <20160727162415.GA18843-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 17:27               ` Dave Heller
     [not found]                 ` <5798EEFB.1000004-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-07-27 17:42                   ` Jason Gunthorpe
     [not found]                     ` <20160727174229.GA28681-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 22:34                       ` George Wilson
     [not found]                         ` <20160727223419.GA6132-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2016-07-29  6:40                           ` Nayna
2016-08-26  3:49       ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).