On 09/29/2016 04:34 PM, Jarkko Sakkinen wrote:
> On Wed, Sep 28, 2016 at 04:30:40AM -0400, Nayna Jain wrote:
>> Virtual TPM, which is being used on IBM POWER7+ and POWER8 systems running
>> POWERVM, is currently supported by tpm device driver but lacks the
>> documentation. This patch adds the missing documentation for the existing
>> support.
>>
>> Suggested-by: Jason Gunthorpe <jguntho...@obsidianresearch.com>
>> Signed-off-by: Nayna Jain <na...@linux.vnet.ibm.com>
>> ---
>> Changelog v2:
>>
>> - New Patch
>>
>>   .../devicetree/bindings/security/tpm/ibmvtpm.txt   | 41 
>> ++++++++++++++++++++++
>>   1 file changed, 41 insertions(+)
>>   create mode 100644 
>> Documentation/devicetree/bindings/security/tpm/ibmvtpm.txt
>>
>> diff --git a/Documentation/devicetree/bindings/security/tpm/ibmvtpm.txt 
>> b/Documentation/devicetree/bindings/security/tpm/ibmvtpm.txt
>> new file mode 100644
>> index 0000000..d89f999
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/security/tpm/ibmvtpm.txt
>> @@ -0,0 +1,41 @@
>> +* Device Tree Bindings for IBM Virtual Trusted Platform Module(vtpm)
>> +
>> +Required properties:
>> +
>> +- compatible            : property name that conveys the platform 
>> architecture
>> +                          identifiers, as 'IBM,vtpm'
>> +- device_type           : specifies type of virtual device
>
> A generic device tree question. What is the difference between
> these fields? Why the I2C one does have 'device_type'?

Please find the details as below:

compatible - Standard property name as per IEEE 1275, specifying the 
interface compatible with this device. This property is consumed by 
linux kernel for selection of device driver.

device_type - Standard property name as per IEEE 1275, specifying the 
device type. This property MAY be used by linux kernel for device driver 
selection. It is used in the case of IBM virtual TPM driver.

/**
  * vio_register_device_node: - Register a new vio device.
  * @of_node:    The OF node for this device.
  *
  * Creates and initializes a vio_dev structure from the data in
  * of_node and adds it to the list of virtual devices.
  * Returns a pointer to the created vio_dev or NULL if node has
  * NULL device_type or compatible fields.
  */
struct vio_dev *vio_register_device_node(struct device_node *of_node)

and vtpm device table being defined as below:

static struct vio_device_id tpm_ibmvtpm_device_table[] = {
         { "IBM,vtpm", "IBM,vtpm"}, 
-----------------------------------> type,compat
         { "", "" }
};

So, vio (virtual) devices uses both device_type and compatible property 
for device registration and driver selection.
In case of physical TPM, it is only compatible property being used for 
device driver selection

Also, please note that device_type property is now deprecated in latest 
Device Tree specs.

Thanks & Regards,
    - Nayna


>
> /Jarkko
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to