- Joined
- May 15, 2020
- Messages
- 1,343
- Motherboard
- Gigabyte Z390 Designare
- CPU
- i9-9900KF
- Graphics
- RX 5700 XT
- Mac
Try again please.So it just creates an entire SSDT with a random UID?
A couple issues:
1) The pasted text doesn't include indenting. Can you use <pre> instead of <li> for the text (or anything that can preserve indenting)?
2) The length bytes at 0x0E doesn't include the device name string. Change from 0x58 to 0x69 (changes the CRC-32c from 0x05091CDF to 0x211FDE47 = 0x47, 0xde, 0x1f, 0x21
3) Looks like you included all the CRC code from the CRC website. All you need is the CRC-8 function (without input or output reflection) unless you want to make changes to other parts of the drom.
Code:# using result from Inqnuam's script at https://ravalian.com/thunderbolt/index.php? source /Volumes/Work/Programming/ThunderboltProjects/Scripts/ThunderboltUtil.sh #========================================================================================= # first attempt loaddslfile /Volumes/Work/Programming/ThunderboltProjects/Notes/examples/Inqnuamscriptresult.dsl listdroms usedromnum 1 dumpdrom 1) thedrom=7B0073991464270000DF1C090501580001000D00010008818002800000000882900180000000088380048001000008849003800100000585500000058650000002870B88200100640000000000038980058A504000058B5040000B0147494741425954450011025A3339302044455349474E41524500 sources: /Volumes/Work/Programming/ThunderboltProjects/Notes/examples/Inqnuamscriptresult.dsl:\_SB.PCI0.RP05.UPSB.DSB0.NHI0._DSM:ThunderboltDROM 0x01) UID: 0x0000276414997300 0x0d) Device ROM Revision: 1 0x10) Vendor ID: 0x1 0x12) Device ID: 0xD 0x14) Device Revision: 0x1 0x15) EEPROM Revision: 0 0x16) 1: 800280000000 0x1e) 2: 900180000000 0x26) 3: 800480010000 0x2e) 4: 900380010000 0x36) 5: 500000 0x3b) 6: 500000 0x40) 7: 0x42) 8: 200100640000000000 0x4d) 9: 80 0x50) A: 504000 0x55) B: 504000 0x5a) 1: "GIGABYTE" ============== (following bytes are unexpected) 0x65) 2: "Z390 DESIGNARE" 0x76) End #========================================================================================= # second attempt loaddslfile /Volumes/Work/Programming/ThunderboltProjects/Notes/examples/Inqnuamscriptresult.dsl listdroms usedromnum 2 dumpdrom 0x01) UID: 0x0000591868829000 0x0d) Device ROM Revision: 1 0x10) Vendor ID: 0x1 0x12) Device ID: 0xD 0x14) Device Revision: 0x1 0x15) EEPROM Revision: 0 0x16) 1: 800280000000 0x1e) 2: 900180000000 0x26) 3: 800480010000 0x2e) 4: 900380010000 0x36) 5: 500000 0x3b) 6: 500000 0x40) 7: 0x42) 8: 200100640000000000 0x4d) 9: 80 0x50) A: 504000 0x55) B: 504000 0x5a) 1: "GIGABYTE" ============== (following bytes are unexpected) 0x65) 2: "Z390 DESIGNARE" 0x76) End # fix it setstring 2 "Z390 DESIGNARE" dumpdrom makedromdsl "ThunderboltDROM", Buffer (0x76) { /* 0x00 */ 0x40, // CRC8 checksum: 0x40 /* 0x01 */ 0x00, 0x90, 0x82, 0x68, 0x18, 0x59, 0x00, 0x00, // Thunderbolt Bus 0, UID: 0x0000591868829000 /* 0x09 */ 0x47, 0xde, 0x1f, 0x21, // CRC32c checksum: 0x211FDE47 /* 0x0D */ 0x01, // Device ROM Revision: 1 /* 0x0E */ 0x69, 0x00, // Length: 105 (starting from previous byte) /* 0x10 */ 0x01, 0x00, // Vendor ID: 0x1 /* 0x12 */ 0x0D, 0x00, // Device ID: 0xD /* 0x14 */ 0x01, // Device Revision: 0x1 /* 0x15 */ 0x00, // EEPROM Revision: 0 /* 0x16 1 */ 0x08, 0x81, 0x80, 0x02, 0x80, 0x00, 0x00, 0x00, /* 0x1E 2 */ 0x08, 0x82, 0x90, 0x01, 0x80, 0x00, 0x00, 0x00, /* 0x26 3 */ 0x08, 0x83, 0x80, 0x04, 0x80, 0x01, 0x00, 0x00, /* 0x2E 4 */ 0x08, 0x84, 0x90, 0x03, 0x80, 0x01, 0x00, 0x00, /* 0x36 5 */ 0x05, 0x85, 0x50, 0x00, 0x00, /* 0x3B 6 */ 0x05, 0x86, 0x50, 0x00, 0x00, /* 0x40 7 */ 0x02, 0x87, /* 0x42 8 */ 0x0b, 0x88, 0x20, 0x01, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4D 9 */ 0x03, 0x89, 0x80, // PCIe xx:04.0 /* 0x50 A */ 0x05, 0x8a, 0x50, 0x40, 0x00, /* 0x55 B */ 0x05, 0x8b, 0x50, 0x40, 0x00, /* 0x5A 1 */ 0x0b, 0x01, 0x47, 0x49, 0x47, 0x41, 0x42, 0x59, 0x54, 0x45, 0x00, // Vendor Name: "GIGABYTE" /* 0x65 2 */ 0x11, 0x02, 0x5a, 0x33, 0x39, 0x30, 0x20, 0x44, 0x45, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x52, 0x45, 0x00, // Device Name: "Z390 DESIGNARE" },
crc () {
local bits=$(($1))
local inputreflected=$(($2))
local outputreflected=$(($3))
local polynomial=$(($4))
local crc=$(($5))
local finalxor=$(($6))
for data in $(xxd -p -c 1 | {
if (( inputreflected )); then
rev | tr '0123456789abcdef' '084c2a6e195d3b7f'
else
cat
fi
}); do
((crc ^= (0x$data << (bits-8))))
for ((i=0;i<8;i++)); do
if ((crc >> (bits-1))); then
((crc = (crc << 1) ^ polynomial))
else
((crc <<= 1))
fi
((crc &= ((1 << $bits)-1)))
done
done
printf "%0$(((bits+3) / 4))x" $((crc ^ finalxor)) | {
if (( outputreflected )); then
rev | tr '0123456789abcdef' '084c2a6e195d3b7f'
else
cat
fi
}
}
crc8uid () {
crc 8 0 0 7 0 0xdb
}
crc32c () {
crc 32 1 1 0x1edc6f41 0xffffffff 0xffffffff
}
This is what I get now: