@@ -686,6 +686,7 @@ class Computer:
686686 oclp_sys_signed : Optional [bool ] = False
687687 firmware_vendor : Optional [str ] = None
688688 rosetta_active : Optional [bool ] = False
689+ t2_chip : Optional [bool ] = False
689690
690691 @staticmethod
691692 def probe ():
@@ -704,6 +705,7 @@ def probe():
704705 computer .bluetooth_probe ()
705706 computer .topcase_probe ()
706707 computer .t1_probe ()
708+ computer .t2_probe ()
707709 computer .ambient_light_sensor_probe ()
708710 computer .pcie_webcam_probe ()
709711 computer .sata_disk_probe ()
@@ -1014,7 +1016,27 @@ def t1_probe(self):
10141016 continue
10151017 self .t1_chip = True
10161018 break
1017-
1019+ def t2_probe (self ):
1020+ """Detect Apple T2 controllers by their physical PCI identifiers."""
1021+ matching = {
1022+ "IOProviderClass" : "IOPCIDevice" ,
1023+ "IOPropertyMatch" : [
1024+ {
1025+ "vendor-id" : (0x106B ).to_bytes (4 , byteorder = "little" ),
1026+ "device-id" : device_id .to_bytes (4 , byteorder = "little" ),
1027+ }
1028+ for device_id in (0x1801 , 0x1802 )
1029+ ],
1030+ }
1031+ devices = ioreg .ioiterator_to_list (
1032+ ioreg .IOServiceGetMatchingServices (ioreg .kIOMasterPortDefault , matching , None )[1 ]
1033+ )
1034+ device = next (devices , None )
1035+ if device :
1036+ self .t2_chip = True
1037+ ioreg .IOObjectRelease (device )
1038+ for device in devices :
1039+ ioreg .IOObjectRelease (device )
10181040 def sata_disk_probe (self ):
10191041 # Get all SATA Controllers/Disks from 'system_profiler SPSerialATADataType'
10201042 # Determine whether SATA SSD is present and Apple-made
0 commit comments