#
#asahi-dev · 2022-11-30 02:00
cyrozapHopefully these suggestions will help you fix the issues you were seeing with the firmware load process!
#asahi-dev · 2022-11-30 01:58
cyrozap100 ms or so (just a guess).
#asahi-dev · 2022-11-30 01:58
cyrozap5) Immediately after disabling SRAM write access (`asmedia_write_reg(hcd, 0x500e, 0);`), release the controller from reset with `asmedia_write_reg(hcd, 0x5042, 0);`. Then wait for the controller to initialize--it will reset itself once during this process in order to increase its clock speed from 78.125 MHz to 156.25 MHz, so don't try to talk to it before it's finished. Maybe add a delay of 10 ms or
#asahi-dev · 2022-11-30 01:50
cyrozapregister 0xEF needs to be set to enable readback (set it before doing the readback, but after writing has finished).
#asahi-dev · 2022-11-30 01:49
cyrozap4) As a safety check, after all the SRAM has been written to, the SRAM should be read back and compared with the firmware. Note that unlike when writing to SRAM, reading it back is done in 0x4000-byte/0x2000-word interleaved blocks instead of 0x8000-byte/0x4000-word blocks, and uses two dword registers (0x3018 and 0x301c) for that data instead of just one. And of course bit 6 in PCI config space
#asahi-dev · 2022-11-30 01:42
cyrozap3) Immediately after writing the code to SRAM (https://github.com/AsahiLinux/linux/blob/602fee88eb0603f4d7576797397aff6b33b41765/drivers/usb/host/xhci-pci-asmedia.c#L246), read the SRAM _address_ back in a loop to make sure that it's changed (it should have increased by two).
#asahi-dev · 2022-11-30 01:40
cyrozap2) Immediately after writing the SRAM address (https://github.com/AsahiLinux/linux/blob/602fee88eb0603f4d7576797397aff6b33b41765/drivers/usb/host/xhci-pci-asmedia.c#L243-L244), read it back in a loop until the value read matches the value that was written.
#asahi-dev · 2022-11-30 01:39
cyrozap1) Skip the controller reset (https://github.com/AsahiLinux/linux/blob/602fee88eb0603f4d7576797397aff6b33b41765/drivers/usb/host/xhci-pci-asmedia.c#L222-L229), and just do `asmedia_write_reg(hcd, 0x5042, 2);` to halt the controller and hold it in reset (note the "2" to halt instead of "1" for reset).
#asahi-dev · 2022-11-30 01:37
cyrozapfirmware is in fact running and that the code was all loaded correctly. Based on this research, I have several suggestions for the kernel code:
#asahi-dev · 2022-11-30 01:37
cyrozapmarcan: I've finished looking into the ASM3142 firmware loading process, and now have an implementation working in Python (https://github.com/cyrozap/asmedia-xhc-re/blob/836870de1d2584a5716d392b9cce4dfb5134d05f/tools/asm_tool.py). I haven't seen any issues uploading code into the host controller using this program--it seems to just work every time for me, and I've done testing to confirm that the
#asahi-dev · 2022-11-29 22:03
svenI’m pretty sure there must be a “usb 4 enabled” bit somewhere in data status and there must be a “enter usb” vdo Register somewhere as well
#asahi-dev · 2022-11-29 22:02
svenjannau: you had some usb4 device, didn’t you? can you trace all tps reads/writes when connecting that under macOS?
#asahi-dev · 2022-11-29 21:52
eilnane power tunables are constant & retain state so I chucked them under tunables_static.c
#asahi-dev · 2022-11-29 19:25
mpshaha, you made me smile today
#asahi-dev · 2022-11-29 19:12
zzywysmworks for AMD
#asahi-dev · 2022-11-29 19:12
zzywysmmarcan: regarding drm, perhaps tell lina to expand the size of her GPU driver by a few million lines, and then the maintainers will accept it all with no comments at all :D
#asahi-dev · 2022-11-29 18:29
mazthis is mostly a copy-paste for the AIC driver, and I hope to try and move the driver over to that...
#asahi-dev · 2022-11-29 18:28
mazmarcan: btw, re: irq and memory ordering. feel free to eyeball 20221129142449.886518-4-apatel@ventanamicro.com if you get a chance.
#asahi-dev · 2022-11-29 16:52
marcanGood :)
#asahi-dev · 2022-11-29 16:41
svenat least the irc channel seems nice. I asked one questions about that OOB HPD thing and had like three people replying in <15 minutes or so
#asahi-dev · 2022-11-29 16:39
marcanI hear drm is supposed to be good, but let's just say my experience with simpledrm specifically was... Not Great. hope it's an exception.
#asahi-dev · 2022-11-29 16:39
svenso i guess I just used that api correctly on the first try which would be weird :D
#asahi-dev · 2022-11-29 16:38
marcanlol
#asahi-dev · 2022-11-29 16:38
sveni think watchdog was okay as well. Bluetooth was almost no bike shedding because there were almost no comments until they just accepted the driver :D
#asahi-dev · 2022-11-29 16:36
svenah, true, forgot about that one because I was only watching from the sidelines at that point
#asahi-dev · 2022-11-29 16:35
marcan(the bikeshedding there was warranted re: memory ordering)
#asahi-dev · 2022-11-29 16:35
marcanand irq
#asahi-dev · 2022-11-29 16:11
svenat least there are subsystems that aren't painful. nvme, i2c and usb went pretty well so far
#asahi-dev · 2022-11-29 16:07
mazI find the whole thing more and more depressing.
#asahi-dev · 2022-11-29 16:05
sveni also wouldn't be able to contribute things "easy" or "fast" to any modern frontend written in javascript
#asahi-dev · 2022-11-29 16:02
povikuh, what a strawman
#asahi-dev · 2022-11-29 16:02
povik> You say this like any newbie should be able to send a patch and get it accepted right away
#asahi-dev · 2022-11-29 14:29
dottedmagIt probably does not help that DT is so generic that every reviewer has their own idea how to "best" describe the hardware.
#asahi-dev · 2022-11-29 14:03
mazprobably less eloquently ;-)
#asahi-dev · 2022-11-29 14:03
mazI said what I had to say as well.
#asahi-dev · 2022-11-29 14:00
marcanreplied.
#asahi-dev · 2022-11-29 13:38
marcansigh...
#asahi-dev · 2022-11-29 12:24
mazyeah. classic example of better being the ennemy of good...
#asahi-dev · 2022-11-29 12:15
sven:(
#asahi-dev · 2022-11-29 11:54
kettenis_tis way the machines will be obsolete before things are fully upstreamed
#asahi-dev · 2022-11-29 11:53
kettenis_oh FFS, is there any hope for doing this sort of thing without bikeshedding things to death
#asahi-dev · 2022-11-29 11:49
mazand I thought the dust was settling on the cpufreq binding... oh well.
#asahi-dev · 2022-11-29 07:21
tpw_rulesi tested and it works for nixos at least again
#asahi-dev · 2022-11-29 07:20
tpw_rulesmarcan: bingo, thanks much <3
#asahi-dev · 2022-11-29 07:09
marcanI really need to add that to our script, I probably broke usb during initramfs in our atc update
#asahi-dev · 2022-11-29 07:08
marcanatc needs that
#asahi-dev · 2022-11-29 07:08
marcantpw_rules: nvmem_apple_efuses
#asahi-dev · 2022-11-29 07:08
marcanohh wait
#asahi-dev · 2022-11-29 07:06
marcani.e. tps6598x
#asahi-dev · 2022-11-29 07:06
marcantpw_rules: is tipd in there?

plus ›