Commit a58620cd authored by Guido Gunther's avatar Guido Gunther

Version 0.1.0

- Export config as JSON since this is diffable
- Created with 6.1.1 of TIs tool
- 0x06: Set custom user word 2 to L5DP and Customer use word 1 to
  0x00000100 so the last three bytes make up the version number
  0.1.0.
- 0x16: enable all irqs for i2c1
- 0x17: disable all IRQs for i2c2
- 0x29: Drop some UFD config
- 0x29: Disable USB 2.0 and RP path, USB2 is not routed via tps65892
  This way we can leave it off when only charging.
- 0x29: Process Swap To Source
- 0x29 Process Swap to UFP
- 0x29: Enable automatic sink capabilities request
- 0x33: Enable a 12V PDO with 1A default current
- 0x47: Add UFP identity objects
- 0x51: Enable pinouts we can support
- 0x51: Use DP 1.3 signaling only
- 0x5c: Use DP / USB event to enable the HD3SS560 instead of any plug event.
- 0x5e: GPIO 4 is transmit and receive (should not be needed)
- 0x5e: disable some misc config bits that are off in the examples too
parent 0610a570
This source diff could not be displayed because it is too large. You can view the blob instead.
import os
import sys
......@@ -1023,6 +1022,81 @@ class cAMAVDO(register_class.cDataModelArray) :
# main registers
#==========================================================================
VID_COMMON_TI = 0x28
class cVID_0x00_register(register_class.cRegister) :
def __init__(self):
register_class.cRegister.__init__(self, {'register name' : 'VID',
'address' : 0x00,
'byte length' : 4,
'permission' : 'RO'})
self.setAsShared()
self.hide()
self.dataModel = register_class.cDataModelArray(self, 1,
{'name' : 'VID',
'offset' : 0,
'bit length' : 32 })
VID = register_class.cForceSetDMTerminator(self,
{'name': 'Intel-assigned Thunderbolt Vendor ID',
'offset': 0,
'bit length': 32,
'force value': int(VID_COMMON_TI),
'force display': str(VID_COMMON_TI)})
# VID = register_class.cHexDMTerminator(self,
# {'name': 'Intel-assigned Thunderbolt Vendor ID',
# 'offset': 0,
# 'bit length': 32})
self.dataModel.addChild(VID)
def intFrom4CC(value) :
retVal = 0x0
# little endian. First char takes position 0 of the array
for (i,char) in enumerate(value) :
retVal |= (ord(char) << (8*i))
return retVal
DID_ACE = "ACE1"
DID_OF_DEVICE_STR = DID_ACE
DID_OF_DEVICE_INT = intFrom4CC(DID_ACE)
class cDID_0x01_register(register_class.cRegister) :
def __init__(self):
register_class.cRegister.__init__(self, {'register name' : 'DID',
'address' : 0x01,
'byte length' : 4,
'permission' : 'RO'})
self.setAsShared()
self.dataModel = register_class.cDataModelArray(self, 1,
{'name' : 'DID',
'offset' : 0,
'bit length' : 32 })
self.hide()
DID = register_class.cForceSetDMTerminator(self,
{'name': 'Vendor-specific Device ID.',
'offset': 0,
'bit length': 32,
'force value': int(DID_OF_DEVICE_INT),
'force display': str(DID_OF_DEVICE_STR)})
self.dataModel.addChild(DID)
class cProtoVer_0x02_register(register_class.cRegister) :
def __init__(self):
register_class.cRegister.__init__(self, {'register name' : 'Protocol Version',
......@@ -9040,6 +9114,8 @@ for i in range(NUM_PHYSICAL_DEVICES) :
device = register_class.cDevice({'I2C address' : 0x38, 'ports' : devicePortsListOfDict, 'strapping' : deviceStrappingListOfDict})
device.setHIFirmwareUpdateFunction(HIFirmwareUpdate)
device.addRegister(cMode_0x03_register())
device.addRegister(cVID_0x00_register())
device.addRegister(cDID_0x01_register())
device.addRegister(cCustUse_0x06_register())
device.addRegister(cVersion_0x0f_register())
device.addRegister(cIntMask1_0x16_register())
......@@ -9194,4 +9270,86 @@ for i in range(NUM_PHYSICAL_DEVICES, NUM_PHYSICAL_DEVICES + NUM_VIRTUAL_DEVICES)
ACE_register_definition_metadata_json_delimiter{"virtual device list of dict": [{"show": 0, "name": "Virtual Device 1", "addr": 56}, {"show": 0, "name": "Virtual Device 2", "addr": 56}, {"show": 0, "name": "Virtual Device 3", "addr": 56}, {"show": 0, "name": "Virtual Device 4", "addr": 56}, {"show": 0, "name": "Virtual Device 5", "addr": 56}, {"show": 0, "name": "Virtual Device 6", "addr": 56}], "firmware filename": "TPS65981_2_6_v0001_12_09.bin", "device list of dict": [{"show": 1, "name": "Device 1", "addr": 7}, {"show": 0, "name": "Config Set 2", "addr": 24}], "configuration values": "{\"meta\": {\"project\": 1, \"version\": 1}, \"data\": {\"every_ace\": [{\"register\": 6, \"data\": [7, 2, 0, 0, 0, 0, 0, 0]}], \"header\": {\"usb_if_xid\": 0, \"unlock_code\": \"CST1\", \"customer_version\": 0, \"protection_flags\": 250}, \"bin_table\": [], \"strings\": [{\"is_ascii\": true, \"is_valid\": true, \"string\": \"01.00.00\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"TPS65982\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"Texas Instruments\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"http://www.ti.com/product/TPS65982\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"Thunderbolt Mode Entry Error\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"HTTP://help.vesa.org/dp-usb-type-c\"}], \"selected_ace\": [{\"rights\": 0, \"register\": 6, \"data\": [0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 22, \"data\": [8, 0, 0, 2, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 23, \"data\": [8, 0, 0, 2, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 32, \"data\": [0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 40, \"data\": [11, 195, 223, 9, 170, 0, 21, 106, 216, 160, 157, 5, 6, 0, 0, 20, 20, 120], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 41, \"data\": [112, 116, 0, 49, 7], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 50, \"data\": [1, 252, 12, 50, 144, 1, 38, 44, 65, 6, 64, 244, 65, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 51, \"data\": [3, 90, 144, 1, 38, 50, 208, 2, 0, 38, 192, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 105, 1, 64, 200, 200, 0, 64, 170, 152, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 55, \"data\": [111, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 56, \"data\": [1, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 71, \"data\": [3, 81, 4, 0, 196, 81, 4, 0, 0, 16, 0, 52, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 74, \"data\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 81, \"data\": [3, 70, 28, 0, 1, 2, 6], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 82, \"data\": [0, 5, 0, 0, 0, 0, 0, 5], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 84, \"data\": [3, 2, 7, 0, 81, 4, 1, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 92, \"data\": [9, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 191, 3, 0, 131, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 93, \"data\": [0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 94, \"data\": [0, 3, 56, 0, 0, 0, 2, 2, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 0, 0, 2, 2, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 0, 0, 2, 2, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 112, \"data\": [13, 4], \"offset\": 0, \"address\": [255, 255, 255, 255]}]}}", "devices use same config": true, "debug settings": {"adapter": "FTDI"}, "template properties": {"Mux Type": "USB3.x and DisplayPort", "Description": "TPS65982 Dual-Role Port, Power Agnostic, Prefers Data Source, supports HD3SS460 Mux:\n\nPower sink and source capabilities, will attempt to become the data source if possible. Supports USB3 and DisplayPort data paths using the external HD3SS460 Superspeed Mux from Texas Instruments. This is a good configuration for Laptop Computers that may be charged from a dock or power brick, but might also power an external device. It is easily modified to support power source only (with no sink capabilitiy) for externally-powered devices such as Desktop Computers\n", "Template Version": "5.13", "Port Type": "DRP", "Category Type": "Standard Customer Project", "Device Type": "TPS65982", "Display As": "TPS65982 HD3SS460 DRP, Prefers Sink, Prefers Device", "Question List": [{"Answer": "TPS65982", "Question": "Which device are you using?"}, {"Answer": "Standard (Recommended)", "Question": "Which template type do you want to start with?"}, {"Answer": "None", "Question": "Which Thunderbolt controller is used?"}, {"Answer": "None", "Question": "Which Thunderbolt controller is used?"}, {"Answer": "Dual Role Port (DRP), prefers power source", "Question": "What is the port type of the design?"}]}}
\ No newline at end of file
ACE_register_definition_metadata_json_delimiter{
"virtual device list of dict": [
{
"show": 0,
"name": "Virtual Device 1",
"addr": 56
},
{
"show": 0,
"name": "Virtual Device 2",
"addr": 56
},
{
"show": 0,
"name": "Virtual Device 3",
"addr": 56
},
{
"show": 0,
"name": "Virtual Device 4",
"addr": 56
},
{
"show": 0,
"name": "Virtual Device 5",
"addr": 56
},
{
"show": 0,
"name": "Virtual Device 6",
"addr": 56
}
],
"firmware filename": "TPS65981_2_6_v0001_12_09.bin",
"device list of dict": [
{
"show": 1,
"name": "Device 1",
"addr": 7
},
{
"show": 0,
"name": "Config Set 2",
"addr": 24
}
],
"configuration values": "{\"meta\": {\"project\": 1, \"version\": 1}, \"data\": {\"every_ace\": [{\"register\": 6, \"data\": [7, 2, 0, 0, 0, 0, 0, 0]}], \"header\": {\"usb_if_xid\": 0, \"unlock_code\": \"CST1\", \"customer_version\": 0, \"protection_flags\": 250}, \"bin_table\": [], \"strings\": [{\"is_ascii\": true, \"is_valid\": true, \"string\": \"01.00.00\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"TPS65982\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"Texas Instruments\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"http://www.ti.com/product/TPS65982\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"Thunderbolt Mode Entry Error\"}, {\"is_ascii\": true, \"is_valid\": true, \"string\": \"HTTP://help.vesa.org/dp-usb-type-c\"}], \"selected_ace\": [{\"rights\": 0, \"register\": 0, \"data\": [40, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 1, \"data\": [65, 67, 69, 49], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 6, \"data\": [0, 1, 0, 0, 80, 68, 53, 76], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 22, \"data\": [255, 255, 254, 255, 223, 70, 0, 15], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 23, \"data\": [0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 32, \"data\": [0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 40, \"data\": [13, 192, 223, 9, 8, 4, 21, 106, 216, 160, 157, 5, 6, 0, 0, 20, 20, 120], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 41, \"data\": [112, 212, 1, 49, 7], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 50, \"data\": [1, 252, 12, 150, 144, 1, 38, 44, 65, 6, 64, 244, 65, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 51, \"data\": [3, 90, 144, 1, 38, 50, 208, 2, 0, 100, 192, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 105, 1, 64, 200, 200, 0, 64, 200, 200, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 55, \"data\": [111, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 56, \"data\": [1, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 71, \"data\": [131, 109, 49, 0, 196, 109, 49, 0, 0, 16, 0, 53, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 74, \"data\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 81, \"data\": [3, 70, 60, 0, 1, 2, 6], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 82, \"data\": [0, 5, 0, 0, 0, 0, 0, 5], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 84, \"data\": [0, 0, 7, 0, 81, 4, 1, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 92, \"data\": [9, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 191, 3, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 93, \"data\": [0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 94, \"data\": [24, 0, 48, 0, 0, 0, 2, 2, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 0, 0, 2, 2, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 0, 0, 2, 2, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68, 33, 67, 77, 68], \"offset\": 0, \"address\": [255, 255, 255, 255]}, {\"rights\": 0, \"register\": 112, \"data\": [13, 4], \"offset\": 0, \"address\": [255, 255, 255, 255]}]}}",
"devices use same config": true,
"debug settings": {
"adapter": "FTDI"
},
"template properties": {
"Mux Type": "USB3.x and DisplayPort",
"Description": "TPS65982 Dual-Role Port, Power Agnostic, Prefers Data Source, supports HD3SS460 Mux:\n\nPower sink and source capabilities, will attempt to become the data source if possible. Supports USB3 and DisplayPort data paths using the external HD3SS460 Superspeed Mux from Texas Instruments. This is a good configuration for Laptop Computers that may be charged from a dock or power brick, but might also power an external device. It is easily modified to support power source only (with no sink capabilitiy) for externally-powered devices such as Desktop Computers\n",
"Template Version": "6.1.1",
"Port Type": "DRP",
"Category Type": "Standard Customer Project",
"Device Type": "TPS65982",
"Display As": "Librem5 DP v0.1.0",
"Question List": [
{
"Answer": "TPS65982",
"Question": "Which device are you using?"
},
{
"Answer": "Standard (Recommended)",
"Question": "Which template type do you want to start with?"
},
{
"Answer": "None",
"Question": "Which Thunderbolt controller is used?"
},
{
"Answer": "None",
"Question": "Which Thunderbolt controller is used?"
},
{
"Answer": "Dual Role Port (DRP), prefers power source",
"Question": "What is the port type of the design?"
}
]
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment