#asahi-dev · 2022-06-30 16:27
marcan... okay that fixup wasn't enough#asahi-dev · 2022-06-30 14:25
marcanfixup pushed to bits/020-t6000-dart#asahi-dev · 2022-06-30 14:13
marcanfor modules you need to define the other deps separately in the Makefile, otherwise they become separate modules#asahi-dev · 2022-06-30 14:11
marcanjannau: ERROR: modpost: missing MODULE_LICENSE() in drivers/iommu/io-pgtable-dart.o :)#asahi-dev · 2022-06-30 13:28
marcanin every other case of coprocessors so far (display controller, GPU, power metrics controller, SMC, camera though that one's even more special, and I think the neural engine too) the main coprocessor interface/mailbox and protocol stack is the main communication mechanism, so I think what we're doing with the single node is correct and we should keep doing it.#asahi-dev · 2022-06-30 13:25
marcan... makes sense.#asahi-dev · 2022-06-30 13:25
marcanone thing I thought of is having the coprocessor driver as a genpd, which feels a bit weird to say, but does provide the semantics we'd want ("this needs to be on before the consumer device") - I'll have to look at how it handles power management (can the copro turn off while the user isn't touching anything to save power and still get an IRQ? how would that work?) to see whether this actually ...#asahi-dev · 2022-06-30 13:24
marcanI'm not so sure that's the case here, it really does sound like we should use separate devices to model this new keyboard/trackpad coprocessor and the associated FIFO interface / HID protocol.#asahi-dev · 2022-06-30 13:23
marcan... there anyway.#asahi-dev · 2022-06-30 13:23
marcanso far we've only had one other device where the copro was *mostly* logically detached from the real device node, NVMe - in that case we ended up with a single device node for both, while that could've been modeled as separate devices. but that separate device abstraction is slightly leaky in the case of some debug commands at least, so there is some argument that a combined device is a good idea ...#asahi-dev · 2022-06-30 13:22
marcanbut I'd like to know your opinion on what this binding should look like#asahi-dev · 2022-06-30 13:22
marcanlogically, I would say the coprocessor is one device, the FIFO is another device, and the HID mapping is a direct consumer (child node?) of the FIFO and a device link to the coprocessor so it can depend on it being up#asahi-dev · 2022-06-30 13:21
marcan... there is no coprocessor involved.#asahi-dev · 2022-06-30 13:21
marcanso we have the coprocessor (which just needs to come up), the interface (which is a dumb byte FIFO - is there any subsystem binding / consumer type stuff that would fit here?), and then some kind of HID device binding on top. but that same FIFO hardware type is used as a special debug UART too (we just haven't implemented it yet), so it should also have a tty consumer driver. and in that case ...#asahi-dev · 2022-06-30 13:20
marcandid you see my earlier comments on the new keyboard/touchpad story? TL;DR there is now a coprocessor involved, with the usual interface, but that interface isn't used for the actual data - there is another interface for that, which is logically independent. So far we've treated the coprocessors as an integral part of the device they manage, but in this case it really behaves more like a "helper".#asahi-dev · 2022-06-30 13:18
marcanrobher: great! :)#asahi-dev · 2022-06-30 10:08
marcanbut this is good for working out how sleep/wake works, especially if I can figure out how to trigger a wake signal in a way that macOS likes, without breaking the HV#asahi-dev · 2022-06-30 10:07
marcannot sure if that means it's s2idle type stuff, or if the final sleep trigger would be the boot CPU going into low power mode and we just aren't doing that#asahi-dev · 2022-06-30 10:07
marcanI had macOS go to sleep and woke up to a live hypervisor#asahi-dev · 2022-06-30 10:07
marcanso that's good for figuring out sleep mode stuff#asahi-dev · 2022-06-30 10:06
marcanalso, another funny thing I noticed: sleep in macOS does *not* kill the hypervisor now (not: the HV has always hijacked the CPU sleep mode stuff to stop them from disabling IRQs/etc)#asahi-dev · 2022-06-30 10:06
marcanmaybe something linux does makes it work?#asahi-dev · 2022-06-30 10:05
marcanneed to check again#asahi-dev · 2022-06-30 10:05
marcanI'm not sure what's up#asahi-dev · 2022-06-30 10:05
marcanI remember something being broken there, yeah. reset did not work for me initially but did later, in the hypervisor?#asahi-dev · 2022-06-30 10:04
marcan(at least some of the time)#asahi-dev · 2022-06-30 10:04
marcanthis is very much a usable state of affairs for a distro installer if you can plug in an external keyboard, so I consider that a success story for my theory that we can support upcoming SoCs in old kernels with just bootloader/DT changes "enough to install a distro and upgrade to a hardware enablement kernel"#asahi-dev · 2022-06-30 10:03
marcanand the RTC offset is there#asahi-dev · 2022-06-30 10:03
marcanSPMI did#asahi-dev · 2022-06-30 10:03
marcancurrent M2/t8112 status is that, if PCIe doesn't have any surprises (it's missing bootloader enablement still, haven't tested it), and if we'd done t8110-DART ahead of time (which we didn't, but was needed for M1 Pro/Max too, we just didn't get to it in time), M2 would've booted unmodified kernels with missing keyboard/mouse, RTC, and poweroff support (new hardware for those)#asahi-dev · 2022-06-30 10:01
marcanI might cap the "generic" compatible mode to 16 pstates or so, just to be safe, so in that case older kernels wouldn't reach the highest CPU p-states (which is still a usable state, we do expect people to upgrade kernels to seriously use new machines, I just want the things to be able to boot if at all possible)#asahi-dev · 2022-06-30 09:59
marcan(with the driver only binding to apple,t8112-soc-cpufreq and apple,soc-cpufreq unless in the future we find something special to do for tFOO)#asahi-dev · 2022-06-30 09:58
marcanfor future SoCs that remain compatible (as far as we can tell) then we'd end up with something like "apple,tFOO-soc-cpufreq", "apple,t8112-soc-cpufreq", "apple,soc-cpufreq", if that works for you?#asahi-dev · 2022-06-30 09:58
marcanmy current idea for that one is have a generic compatible that doesn't use that register (which is still very much a usable result), and then use the per-SoC compatibles to enable it knowing the bit count.#asahi-dev · 2022-06-30 09:57
marcanthat one is nice to have so cpufreq can report the accurate *current* frequency, capped by hardware limits, not just what the kernel asked for.#asahi-dev · 2022-06-30 09:56
marcanalmost everything in M2 is directly compatible, or wildly new drivers in a few cases. the one annoying case I found so far is cpufreq (not upstream yet), which had to add a bit to the pstate counts, which was fine for the main switching register but shifted a field in the feedback register I'd discovered and started using.#asahi-dev · 2022-06-30 09:55
marcanso I think I made the right call with the generic compatibles :)#asahi-dev · 2022-06-30 09:55
marcan(and the aic1 binding apparently goes back quite a few Axx generations, folks backported Linux to some much older chips and the driver only needed trivial changes that can be autodetected)#asahi-dev · 2022-06-30 09:54
marcanrobher: btw, the aic2 binding applies unmodified to M2 ;)#asahi-dev · 2022-06-28 11:25
marcanso it looks like they moved a big pile of functionality from the STM32 and BCM5976 alike into the ASC. Not sure if they kept the same STM32 or it's a smaller one now. Both firmwares are tiny compared to the originals.#asahi-dev · 2022-06-28 11:24
marcanthat one shrank too#asahi-dev · 2022-06-28 11:24
marcanah, I found the Broadcom firmware for the M2. It's still there, just next to the touch bar firmware for some silly reason.#asahi-dev · 2022-06-28 10:59
marcansomeone said "give me something like a SPI/whatever uart" and they had dockchannel lying around#asahi-dev · 2022-06-28 10:59
marcan*shrug*#asahi-dev · 2022-06-28 10:54
marcanthe ASC is doing all the trackpad multitouch algorithmic magic, force touch, etc#asahi-dev · 2022-06-28 10:54
marcanthe ASC contains the actual SPI driver but it doesn't talk the old protocol, it talks some lower level whatever to the raw chip#asahi-dev · 2022-06-28 10:53
marcanit replaces SPI from the point of view of the OS#asahi-dev · 2022-06-28 10:53
marcandockchannel is a dumb fifo between the coprocessors, which is used here in lieu of RTKit mailbox stuff for the actual touchpad#asahi-dev · 2022-06-28 10:53
marcancorrect#asahi-dev · 2022-06-28 10:51
marcananother potential dockchannel consumer would be a simple tty/uart device (that would expose the debug dockchannel)