#asahi-dev · 2022-01-23 23:14
unrelentingtechand all I did for amdgpu was make `ioremap_nocache`, `ioremap_wt` and `ioremap` all map as device-nGnRnE.. (which, yeah, probably wt shouldn't be, but whatever)#asahi-dev · 2022-01-23 23:12
unrelentingtechbluerise: hmm. in FreeBSD/arm64 we define write combining as equal to write through https://github.com/freebsd/freebsd-src/blob/f72926eab00ccd956298e44831b519daa704a868/sys/arm64/include/vm.h#L48#asahi-dev · 2021-12-19 20:23
unrelentingtechwell, backlight does use the keyboard device on the outer message level#asahi-dev · 2021-12-19 20:22
unrelentingtechthat's in the same byte as "1 for keyboard, 2 for trackpad" so they kinda make sense as "virtual devices". 0xD0 where "d" is for "device info" and 0xB0 where "b" is for "backlight"#asahi-dev · 2021-12-19 20:19
unrelentingtechwow that's odd. they've had it on SPI since 2016 and now they moved it to a more "raw" interface for.. reasons?? even though the SPI-speaking microcontroller in the topcase basically stayed the same#asahi-dev · 2021-12-19 20:16
unrelentingtechapplespi does have backlight, if my understanding of these magic bytes is right it's also a "write" but to the 0xB0 device#asahi-dev · 2021-12-19 20:12
unrelentingtechI can't test backlight in my driver because the 2015 MBP I have still does it via the SMC :D#asahi-dev · 2021-12-19 20:10
unrelentingtechI have it like this: https://github.com/DankBSD/base/blob/f09c439be17a3972dc42be4aacb6303ac9e58df1/sys/dev/atopcase/atopcase.h#L42#asahi-dev · 2021-12-19 20:10
unrelentingtechkeyboard LEDs are just a HID write#asahi-dev · 2021-12-19 20:01
unrelentingtechjannau: ooh nice find on the vendor/product ids \o/ btw SPIHID_SET_LEDS looks unused#asahi-dev · 2021-12-15 12:10
unrelentingtechyeah the "you have to set a resolution" thing isn't very.. discoverable#asahi-dev · 2021-12-15 12:08
unrelentingtechmarcan: oh you found the bcm5974 pressure thing :D that I reported to libinput a couple weeks ago https://gitlab.freedesktop.org/libinput/libinput/-/issues/697#asahi-dev · 2021-12-13 20:27
unrelentingtechbcm5974 uses the 48th byte (on current models) as the beginning of big finger data. so the fixed size whatever before that does also contain finger data in the compact format it seems. I'm gonna play with some parser things..#asahi-dev · 2021-12-13 20:20
unrelentingtechthe 9th byte is always 0x31 on the magic and 0x75 on the internal, maybe that means compact vs big format for the following finger data#asahi-dev · 2021-12-13 20:19
unrelentingtechthey do have the first 8 bytes in common, at least#asahi-dev · 2021-12-13 20:18
unrelentingtechyeah, I've just logged some packets from my 2015 mbp too#asahi-dev · 2021-12-13 20:15
unrelentingtechtiny, 21 bytes for 1 finger#asahi-dev · 2021-12-12 20:22
unrelentingtechwait are they getting the same result as ` c->y.min + c->y.max - raw2int(f->abs_y)` from bcm5974 with.. this#asahi-dev · 2021-12-12 20:18
unrelentingtechwait wh.. what are they doing in that magic trackpad2 code with `tdata[1]`. why is that byte in both X and Y o_0#asahi-dev · 2021-12-12 20:14
unrelentingtechkettenis: cool, so it's the same "model 6" applespi already knows about from /* MBP13,3 MBP14,3 */#asahi-dev · 2021-12-12 20:13
unrelentingtechbut the further down things in magicmouse just use 1-byte values, while the bcm5974 struct is all le16#asahi-dev · 2021-12-12 20:13
unrelentingtechah well the x,y look right, they do decode a 16-bit number there#asahi-dev · 2021-12-12 20:12
unrelentingtechnot sure how any of this though https://github.com/torvalds/linux/blob/90d9fbc16b691403a80a119d7094528721c03279/drivers/hid/hid-magicmouse.c#L222-L232 decodes the same struct as https://github.com/torvalds/linux/blob/90d9fbc16b691403a80a119d7094528721c03279/drivers/input/mouse/bcm5974.c#L220-L234#asahi-dev · 2021-12-12 20:10
unrelentingtechhm yeah, looks like they use INPUT_MT_TRACK for trackpad2 (only)#asahi-dev · 2021-12-12 20:09
unrelentingtechas trackpad2?#asahi-dev · 2021-12-12 20:03
unrelentingtechoh btw that byte in the decoded HID descriptor is part of: '0x96, 0xDF, 0x03, // Report Count (991)' ← the 0x03 here. that's the report count for the vendor-defined collection#asahi-dev · 2021-12-12 20:01
unrelentingtechso with my WIP FreeBSD SPI-apple-HID driver (for Intel Macs) I did this https://github.com/DankBSD/base/blob/13f7569173ece71578c4c4e7ffc0b21597352cf2/sys/dev/hid/bcm5974.c#L349-L384 - the transport extracts that byte and presents it as the HID version for our bcm5974 to match on..#asahi-dev · 2021-12-12 19:58
unrelentingtechand the "model number" in that byte is 3, which makes sense, it's the previous one to the one applespi started with (4)#asahi-dev · 2021-12-12 19:58
unrelentingtechon the 2015 MBP (the one with both USB and SPI) the descriptor literally is the exact same over USB and SPI#asahi-dev · 2021-12-12 19:57
unrelentingtechand how they pull the model number from the 107th byte of what they described as "touchpad_info_protocol with 105 unknown bytes" but really is the HID descriptor#asahi-dev · 2021-12-12 19:56
unrelentingtechthe interesting bit of "documentation" in applespi is the models' sizes https://github.com/torvalds/linux/blob/90d9fbc16b691403a80a119d7094528721c03279/drivers/input/keyboard/applespi.c#L509-L523#asahi-dev · 2021-12-12 19:53
unrelentingtechjannau: yeah, applespi authors copy-pasted pieces of bcm5974 instead of making their driver a HID transport for bcm5974 to run on#asahi-dev · 2021-12-12 19:52
unrelentingtechkettenis: maybe the same hardware on the actual touch handling side but the external "magic" devices do their own processing so the packets are quite different. touches on magic already have IDs assigned