#asahi-dev · 2021-12-17 22:14
tpw_rulessven: so there are a bunch of IOPs and one AP (of several cores)? i'm a little confused about what the SET_AP_PWR_STATE message is for then#asahi-dev · 2021-12-17 22:12
tpw_rulesj`ey: i mean my conception, driven purely by the names of the relevant messages, is that each thing that runs rtkit has both an IOP and an AP. is that true? #asahi-dev · 2021-12-17 22:10
tpw_rulesit seems to always print out stuff about garbage collection when linux starts it#asahi-dev · 2021-12-17 22:09
tpw_rulesthen what is the AP? #asahi-dev · 2021-12-17 22:07
tpw_rulesnot really knowing any of the context, maybe the nvme still works if the IOP is okay but the AP is not?#asahi-dev · 2021-12-17 22:06
tpw_rulesi mean it does by all accounts hang. it's just that that doesn't seem to matter too much somehow#asahi-dev · 2021-12-17 21:51
tpw_rulesthough the actual problem doesn't appear to be fixed yet#asahi-dev · 2021-12-17 21:48
tpw_rulesthis line https://github.com/kettenis/u-boot/blob/4f0f957e8e8f6ccb4d4b616d7954e85478e3d7e2/drivers/nvme/nvme_apple.c#L94 should be `addr = ofnode_get_addr_index(node, 0);`#asahi-dev · 2021-12-17 21:34
tpw_rulesthen yes, i'm pretty sure u-boot copied over the linux device tree, the semantics changed, but no one noticed because the drive still initialized enough to be readable#asahi-dev · 2021-12-17 21:34
tpw_rulesokay, so then the device tree is correct, i just explained it wrong#asahi-dev · 2021-12-17 21:33
tpw_ruleswell a) because it's how it is in that pastebin in the linux kernel device tree which works and b) i would expect it to read the address of the sart registers from the linked sart node#asahi-dev · 2021-12-17 21:32
tpw_rulesso that line should be reg = <0x02 0x7bcc0000 0x00 0x40000 0x02 0x7bc50000 0x00 0x10000>; ? i'm not so sure#asahi-dev · 2021-12-17 21:30
tpw_rulesi see that 0x277400000 pointer in the nvme's registers, do you expect that to point to the sart?#asahi-dev · 2021-12-17 21:30
tpw_rulesthis is the relevant part of the u-boot device tree: https://pastebin.com/Vzyv2B6S it's the same as the linux one, except the phandles are different naturally#asahi-dev · 2021-12-17 21:27
tpw_ruleswhat doesn't?#asahi-dev · 2021-12-17 21:27
tpw_rulesand it was never noticed since the drive still works...#asahi-dev · 2021-12-17 21:26
tpw_rulesyeah i just had that realization too. but the nvme's sart in the device tree is at 0x27bc50000 . so maybe u-boot is loading it wrong#asahi-dev · 2021-12-17 21:22
tpw_rulesi have a feeling it's not happy with the memory addresses it's given. it's not obvious to me how linux allocates the memory it hands out, and it doesn't seem to touch those MMIO registers at 0x2774000xx#asahi-dev · 2021-12-17 21:20
tpw_ruleskettenis: i an convinced at this point u-boot is not properly starting the ANS ASC, despite the fact that the drive works. see the logs here: https://pastebin.com/qdXKfVhZ . u-boot does not do most of the transactions on endpoint 4, never gets the final 0xb message on the management endpoint, and never gets any log messages#asahi-dev · 2021-12-17 17:35
tpw_ruleswhat is the apple device tree name of the ASC responsible for the nvme drive?#asahi-dev · 2021-12-17 14:00
tpw_ruleskettenis: ah ok, i saw some work on the spi drivers so i wasn't sure#asahi-dev · 2021-12-17 13:42
tpw_rulesby the way, do all the macbook keyboards work in u-boot in the apple-m1-m1n1-nvme branch#asahi-dev · 2021-12-17 13:40
tpw_ruleskettenis: yeah the drive does work, but it seems the processors are confused. i altered how u-boot started them slightly and then the processors at least replied to my shutdown messages, but linux still couldn't start them back up properly. ah well, i will get back to it in a few hours#asahi-dev · 2021-12-17 13:38
tpw_rulessven: ah ok, i got confused because i saw a commit with the same name that was more recent#asahi-dev · 2021-12-17 13:37
tpw_rulesbut the processors did not seem to be responding to my messages to shut them down. i was a bit suspicious that u-boot left them in a bad state starting up.#asahi-dev · 2021-12-17 13:35
tpw_ruleskettenis: i got far enough to figure out you need this flag: https://github.com/u-boot/u-boot/blob/7958292f5ffa4ecdaaf4c73c6df28006051db6e0/drivers/mmc/mmc-uclass.c#L504 to ask u-boot to remove it before starting the OS#asahi-dev · 2021-12-17 13:24
tpw_ruleskettenis: did you already have code to shut them down in u-boot in some other branch? i worked on it a bit last night but haven't got it working yet#asahi-dev · 2021-12-17 13:23
tpw_rulessven: ah hm, i guess that commit was never merged? i feel like that is new#asahi-dev · 2021-12-17 04:58
tpw_rulesi should probably figure out how to set up m1n1's rtkit logger thing#asahi-dev · 2021-12-17 04:57
tpw_rulesis any of the rtkit stuff documented anywhere except in that file? or has anyone posted logs of rtkit stuff wrt the nvme device?#asahi-dev · 2021-12-17 03:28
tpw_rulessven: so i noticed the shutdown stuff was removed at some point?#asahi-dev · 2021-12-16 21:20
tpw_rulesi see it now. cool, thank you!#asahi-dev · 2021-12-16 21:20
tpw_rulesah, it's behind the "large diffs are not rendered by default" banner#asahi-dev · 2021-12-16 21:19
tpw_rulesit doesn't take me anywhere in particular#asahi-dev · 2021-12-16 21:19
tpw_rulesi mean i only see its prototype and not a definition#asahi-dev · 2021-12-16 21:18
tpw_rulesjust to be sure, the function apple_rtkit_shutdown is defined in a different commit?#asahi-dev · 2021-12-16 21:18
tpw_rulesok so that's not possible for what we can call hardware limitations#asahi-dev · 2021-12-16 21:17
tpw_ruleson the other hand, it feels like the kernel should be able to either use it if it's already started, or reset it#asahi-dev · 2021-12-16 21:16
tpw_rulesif you can point me to code that shuts it down, i can probably figure out a patch for my setup#asahi-dev · 2021-12-16 21:16
tpw_rulesis that something u-boot currently doesn't do, or do we not know how to shut it down?#asahi-dev · 2021-12-16 21:12
tpw_rules(to be clear, this is not a new problem caused by recent changes AFAICT. i don't know of a setup that works)#asahi-dev · 2021-12-16 21:12
tpw_rulesin both cases i'm booting off a usb disk. i'm not sure if u-boot should be de-initializing something before it starts up the kernel, or the kernel needs better handling of an nvme that's already been initialized. cc: kettenis sven #asahi-dev · 2021-12-16 21:10
tpw_rulesso i am working on a boot flow using https://github.com/kettenis/u-boot/tree/apple-m1-m1n1-nvme/ and the latest linux-asahi kernel as of today. it seems there's an issue where if u-boot starts the nvme by running "nvme scan", the kernel fails to start it and prints "apple-ans-nvme 27bcc0000.nvme: RTKit did not boot". but if i stop u-boot from running that command, the kernel can start the nvme fine and everything works