#asahi · 2021-09-27 12:12
marcanhttps://mrcn.st/t/j457ap.adt.txt https://mrcn.st/t/j456ap.adt.txt https://mrcn.st/t/j313ap.adt.txt https://mrcn.st/t/j293ap.adt.txt https://mrcn.st/t/j274ap.adt.txt#asahi · 2021-09-27 12:12
marcanyou can just dump them from an IPSW#asahi · 2021-09-27 12:02
marcanklange: I think here HDMI audio is integrated into the SoC audio stuff#asahi · 2021-09-27 10:59
marcandon't think I've ever seen that done in hardware on any laptop#asahi · 2021-09-27 10:59
marcannah, BT is all software#asahi · 2021-09-27 10:57
marcanthere's also HDMI audio, which I assume is somehow internally routed into the display block#asahi · 2021-09-27 10:57
marcanand then whatever they're doing with microphones, pretty sure these machines have at least two#asahi · 2021-09-27 10:56
marcanon these machines I'd expect at least separate outputs for speaker, headphone jack, and possibly s/pdif if they're still doing that over those jacks#asahi · 2021-09-27 10:50
marcanyeah, both of those work#asahi · 2021-09-27 10:44
marcanthat would just slow things down#asahi · 2021-09-27 10:44
marcanpovik: also M1-specific, since it's cache-coherent as I said, don't bother with uncached memory or any of that#asahi · 2021-09-27 10:43
marcansee memory-barriers.txt, that has some obvious examples#asahi · 2021-09-27 10:43
marcansince that isn't mmio#asahi · 2021-09-27 10:43
marcanthat too, if you have DMA descriptors in normal memory that need to have flags set in a given order (e.g. ownership flags) or things like that, that needs barriers too#asahi · 2021-09-27 10:42
marcan(as opposed to normal memory)#asahi · 2021-09-27 10:42
marcansame thing that makes mmio ordered wrt itself#asahi · 2021-09-27 10:42
marcanyeah#asahi · 2021-09-27 10:40
marcanwe haven't validated the ordering semantics, but the only real reason for them to exist is a pre-standard version of that...#asahi · 2021-09-27 10:40
marcanj_ey: see CNTPCT_ALIAS_EL0 CNTVCT_ALIAS_EL0 in apple_regs.json#asahi · 2021-09-27 10:39
marcanj_ey: and Apple already has those as impdefs in M1 (we think)#asahi · 2021-09-27 10:38
marcanthat will make sure the memory attributes are set up properly#asahi · 2021-09-27 10:38
marcanM1-specific, make sure you use of_iomap to get your register ranges mapped#asahi · 2021-09-27 10:37
marcan"get current time" is a CPU system register, not MMIO#asahi · 2021-09-27 10:36
marcane.g. "write a register, get current time" might give you a time before the register actually got written without a barrier#asahi · 2021-09-27 10:36
marcanthis mostly only matters if you're dealing with timestamps#asahi · 2021-09-27 10:36
marcanhowever, the CPU does speculate, so don't assume any writes or reads actually happened in later non-memory code#asahi · 2021-09-27 10:35
marcannope, those are all ordered#asahi · 2021-09-27 10:34
marcancertainly all ARMv8#asahi · 2021-09-27 10:34
marcanand yes, none of this is M1-specific, this basically goes for all architectures#asahi · 2021-09-27 10:34
marcansimilarly, if you have "okay, the device wrote stuff to RAM and told us about it, so go read it", that needs a barrier or non-_relaxed#asahi · 2021-09-27 10:34
marcanso if you have a sequence of operations that is like "okay, stuff got written to RAM, now tell the device about it", then that needs a barrier or the first MMIO to tell the device about it needs to be a non-_relaxed#asahi · 2021-09-27 10:33
marcanthen you use readl/writel or dma_ barriers#asahi · 2021-09-27 10:32
marcanthe main thing is to use readl_relaxed/writel_relaxed *unless* you are doing something that needs to be ordered with respect to DMA#asahi · 2021-09-27 10:31
marcanpovik: thankfully for a "typical" driver you don't need to worry *too* much about this, other than standard locking/concurrency primitives#asahi · 2021-09-27 10:28
marcanalso probably https://www.youtube.com/watch?v=6LoWmTrHP9I#asahi · 2021-09-27 10:27
marcanhttps://www.youtube.com/watch?v=i6DayghhA8Q#asahi · 2021-09-27 10:27
marcanhttps://www.youtube.com/watch?v=6ORn6_35kKo#asahi · 2021-09-27 10:27
marcanthen the other good news is you get to watch Will's talks!#asahi · 2021-09-27 10:25
marcanwell... the good news is everything is cache coherent on the M1, as far as we know#asahi · 2021-09-27 10:14
marcan*10m#asahi · 2021-09-27 10:14
marcanit's not too bad though, ~5m USB3 ~10M USB2#asahi · 2021-09-27 09:26
marcanthat's sad, USB3 makes the restore more than 2x faster#asahi · 2021-09-27 09:26
marcan(even with a Linux host and idevicerestore)#asahi · 2021-09-27 09:26
marcan11.6 restores in USB3 (10Gb/s), 12.0 always seems to go to 480Mb/s with the same cable#asahi · 2021-09-27 09:26
marcanhm, seems Apple both fixed the role swap issue in 12.0, and also gimped it to USB2#asahi · 2021-09-27 09:01
marcanseems gadget mode in macos isn't quite as stable as it should be#asahi · 2021-09-27 09:01
marcanlooks like that's just flaky USB hardware in these things... :/#asahi · 2021-09-27 09:00
marcanheh, an AC2 restore just failed halfway through with a USB dropout, just like I saw with idevicerestore a few times#asahi · 2021-09-27 08:58
marcanthe arduino resets on DTR or something like that#asahi · 2021-09-27 08:58
marcanbgb_: yes, I always open a terminal to the ch340 first so I can see the init output