Contribute
Register

[SUCCESS] Gigabyte Designare Z390 (Thunderbolt 3) + i7-9700K + AMD RX 580

Joined
Feb 18, 2019
Messages
349
Motherboard
ASUS X299 Prime Deluxe
CPU
i9-9980XE
Graphics
Vega 56
Mac
  1. iMac
  2. MacBook Air
Mobile Phone
  1. iOS
@CaseySJ

No longer for me :) .. Calculator can be found here
Confirmation has been done on other Macs ! It work :mrgreen: .. Finally, first added 0x00 has to be removed, result is same :)
View attachment 455158

My MacBook Air 2018 agrees with your results. The first section of its ThunderboltDROM is "0f 00 XX XX XX 33 82 01 00".

If "XX XX XX 33 82 01 00" is placed into calculator, the result is 0xF.

So does that means that (from CaseySJ's post, here):
  • 11 22 33 44 55 ED 00 -- is the UID header (??)
***

On MacBook Air, for the Thunderbolt Bus (on the PCI Thunderbolt pane), the UID: is reverse of DROM UID section.

Example, if DROM (fake UID) starts as "0f 00 26 12 58 33 82 01 00..., the UID would be 0x0001823358122600, reverse ordering (little-endian).
 
Last edited:

CaseySJ

Moderator
Joined
Nov 11, 2018
Messages
14,830
Motherboard
Gigabyte Z490 Vision D
CPU
i5-10400
Graphics
RX 580
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Classic Mac
  1. Quadra
Mobile Phone
  1. iOS
** Thunderbolt DROM Decoded **
Vital Contribution by @Elias64Fr
Thanks to @S1lla and @qthegaijin for providing much needed supplementary information
Please do not quote this entire post; use a link instead

Here is a complete sample Thunderbolt DROM as extracted from the Designare Z390 firmware:
  • ------- UID and CRC-8 -------
  • 71 -- CRC-8 (cyclic redundancy check for entire 8-byte UID below)
  • 00 00 00 00 00 00 ED 00 -- UID (first byte = Thunderbolt Bus ID)
  • ------- CRC32_C -------
  • E0 40 34 98 -- CRC-32C (for all remaining bytes below )
  • ------- Offset 0x0D : 9-byte Preamble -------
  • 01 -- Device ROM Revision
  • 69 -- Length of DROM from offset 0x0D to end of DROM (must be specified correctly)
  • 00
  • ED 00 -- Vendor ID
  • 08 C0 -- Device ID
  • 01 -- Device Revision
  • 01 -- EEPROM Revision
  • ------- Port Definitions/Flags -------
  • 08 81 80 02 80 00 00 00 -- TBPort1 DualLinkport2 HPMAddr0 (add Bus ID to purple bytes)
  • 08 82 90 01 80 00 00 00 -- TBPort2 DualLinkport1 HPMAddr0 (add Bus ID to purple bytes)
  • 08 83 80 04 80 01 00 00 -- TBPort3 DualLinkport4 HPMAddr1 (add Bus ID to purple bytes)
  • 08 84 90 03 80 01 00 00 -- TBPort4 DualLinkport3 HPMAddr1 (add Bus ID to purple bytes)
  • 05 85 50 00 00 -- TBPort5 DisplayPort Adapter
  • 05 86 50 00 00 -- TBPort6 DisplayPort Adapter
  • 02 C7 -- TBSwitch7 -- Change this to 02 87
  • 0B 88 20 01 00 64 00 00 00 00 00 -- TBPort8 PCI Down Adapter DSB1
  • 03 89 80 -- TBPort9 PCI Down Adapter DSB4
  • 05 8A 50 40 00 -- TBPortA DisplayPort Adapter
  • 05 8B 50 40 00 -- TBPortB DisplayPort Adapter
  • ------- Vendor and Device Strings -------
  • 0B 01 47 49 47 41 42 59 54 45 00 -- Vendor String: The string "GIGABYTE"
  • 11 02 5A 33 39 30 20 44 45 53 49 47 4E 41 52 45 00 -- Device String: The string "Z390 DESIGNARE"
Screen Shot 2020-07-06 at 8.09.24 AM.png
More details on the first 22 bytes as follows:
  • 71 -- CRC-8 (cyclic redundancy check)
  • 00 00 00 00 00 00 ED 00 -- 8-Byte UID, where first byte in red is Thunderbolt Bus ID
  • E0 40 34 98 -- CRC-32C
  • 01 69 00 ED 00 08 C0 01 01 -- 9-Byte Preamble (assigned by PciThunderbolt.efi driver on real Macs?)
Some real examples of 9-Byte Preambles:
  • 01 58 00 01 00 10 00 01 00 Mac Pro 7,1
  • 01 58 00 01 00 0D 00 01 00 iMac 19,1
  • 01 58 00 01 00 0D 00 01 00 MacBook Pro 15,2
  • 01 5E 00 01 00 0C 00 01 00 iMac 18,3
  • 01 5E 00 01 00 0C 00 01 00 iMacPro 1,1

Specifying Thunderbolt Bus ID:
If a system has more than one Thunderbolt card or controller, each should be given a unique Thunderbolt Bus ID. The valid range of IDs is 0x0 to 0xF (or decimal 0 to 15). Bus ID is specified as follows:
  • First byte of Unique ID or UID located at DROM offset 0x01.
  • Least significant 4 bits of TBPort1, TBPort2, TBPort3, TBPort4 as shown in the 8 purple bytes under --- Port Definitions/Flags ---
  • We can simply add (i.e. mathematical add) BusID to the default values of those 8 purple bytes.
  • For example, to select Bus ID 0x02, those purple bytes become:
    • 0x80 + 0x02 = 0x82, 0x80 + 0x02 = 0x82
    • 0x90 + 0x02 = 0x92, 0x80 + 0x02 = 0x82
    • 0x80 + 0x02 = 0x82, 0x80 + 0x02 = 0x82
    • 0x90 + 0x02 = 0x92, 0x80 + 0x02 = 0x82
  • Therefore a total of 9 bytes are modified.
  • Please see this post for details on how to make these changes using a command-line tool called ThunderboltUtil.

CRC-8 is computed as follows:
  • Polynomial = 0x07
  • Initial Value = 0x00
  • Final XOR Value = 0xdb
CRC-8 is based on the first 8 bytes following CRC-8 (all 8 bytes of UID). We can compute CRC-8 using this website:
  • Set CRC Width to CRC-8
  • Set CRC parameterization to Custom
  • Set Final Xor Value to 0xdb
  • Enter the data under CRC Input Data with Bytes radio button selected
CRC-32C is a 4-byte CRC computed from all the bytes of Thunderbolt DROM after the CRC-32C bytes. We can compute CRC-32C using the same website:
  • Set CRC Width to CRC-32
  • Set CRC parameterization to Predefined, then from the pop-up menu, select CRC32_C
  • Enter the data under CR Input Data with Bytes radio button selected (results will appear in reverse byte order)
Therefore if we have a full DROM string as follows (where 8-byte UID in red has been altered for privacy reasons):

03 02 11 22 33 44 55 00 00 2d ea 01 bd 01 58 00 01 00 10 00 01 00 08 81 82 02 82 00 00 00 08 82 92 01 82 00 00 00 08 83 82 04 82 01 00 00 08 84 92 03 82 01 00 00 05 85 09 01 00 05 86 09 01 00 02 87 03 88 20 03 89 80 02 ca 02 cb 0d 01 41 70 70 6c 65 20 49 6e 63 2e 00 0c 02 4d 61 63 69 6e 74 6f 73 68 00

It means:
  • Byte 1 (03) is a single-byte CRC for the UID bytes: 02 11 22 33 44 55 00 00
  • After UID, the next 4 bytes are a 32-bit or 4-byte CRC-32C for all the remaining bytes: 2d ea 01 bd
  • And then the rest of DROM follows.
So the above DROM can be color-coded like this:

03 02 11 22 33 44 55 00 00 2d ea 01 bd 01 58 00 01 00 10 00 01 00 08 81 82 02 82 00 00 00 08 82 92 01 82 00 00 00 08 83 82 04 82 01 00 00 08 84 92 03 82 01 00 00 05 85 09 01 00 05 86 09 01 00 02 87 03 88 20 03 89 80 02 ca 02 cb 0d 01 41 70 70 6c 65 20 49 6e 63 2e 00 0c 02 4d 61 63 69 6e 74 6f 73 68 00
  • Green = CRC-8 for the red UID
  • Red = UID (first byte of UID "02" is Thunderbolt Bus ID)
  • Blue = CRC-32C for all the remaining bytes (yellow and black)
  • Yellow = 9-byte Preamble

Update 5 Jul 2020: Thanks to @joevt for providing additional information.
 
Last edited:
Joined
Apr 28, 2018
Messages
210
Motherboard
Asus Dominus Extreme
CPU
3175X
Graphics
Radeon VII
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
  4. Mac Pro
The latest decoding sounds really awesome, and I can't wait till you guys can use it for PCIe firmware, etc., as well. One step further to a perfect Thunderbolt solution under macOS.

You guys rock!

@CaseySJ @Elias64Fr
 
Last edited:
Joined
Jan 1, 2020
Messages
349
Motherboard
Gigabyte Z390 Designare
CPU
i5-9600K
Graphics
RX 5700 XT
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
The latest decoding sounds really awesome and I can't wait till you guys can use it for pcie firmwares etc aswell. One step further to a perfect thunderbolt solution under macOS.

You guys rock!

@CaseySJ @Elias64Fr
Hi @S1lla
Thanks !

You mightn't have to burn your customised TDROM on the firmware, you just have to add it as a property with you favourite bootloader or by SSDT :)
 
Last edited:
Joined
Dec 19, 2012
Messages
117
Motherboard
Gigabyte GA-Z170X Designare
CPU
i7-6700K
Graphics
RX Vega 64
Mac
  1. iMac
  2. MacBook
  3. Mac Pro
Classic Mac
  1. Color Classic
  2. iMac
  3. Power Mac
  4. PowerBook
  5. SE/30
Mobile Phone
  1. iOS
Hi @S1lla
Thanks !

You mightn't have to burn you customised TDROM on the firmware, you have just to add it as property with you favourite boot loader or SSDT :)

This is what I like to hear! Keep up the awesome work. Can't wait to test out the new findings when SSDTs are posted.
 
Joined
Jul 13, 2016
Messages
2,799
Motherboard
Gigabyte Z370 Gaming 5
CPU
I9 9900k
Graphics
Vega 64
Mac
  1. Mac mini
  2. Mac Pro
Mobile Phone
  1. iOS
FYI, the Table of Contents in Post #1 has been further modified:

Starting to look like I should be getting myself a Designare board.
 
Joined
Dec 19, 2012
Messages
117
Motherboard
Gigabyte GA-Z170X Designare
CPU
i7-6700K
Graphics
RX Vega 64
Mac
  1. iMac
  2. MacBook
  3. Mac Pro
Classic Mac
  1. Color Classic
  2. iMac
  3. Power Mac
  4. PowerBook
  5. SE/30
Mobile Phone
  1. iOS
Starting to look like I should be getting myself a Designare board.

I am in the same boat. With all the precise info about this Z390 board makes me want to snag one to test with too.
 
Top