On Thu, Oct 06, 2016 at 01:44:32AM +0530, Nayna wrote: > > > 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 <jgunthorpe@xxxxxxxxxxxxxxxxxxxx> > >>Signed-off-by: Nayna Jain <nayna@xxxxxxxxxxxxxxxxxx> > >>--- > >>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. AIUI, this should be a standard value such as serial, pci, etc. I don't think your use here is correct, but I could be wrong. I'm not certain what you do with devices that don't have a standard type. > > /** > * 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. Deprecated for Flattened DT only. OpenFirmware implementations can/should still use this. Rob -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html