Debian Codegraph @

doc/tcti-i2c-ftdi.md

raw symbols SCIP
1 # I2C TCTI FTDI
2
3 The I2C TCTI FTDI can be used for communication with an I2C-based TPM over the FTDI MPSSE
4 USB to I2C bridge. The FTDI module utilizes the `tcti-i2c-helper` library for handling the
5 PTP I2C protocol and the `libftdi-dev` library for handling the USB to I2C communication.
6
7 Example of a FTDI MPSSE USB to I2C bridge is the product "USB 2.0 Hi-Speed to MPSSE
8 Cable (SPI/I2C/JTAG master) with +3.3V digital level signals", part no: C232HM-DDHSL-0.
9 Connect the cable to your TPM as specified in the table below:
10
11 | C232HM-DDHSL-0 | Description |
12 |--------------------|-------------|
13 | pin 1, red, VCC | VCC |
14 | pin 2, orange, SCL | SCL |
15 | pin 3, yellow, SDA | SDA |
16 | pin 4, green, SDA | SDA |
17 | pin 10, black, GND | GND |
18
19 **Important: both yellow and green wires need to be shorted together to create bidirectional data.**
20
21 # EXAMPLES
22
23 Set udev rules for the C232HM-DDHSL-0 cable by creating a file `/etc/udev/rules.d/60-c232hm.rules`:
24 ```
25 ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", TAG+="uaccess"
26 ```
27
28 Activate the udev rules:
29 ```console
30 sudo udevadm control --reload
31 ```
32
33 You should see the following after plugging in the C232HM-DDHSL-0 cable:
34 ```
35 dmesg
36 [74386.091721] usb 3-2: new high-speed USB device number 18 using xhci_hcd
37 [74386.439103] usb 3-2: New USB device found, idVendor=0403, idProduct=6014, bcdDevice= 9.00
38 [74386.439117] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
39 [74386.439129] usb 3-2: Product: C232HM-DDHSL-0
40 [74386.439140] usb 3-2: Manufacturer: FTDI
41 [74386.439151] usb 3-2: SerialNumber: FT1UGJKF
42 [74386.443996] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
43 [74386.444030] usb 3-2: Detected FT232H
44 [74386.446370] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
45 ```
46
47 Use tcti-i2c-ftdi to communicate with a I2C-based TPM:
48 ```console
49 tpm2_startup -Ti2c-ftdi -c
50 tpm2_getrandom -Ti2c-ftdi 8 --hex
51 ```
52
53 Enable abrmd:
54 ```console
55 export DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --session --print-address --fork`
56 tpm2-abrmd --allow-root --session --tcti=i2c-ftdi &
57
58 export TPM2TOOLS_TCTI="tabrmd:bus_name=com.intel.tss2.Tabrmd,bus_type=session"
59 tpm2_startup -c
60 tpm2_getrandom 8 --hex
61 ```