1. 23 8月, 2012 1 次提交
    • P
      char/tpm: Add new driver for Infineon I2C TIS TPM · aad628c1
      Peter Huewe 提交于
      This patch adds a driver to support Infineon's SLB 9635 TT 1.2 Soft I2C TPMs
      which follow the TGC TIS 1.2 TPM specification[1] and Infineon's I2C Protocol
      Stack Specification 0.20.
      The I2C Protocol Stack Specification is a simple adaption of the LPC TIS
      Protocol to the I2C Bus.
      The I2C TPMs can be used when LPC Bus is not available (i.e. non x86
      architectures like ARM).
      
      The driver is based on the tpm_tis.c driver by Leendert van Dorn and Kyleen
      Hall and has quite similar functionality.
      
      Tested on Nvidia ARM Tegra2 Development Platform and Beagleboard (ARM OMAP)
      Tested with the Trousers[2] TSS API Testsuite v 0.3 [3]
      Compile-tested on x86 (32/64-bit)
      
      Updates since version 2.1.4:
      - included "Lock the I2C adapter for a sequence of requests", by Bryan Freed
      - use __i2c_transfer instead of own implementation of unlocked i2c_transfer
      - use struct dev_pm_ops for power management via SIMPLE_DEV_PM_OPS
      
      Updates since version 2.1.3:
      - use proper probing mechanism
      * either add the tpm using I2C_BOARD_INFO to your board file or probe it
      * during runtime e.g on BeagleBoard using :
      * "echo tpm_i2c_infineon 0x20 > /sys/bus/i2c/devices/i2c-2/new_device"
      - fix possible endless loop if hardware misbehaves
      - improved return codes
      - consistent spelling i2c/tpm -> I2C/TPM
      - remove hardcoded sleep values and msleep usage
      - removed debug statements
      - added check for I2C functionality
      - renaming to tpm_i2c_infineon
      
      Updates since version 2.1.2:
      - added sysfs entries for duration and timeouts
      - updated to new tpm_do_selftest
      
      Updates since version 2.1.0:
      - improved error handling
      - implemented workarounds needed by the tpm
      - fixed typos
      
      References:
      [1]
      http://www.trustedcomputinggroup.org/resources/pc_client_work_group_pc_client_
      specific_tpm_interface_specification_tis_version_12/
      [2] http://trousers.sourceforge.net/
      [3]
      http://sourceforge.net/projects/trousers/files/TSS%20API%20test%20suite/0.3/Reviewed-by: NAndi Shyti <andi.shyti@gmail.com>
      Acked-by: NMarcel Selhorst <tpmdd@selhorst.net>
      Signed-off-by: NPeter Huewe <peter.huewe@infineon.com>
      Signed-off-by: NBryan Freed <bfreed@chromium.org>
      Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
      aad628c1
  2. 10 8月, 2012 1 次提交
  3. 11 7月, 2012 4 次提交
  4. 13 6月, 2012 4 次提交
  5. 05 3月, 2012 1 次提交
  6. 15 2月, 2012 3 次提交
  7. 20 1月, 2012 1 次提交
  8. 19 1月, 2012 1 次提交
  9. 13 1月, 2012 1 次提交
  10. 16 11月, 2011 9 次提交
  11. 23 9月, 2011 4 次提交
  12. 24 8月, 2011 1 次提交
  13. 04 8月, 2011 1 次提交
  14. 26 7月, 2011 1 次提交
  15. 22 7月, 2011 1 次提交
  16. 21 7月, 2011 1 次提交
  17. 13 7月, 2011 5 次提交
    • S
      tpm: Fix a typo · c9206693
      Stefan Berger 提交于
      This patch fixes a typo.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      c9206693
    • S
      tpm_tis: Probing function for Intel iTPM bug · 9519de3f
      Stefan Berger 提交于
      This patch introduces a function for automatic probing for the Intel iTPM
      STS_DATA_EXPECT flaw.
      
      The patch splits the current tpm_tis_send function into 2 parts where the 1st
      part is now called tpm_tis_send_data() and merely sends the data to the TPM.
      This function is then used for probing. The new tpm_tis_send function now
      first calls tpm_tis_send_data and if that succeeds has the TPM process the
      command and waits until the response is there.
      
      The probing for the Intel iTPM is only invoked if the user has not passed
      itpm=1 as parameter for the module *or* if such a TPM was detected via ACPI.
      Previously it was necessary to pass itpm=1 when also passing force=1 to the
      module when doing a 'modprobe'. This function is more general than the ACPI
      test function and the function relying on ACPI could probably be removed.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      9519de3f
    • S
      tpm_tis: Fix the probing for interrupts · a7b66822
      Stefan Berger 提交于
      This patch fixes several aspects of the probing for interrupts.
      
      This patch reads the TPM's timeouts before probing for the interrupts. The
      tpm_get_timeouts() function is invoked in polling mode and gets the proper
      timeouts from the TPM so that we don't need to fall back to 2 minutes timeouts
      for short duration commands while the interrupt probing is happening.
      
      This patch introduces a variable probed_irq into the vendor structure that gets
      the irq number if an interrupt is received while the the tpm_gen_interrupt()
      function is run in polling mode during interrupt probing. Previously some
      parts of tpm_gen_interrupt() were run in polling mode, then the irq variable
      was set in the interrupt handler when an interrupt was received and execution
      of tpm_gen_interrupt() ended up switching over to interrupt mode.
      tpm_gen_interrupt() execution ended up on an event queue where it eventually
      timed out since the probing handler doesn't wake any queues.
      
      Before calling into free_irq() clear all interrupt flags that may have
      been set by the TPM. The reason is that free_irq() will call into the probing
      interrupt handler and may otherwise fool us into thinking that a real interrupt
      happened (because we see the flags as being set) while the TPM's interrupt line
      is not even connected to anything on the motherboard. This solves a problem
      on one machine I did testing on (Thinkpad T60).
      
      If a TPM claims to use a specifc interrupt, the probing is done as well
      to verify that the interrupt is actually working. If a TPM indicates
      that it does not use a specific interrupt (returns '0'), probe all interrupts
      from 3 to 15.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      a7b66822
    • S
      tpm_tis: Delay ACPI S3 suspend while the TPM is busy · 20b87bbf
      Stefan Berger 提交于
      This patch delays the (ACPI S3) suspend while the TPM is busy processing a
      command and the TPM TIS driver is run in interrupt mode. This is the same
      behavior as we already have it for the TPM TIS driver in polling mode.
      
      Reasoning: Some of the TPM's commands advance the internal state of the TPM.
      An example would be the extending of one of its PCR registers. Upper layers,
      such as IMA or TSS (TrouSerS), would certainly want to be sure that the
      command succeeded rather than getting an error code (-62 = -ETIME) that may
      not give a conclusive answer as for what reason the command failed. Reissuing
      such a command would put the TPM into the wrong state, so waiting for it to
      finish is really the only option.
      
      The downside is that some commands (key creation) can take a long time and
      actually prevent the machine from entering S3 at all before the 20 second
      timeout of the power management subsystem arrives.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      20b87bbf
    • S
      tpm_tis: Re-enable interrupts upon (S3) resume · 45baa1d1
      Stefan Berger 提交于
      This patch makes sure that if the TPM TIS interface is run in interrupt mode
      (rather than polling mode) that all interrupts are enabled in the TPM's
      interrupt enable register after a resume from ACPI S3 suspend. The registers
      may either have been cleared by the TPM loosing its state during device sleep
      or by the BIOS leaving the TPM in polling mode (after sending a command to
      the TPM for starting it up again)
      
      You may want to check if your TPM runs with interrupts by doing
      
      cat /proc/interrupts | grep -i tpm
      
      and see whether there is an entry or otherwise for it to use interrupts:
      
      modprobe tpm_tis interrupts=1 [add 'itpm=1' for Intel TPM ]
      
      v2:
        - the patch was adapted to work with the pnp and platform driver
          implementations in tpm_tis.c
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: NRajiv Andrade <srajiv@linux.vnet.ibm.com>
      45baa1d1