#asahi-dev · 2021-03-13 16:20
svenmarcan: how do you want to handle the dma barries? add them to read32,etc like linux does or should i just explicitly put them into the usb code where they are required?#asahi-dev · 2021-03-13 16:19
svenpicocom works nicely :)#asahi-dev · 2021-03-13 14:24
svenhttps://f.svpe.de/188d046f7b2b145c1a56d8b9cbbf09323499cffd59ecd46b720fdb8a472f280c_m1n1_usb.txt at least it receives the nop command :)#asahi-dev · 2021-03-13 14:23
sventime to clean up the horrible code mess i created in the last hours and then see if i can get shell.py to work :)#asahi-dev · 2021-03-13 14:23
sveni've just used raw libusb now to confirm it works#asahi-dev · 2021-03-13 14:18
svenyeah, maybe i shouldn't have been using cat to test things :-P#asahi-dev · 2021-03-13 14:15
svenand that only took me ~4 hours to debug *sigh*#asahi-dev · 2021-03-13 14:14
svenugh, linux seems to wait for a \n before it returns cdc acm transfers to userland#asahi-dev · 2021-03-12 19:55
svenjuuuuust gotta fix something that's likely very dumb but keeps bulk xfers from working#asahi-dev · 2021-03-12 17:04
svenmaybe i should use something else for the serial in the descriptor, heh#asahi-dev · 2021-03-12 17:04
svencrw-rw-rw- 1 root wheel 9, 8 Mar 12 18:04 /dev/tty.usbmodemvc7855ac_dirty1 :-)#asahi-dev · 2021-03-12 16:59
svenoh, nice. i should read that#asahi-dev · 2021-03-12 16:59
svenah.. that would've been a good idea :D#asahi-dev · 2021-03-12 16:58
svenokay, great. that's what i got from the ARM ARM but i don't trust myself reading it#asahi-dev · 2021-03-12 16:50
svenadding dmb oshld fixes it, but erm, so does udelay#asahi-dev · 2021-03-12 16:49
svencould the cpu somehow speculate its way to the read32 from RAM, read the "invalid value", then an event actually happens, then the mmio read completes and i end up with that stale event value?#asahi-dev · 2021-03-12 16:49
sven(the usb controller dmas to that SOMETHING_IN_RAM)#asahi-dev · 2021-03-12 16:49
svennow sometimes I see n_events > 0 but then event still has the initial value i memset it to#asahi-dev · 2021-03-12 16:48
svenso I have u32 n_events = read32(SOME_MMIO_REGISTER); if (n_events < 0) return; u32 event = read32(SOMETHING_IN_RAM);#asahi-dev · 2021-03-12 16:48
svenmarcan: you've just gotten very familiar with memory barriers, haven't you? i have a rather strange bug here that might be related:#asahi-dev · 2021-03-12 16:21
svenover uart? i think i just used readmem(adt_addr, adt_len)#asahi-dev · 2021-03-12 09:44
svennot inside linux fwiw, the one in m1n1#asahi-dev · 2021-03-12 09:43
sventhere's also still the frame buffer console I should fix at some point ;)#asahi-dev · 2021-03-12 08:56
svenyeah, that's what I assume. during the enumeration phase it (obviously) times out rather quickly#asahi-dev · 2021-03-12 08:48
svenyeah, that's done in hw#asahi-dev · 2021-03-12 08:43
svenyou just need to call that one regularly before the host times out the transfers#asahi-dev · 2021-03-12 08:42
svenit's essentially just a big state machine#asahi-dev · 2021-03-12 08:42
svenI have a usb_dwc3_task() function that doesn't block (except for some while(timeout-- && read32(...) & SOME_FLAG)#asahi-dev · 2021-03-12 08:35
svenusb requires some clocks (clock-gates in the ADT which refers to entries in two properties of the pmgr node) to make MMIO reads/writes work and then some magic PHY pokes to allow the drd controller to come out of reset#asahi-dev · 2021-03-12 07:54
svenbut soon once i'm done with this#asahi-dev · 2021-03-12 07:54
svennot yet#asahi-dev · 2021-03-12 07:53
sventime to implement cdc now :)#asahi-dev · 2021-03-12 07:53
svenhttps://f.svpe.de/efc9f31e4b723c52f1d6265cd2e971b50b564c25f1a73c6982d745dc293f982a_m1n1_usb_mac.txt and it finally enumerates on mac os as well :)#asahi-dev · 2021-03-10 22:12
svenstill somehow broken but it's getting there#asahi-dev · 2021-03-10 22:11
svenhttps://files.svenpeter.dev/d20fa45fd35e5a58c7df95de1466d7b7d606e4be_m1n1_usb.txt [636164.622149] usb 1-2: Product: m1n1 :)#asahi-dev · 2021-03-08 19:49
svenyeah, yeah, getting there :P#asahi-dev · 2021-03-08 19:38
sventhat sounds useful :-)#asahi-dev · 2021-03-08 19:38
svenmarcan: hah, nice!#asahi-dev · 2021-03-08 07:57
sveni'll have to do real work right now, but i can push the current WIP somewhere this evening#asahi-dev · 2021-03-08 07:57
svenoh, i have something very dumb and simple for clock/power as well.#asahi-dev · 2021-03-08 07:55
sventhat reminds me.. i need to clean up this linux dart thingy i wrote. that+phy bringup in m1n1 is enough to make linux' usb serial gadget working#asahi-dev · 2021-03-08 07:53
sveni bring up the clocks,dart,etc. of course but i can either shut these done again or just leave them as-is like iboot does#asahi-dev · 2021-03-08 07:50
sventhe only thing it needs it the phy bringup#asahi-dev · 2021-03-08 07:50
svenmarcan: yeah, no tunables required. it works just fine without#asahi-dev · 2021-03-08 06:31
sven:-)#asahi-dev · 2021-03-08 06:31
svenTTY> usb-dwc3@0x502280000: unhandled EP 00 event: XferComplete (0x01), buffer: 80 06 00 01 00 00 40 00 ......@.#asahi-dev · 2021-03-06 17:24
svenmarcan: sounds good#asahi-dev · 2021-03-06 13:55
svenerm, no. scratch that. i'm just an idiot as usual. looks like enabling clocks is actually enough to make PCIe accessible#asahi-dev · 2021-03-06 13:51
svenpcie needs more magic though. just enabling clocks isn't enough to make the MMIO range readable#asahi-dev · 2021-03-06 13:51
svenhttps://github.com/AsahiLinux/m1n1/pull/35 aaand tunables support