#
…

2021-12-19

00:11MajorBiscuit has quit [Quit: WeeChat 3.3]
00:24nabaiste^ has quit [Ping timeout: 480 seconds]
00:25marcansven: most of the SIO firmware is zeroes
00:25marcanit's like 128K of actual code
00:25marcannot even that, 96K or so?
01:06nabaiste^ has joined #asahi-dev
02:15Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:16Dcow has joined #asahi-dev
02:36Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:53riker77_ has joined #asahi-dev
02:58riker77 has quit [Ping timeout: 480 seconds]
02:58riker77_ is now known as riker77
03:41kov has quit [Quit: Coyote finally caught me]
04:02phiologe has quit [Ping timeout: 480 seconds]
04:53amarioguy has quit [Ping timeout: 480 seconds]
04:59nabaiste^ has quit [Ping timeout: 480 seconds]
06:15Glanzmann has quit [Quit: EOF]
06:42chadmed has joined #asahi-dev
07:48amarioguy has joined #asahi-dev
08:08amarioguy has quit [Ping timeout: 480 seconds]
08:59MajorBiscuit has joined #asahi-dev
09:16kov has joined #asahi-dev
09:26somdkls^ has joined #asahi-dev
09:36chadmed has quit [Remote host closed the connection]
09:44chadmed has joined #asahi-dev
10:05MajorBiscuit has quit [Ping timeout: 480 seconds]
10:25aleasto has joined #asahi-dev
10:53gabuscus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
10:54gabuscus has joined #asahi-dev
11:04amarioguy has joined #asahi-dev
11:16___nick___ has joined #asahi-dev
11:16___nick___ has quit []
11:18___nick___ has joined #asahi-dev
11:24MajorBiscuit has joined #asahi-dev
11:24amarioguy has quit [Ping timeout: 480 seconds]
12:16Dcow has joined #asahi-dev
12:25m42uko has quit [Quit: Leaving.]
12:25m42uko has joined #asahi-dev
12:38Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:46MajorBiscuit has quit [Ping timeout: 480 seconds]
12:47Dcow has joined #asahi-dev
12:53kettenisok, got OpenBSD to start the NVMe firmware
12:53MajorBiscuit has joined #asahi-dev
12:53kettenisstill needs a bit of work to get it in a committable stage though
12:59Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:05aleasto has quit [Remote host closed the connection]
13:14Jamie[m]1nyaa indeed
13:15MajorBiscuit has quit [Ping timeout: 480 seconds]
13:16MajorBiscuit has joined #asahi-dev
13:20somdkls^ has quit [Remote host closed the connection]
13:21cynthia has joined #asahi-dev
13:21amarioguy has joined #asahi-dev
13:21cynthiaI heard there was nyaa-ing going on in here?
13:53chadmed has quit [Remote host closed the connection]
14:00svenhrm, macOS seems to use the flush command as well. I wonder why it isn’t slowed as much as Linux is
14:11svenanyway, nvme/dev should fix the error recovery stuff now
14:21marcanj`ey: ha
14:21marcanso about this wifi thing... I'm getting really annoyed :/
14:22j`eysven: check the link too ^
14:22marcanit seems to crash in a few ways, and I ended up throwing a crashed memory image into ghidra to try to trace what happened, and I ended up with "ROM function called panic()" :/
14:22marcan(and I haven't dumped the ROM)
14:23marcanmaybe I should do that...
14:24marcanbut I get the feeling the ROM function that panicked is the one handling the AXI error
14:24marcan(since those strings aren't in the firmware)
14:24marcan... so now we're back at "weird random bus error with no clear cause"
14:26kettenissven: the code in apple_nvme_reset_work() works to reset the thing?
14:27svenrtkit still needs to be alive and cleanly shut down though :(
14:27kettenisso the steps are: 1. shutdown rtkit, 2. clear coproc run bit, 3. assert reset
14:27svenyou can also clear the bit before shutting down rtkit
14:27svenit seems to be more like “start cpu”
14:28kettenisok, need to implement the reset functionality in u-boot then
14:30j`eymarcan: I have no ideas (apart from tracing macOS more, maybe some extra SMC/gpio / magic pokes), but I have faith you'll figure it out!
14:35marcanthanks :p
14:39marcanwell that is useful :D
14:39marcanhow on earth did someone get broadcom to GPL that?
14:39marcansome of that code is the same as the ROM
14:40marcanit also has the proper TCM size computation algorithm (which I'd already guessed but I wasn't sure about the block size flag, this clarifies it)
14:40kettenisis that essentially the android driver?
14:41marcanI guess?
14:45egavinc has joined #asahi-dev
14:46svenalright, i think i'm mostly happy with nvme/dev now. there's still that weird flush slowdown but other than that i haven't been able to make it panic anymore
14:47tpw_rulesis there new shutdown code?
14:47svennot really. since yesterday i've just fixed a few bugs w.r.t interactions with the linux nvme subsystem
14:47marcanheh, this has full register lists. handy.
14:48sven(plus the usual cleanup)
14:50marcan uint32 axi_dbg_ctl; /* 0x1C4 */
14:50marcan uint32 axi_dbg_data0; /* 0x1C8 */
14:50marcan uint32 axi_dbg_data1; /* 0x1CC */
14:50marcanheh, can I issue arbitrary AXI transactions with this? that sounds handy :p
14:51marcan(or maybe it's just reading? no idea)
14:55svenaw.. so telling ANS what time it is also doesn't make the flushs go faster :D
15:01kettenisare the flushes slow as well under macOS?
15:02svennot 100% sure yet, but macOS at least uses flushs
15:13kettenissven: that worked
15:16kettenisso I can do a shutdown + reset in u-boot and than reinitialize in openbsd
15:16kettenisthat shuld make linux happy as well
15:16svennice :)
15:18kettenisso it seems I can get away with not starting syslog and feeding crashlog and ioreport 0 as the address when they ask for a buffer
15:18kettenisthat simplifies the u-boot code considerably
15:29Dcow has joined #asahi-dev
15:33svenhrm, so i think macos just issues much less flush commands compared to linux
15:37svenmarcan: alright, i think you can replace the old driver in asahi with what's in nvme/dev if that branch still works on t6k
15:42sven(knowing my luck that one kernel panics for everyone else while it works just fine for me :D)
15:42tpw_ruleskettenis: i had a couple other things i think need to be fixed in the rtkit code. this was my patch for that and the nvme shutdown stuff: https://pastebin.com/Vfn4Exw1
15:45kettenisI'll see if I missed some things
15:49leah2 has quit [Remote host closed the connection]
15:51leah2 has joined #asahi-dev
16:04svenso if that nvme driver works and the rtkit library also works for SMC I think everything should be ready to submit a RFC in January
16:12marcanI think I fixed wifi
16:12marcanapparently I needed to reset less, not more
16:12marcanbut... I might know what causes this
16:14jnhmm, non-idempotent resets…
16:19marcanso resetting the D11 cores breaks it
16:19marcanand now I look at the reset function in that broadcom dump and
16:19marcan#ifdef UCM_CORRUPTION_WAR
16:19marcanwhat's this.
16:20marcanthis looks like a bug workaround...
16:27tpw_rulesjust to confirm, there are no objections to releasing a short guide on how to install nixos standalone with u-boot?
16:43kettenistpw_rules: I would avoid documenting things that get out of date fast
16:44kettenisespecially in a form that risks lingering on (like a blog)
16:44kettenispushed a u-boot that resets nvme
16:44kettenistests welcome...
16:49marcanok, that workaround doesn't fix it
16:49marcanlooks like I just have to not reset the wlan cores
16:54egavinc has quit [Quit: Leaving]
17:04jannauI might not want to map KEY_SLEEP for now (at least in the HV)
17:06jannaubare metal as well
17:07jannauI guess we should find other ways to make sure we do not suspend for now
17:11chengsun has joined #asahi-dev
17:25marcan[ 234.006161] ieee80211 phy0: brcmf_run_escan: error (-52)
17:25marcan[ 234.007321] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
17:25marcanwhoops, I guess wifi doesn't *quite* work yet
17:27marcan[ 30.129014] brcmfmac: brcmf_fil_cmd_data Firmware error: BCME_VERSION (-37)
17:27marcanokay, I guess the ABI changed for something
17:31marcanlooks like that android driver supports v2, yay
17:50tpw_ruleskettenis: i tested your version out, and it looks like when rtkit starts again, it asks for a 0 length buffer on endpoint 1, which causes the linux kernel to try to allocate a 0 length dma buffer and get upset. not sure if that's the kernel's problem but rtkit asking for such a buffer seems suspicious
17:52tpw_rules(this is not using the nvme/dev branch)
17:54kettenishard to see how that's a problem with u-boot
17:54Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:54kettenisunless the reset that's done is only partial
17:55sventhe reset is unfortunately not a full reset :(
17:55tpw_rulesi think that's what's happening. rtkit is somehow remembering that you sent it a 0 length buffer in u-boot and asking for that again next time
17:56tpw_rulesnow the kernel should probably have better parameter validation, but rtkit asking for 0 length buffers seems like it will easily create future problems
18:02jannauupdated keyboard / trackpad driver pushed to https://github.com/jannau/linux/tree/dev/spi-hid-apple (rebased onto current linux-asahi)
18:04jannauonly user visible changes should be the correct mapping of the function keys hand hopefully a correct contry code for the keyboard
18:06jannaucountry code and vendor/product ID are read from keyboard's EC
18:07jannaukettenis: so there is hopefully no need to place anything in the device tree
18:07kettenisso you figured out where it comes from?
18:08jannauyes, not hard once I was able to trace macos' SPI communication
18:12jannauit has requests for device and interface information. sorry for the mess with magic numbers but the defines made harder to think how HID is mapped here
18:14jannauI still have no good understanding but the clearly wrong exisitng names were not helping
18:19Dcow has joined #asahi-dev
18:21kettenisI'll see if I can make a bit more sense of that
18:22tpw_rulesalright, i patched the kernel to handle the zero length buffer request and it seems that only happens on the crashlog endpoint. the syslog and ioreporting endpoints request the same length as before and seem to work properly, including shutdown. so maybe u-boot's behavior is valid and this case should be handled in apple_rtkit_common_rx_get_buffer. but i'm not sure what will happen if rtkit crashes now
18:31Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:32marcanadded the escan v2 thing... now it wants a version bump for the pmkid_list too, sigh
18:32marcanI should get some sleep, I can wrap this up tomorrow
18:32marcanat least I got as far as listing all the SSIDs :p
18:33Dcow has joined #asahi-dev
18:34marcantpw_rules: I think you can supply a different size buffer from the request
18:34marcanso maybe linux should just do that
18:34marcanor maybe u-boot shouldn't use zero length buffers :p
18:37j`eymarcan: im not sure what youve been modifying, the linux driver right? not the firmware..
18:37marcanyes, the driver
18:38marcanadding support for new bits of ABI that are required by the 4387 firmware
18:39kettenismarcan: ah, wait, looks like I screwed something up when cleaning up that diff
18:39ketteniss/diff/commit/
18:40marcanj`ey: https://mrcn.st/p/MWCXd1IO this is the first half
18:42marcanoff to sleep, hopefully it's just the pmkid list that needs updating now
18:42marcan... which is apparently up *two* versions, not just one
18:42j`eymarcan: see ya, and gg for todays SSID scan progress!
18:43marcanI should time how long it takes me to clean up this patchset into something sane... it's not going to be easy, heh
18:45j`eyshame that android patch for v2 wasnt upstreamed
18:47kettenisshame that a eparate android driver even exists
18:54kettenistpw_rules: the commit I just pushed should fix that issue
18:59kettenisconclusion: the core isn't reset fully
19:02svenyeah, it also can’t recover from a panic with that reset
19:39jannausven: typo in the sart bindings: "apple,6000-sart", missing a 't'
19:48jannauboots on t6001. asahi with rtkit, sart and nvme-apple commits replaced and dts adapted
19:49jannaurootfs on nvme
19:52svennice, thanks!
19:54tpw_ruleskettenis: yup it all works good now, thank you
19:57jannaumarcan: trivial t600x dts fix after updating asahi with nvme/dev: https://github.com/jannau/linux/commit/9a225d0140c39de8198d1a25bc0c01d13ef1e6ef
20:00svenI’m still not 100% about the nvme compatibles. I think the ADT identifies it as ANS2 but ioreg calls it ans3
20:00svenprobably doesn’t matter in the end though
20:01Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:01unrelentingtechjannau: ooh nice find on the vendor/product ids \o/ btw SPIHID_SET_LEDS looks unused
20:07jannauunrelentingtech: yes, still not feature complete. I haven't even checked if supports setting keyboard backlight
20:10unrelentingtechkeyboard LEDs are just a HID write
20:11gladiac is now known as Guest8870
20:11gladiac has joined #asahi-dev
20:12unrelentingtechI can't test backlight in my driver because the 2015 MBP I have still does it via the SMC :D
20:14kettenisright, keyboard LEDs are just a HID output report
20:14kettenisI doubt the keyboard backlight is done that way
20:15j`eyi think keyboard backlight is SMC too
20:16unrelentingtechapplespi does have backlight, if my understanding of these magic bytes is right it's also a "write" but to the 0xB0 device
20:16jannauI'm not sure it's supported on M1 either, there is a pwm driver for it: https://github.com/AsahiLinux/linux/pull/5
20:17Guest8870 has quit [Ping timeout: 480 seconds]
20:18Dcow has joined #asahi-dev
20:19jannauI'm not convinced that 0xb0 is a real device. the 4 MSB could be something else
20:19unrelentingtechwow 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
20:22unrelentingtechthat'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"
20:23unrelentingtechwell, backlight does use the keyboard device on the outer message level
20:28jannaudevice 0 is called "Device Management". I would expect that to provide the device info
21:05MajorBiscuit has quit [Quit: WeeChat 3.3]
21:07___nick___ has quit [Ping timeout: 480 seconds]
21:57Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:59Dcow has joined #asahi-dev
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:01yrlf has joined #asahi-dev
23:44el_mugroso has joined #asahi-dev
23:47el_mugroso has quit []
…