#asahi-re · 2022-11-15 08:32
svenand looked at that code a few times because it was so weird #asahi-re · 2022-11-15 08:32
svenive just checked that it does the same writes in the hv on my two m1s#asahi-re · 2022-11-15 08:32
svenfeel free to double check that on t8103 if you have some time #asahi-re · 2022-11-15 08:31
marcan(on t8103)#asahi-re · 2022-11-15 08:31
svenyes#asahi-re · 2022-11-15 08:31
marcanit's just the workaround case is weird and also it's suspicious that that efuse happens to be split between words#asahi-re · 2022-11-15 08:31
marcanyeah, it's what you do at least#asahi-re · 2022-11-15 08:31
svenbut wait.. I think that’s the case for the non-workaround phy on t8103 as well#asahi-re · 2022-11-15 08:30
svenstrange#asahi-re · 2022-11-15 08:30
marcansven: on t8112, for both phys, the fuse and the field it's inserted in are both 2 bits#asahi-re · 2022-11-15 08:29
marcanweird.#asahi-re · 2022-11-15 08:29
svenbut the fuse value just one and the top bit is set to zero or something #asahi-re · 2022-11-15 08:28
svenalso check the mask, iirc the mask for the reg has two bits #asahi-re · 2022-11-15 08:28
svenit’s weird, I’m pretty sure I checked that workaround case a few times because it doesn’t make much sense #asahi-re · 2022-11-15 08:27
svenoj the other t8103 phy as well#asahi-re · 2022-11-15 08:27
svenyup#asahi-re · 2022-11-15 08:27
marcanon t8112 it's just two 2-bit fields#asahi-re · 2022-11-15 08:27
svenyes…#asahi-re · 2022-11-15 08:27
marcansven: but the other one has a 2-bit field and this one has two 1-bit fields?#asahi-re · 2022-11-15 08:26
svenhttps://github.com/AsahiLinux/linux/blob/d5cd55d580e95c37e7623afef31a84e78065a9ea/drivers/phy/apple/atc.c#L695#asahi-re · 2022-11-15 08:25
svenit’s a special case in the t8103 kext for one of the two phys #asahi-re · 2022-11-15 08:25
svenit first writes the original value, then some other value and finally the second value or something #asahi-re · 2022-11-15 08:23
marcancan't that just be a consecutive bitfield?#asahi-re · 2022-11-15 08:23
marcansven: what's up with atcphy1_cio3pll_dll_start_capcode_workaround? looks like a split?#asahi-re · 2022-11-13 18:49
sveni've done that for the first two fuses or so before I got fed up, but maybe someone is more patient#asahi-re · 2022-11-13 18:49
sventhe other alternative to get them is to intercept reads/write to the fuse region and the atcphy fuse regs and play around with a few different patterns to see what gets stored where#asahi-re · 2022-11-13 18:48
sventhat's all just debug print stuff and can be used to match up the name of the fuse and otherwise ignored#asahi-re · 2022-11-13 18:47
svenafter that you'll always see a very big block which looks like if (this + whatever == something) { .... } and there will be lots of boilerplate in that block#asahi-re · 2022-11-13 18:47
sventhe first one reads the fuse and extracts some bits, the second one applies the values to the atcphy. the atcphy regs can be matched up with what I have inside atcphy.c and are probably the same#asahi-re · 2022-11-13 18:46
sventhat's then followed up by *(uint *)(atcphy_mmio_ptr + some_offset) = *(uint *)(atcphy_mmio_ptr + some_offset) & some_mask | fuse_value << some_shift;#asahi-re · 2022-11-13 18:45
svenif you decompile it in ghidra you'll see patterns like fuse_full = *(uint *)((this + whatever) + some_offset); fuse_value = (fuse_full >> some_shift) & some_mask;#asahi-re · 2022-11-13 18:43
sventhat function is very very verbose with debug prints#asahi-re · 2022-11-13 18:43
sventhese are read and applied in AppleT8112TypeCPhy::performEFuseProgramming#asahi-re · 2022-11-13 18:43
svenso if anyone wants to help enable usb3 on the M2 here's how: we need the fuses (see e.g. https://github.com/AsahiLinux/linux/blob/d5cd55d580e95c37e7623afef31a84e78065a9ea/arch/arm64/boot/dts/apple/t8103.dtsi#L986) for the M2 atcphy#asahi-re · 2022-11-12 21:06
amarioguygot the gl file#asahi-re · 2022-11-12 21:06
amarioguyyes!!#asahi-re · 2022-11-12 20:48
amarioguyah fair, probably should try from linux#asahi-re · 2022-11-12 20:48
svenand iirc then I put it into a .dmg and opened it with macos or something#asahi-re · 2022-11-12 20:48
svenI got mine by just dumping the partition from linux (or maybe m1n1)#asahi-re · 2022-11-12 20:48
svenno, macos won't ever allow access#asahi-re · 2022-11-12 20:47
svenand finding that shmem is also easy because it has to be mapped inside the DART and iovas are very suspicious in the messages#asahi-re · 2022-11-12 20:47
amarioguyprobably should try to do it from recoveryos or smth#asahi-re · 2022-11-12 20:47
amarioguyi was actually trying to copy the gigalocker from the xart partition (so i can verify some of the init things) but macos kept denying the operation even with sudo permissions :/#asahi-re · 2022-11-12 20:47
amarioguyah right#asahi-re · 2022-11-12 20:46
sventhat's the only signal SEP gets as well#asahi-re · 2022-11-12 20:46
svenno need to write a kext, just look at the shmem at the time the message is sent/received#asahi-re · 2022-11-12 20:45
amarioguythe messages definitely do not contain things like the CRC of the lockers - the fact that SEP can validate it without it in the message almost certainly implies there's a shmem write on AP side with the locker#asahi-re · 2022-11-12 20:44
amarioguydamn probably going to need to write a kext soon that intercepts *every* shared mem write from AP side#asahi-re · 2022-11-11 10:46
amarioguyyep, looked at the strings output for the AppleTrustedAccessory kext - it's the one that does the pairing on macos side#asahi-re · 2022-11-11 03:58
amarioguydefinitely going to want to trace what this EP does if we want external touchid to work under linux