#
…

2021-06-05

00:32marcanbloom: I thought of using the m1racles register for that :D (userspace hypercalls)
00:34marcancut also yeah debug-console works I guess
00:34marcanthough that shows up on the wrong ACM port, it's not serialized with mmiotrace
00:34marcanso the msr trap thing is probably a better idea long term
00:34marcanplus I want to also use it to control m1n1 (turn mmiotrace on/off)
01:13bloommarcan: I also thought of the miracles reg lol
01:14bloomnot being serialized with mmio is a showstopped
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi
01:37modwizcode has joined #asahi
02:16phiologe has joined #asahi
02:18yuyichao has quit [Quit: Connection closed for inactivity]
02:19PhilippvK has quit [Ping timeout: 480 seconds]
03:05marvin24_ has joined #asahi
03:09marvin24 has quit [Ping timeout: 480 seconds]
03:10aquijoule_ has joined #asahi
03:16richbridger has quit [Ping timeout: 480 seconds]
03:56Namidairo has quit [Quit: ZNC - https://znc.in]
03:56Namidairo has joined #asahi
04:03marvin24 has joined #asahi
04:06marvin24_ has quit [Ping timeout: 480 seconds]
04:28modwizcode has quit [Remote host closed the connection]
05:16amwMy shell.py connection is failing with Bad command on connection, possibly due to unable to find ADT node pci-bridge1.pcie? - see https://paste.debian.net/1200069
05:17amwI am thinking of re-installing the m1n1 on the M1 macbook, but perhaps something else needs to be updated
05:19Emantor[m]bloom: Barebox, https://www.barebox.org was initially an U-Boot fork which removed a lot of unsupported code and adheres closer to the Linux driver interfaces, making driver ports to/from the kernel much easier. It also provides a somewhat saner CLI than U-Boot, at least to my eyes.
05:21Emantoramw: do you have any error messages in the dmesg of the computer your mac is connected too? On my desktop mainboard at least one of the USB ports did not reliably work with m1n1 and I also needed a stable kernel update.
05:23VinDuv has joined #asahi
05:24amwEmantor: No error messages - seems to be fine - here's the only messages https://paste.debian.net/1200071
05:29Emantoramw: m1n1 is the latest build? Are you chainloading latest m1n1 beforehand? S_BADCMD looks to be raised if m1n1 doesn't know the command that the python-proxy requests.
05:33amwok - I'm running the latest on the client / python side, but a 1-2 week old one M1 side. I'll try the chainload first
05:36amwYes that's fixed it - python3.9 proxyclient/chainload.py build/m1n1.macho - I can now run shell.py!
06:00adamcstephens has quit [Quit: The Lounge - https://thelounge.chat]
06:04adamcstephens has joined #asahi
06:13pipcet[m]Emantor: barebox looks really cool, thanks for sharing the link. What did you have to change?
06:16EmantorNothing much, I hacked in DBEUG_LL support, but adjusted the S3C Uart driver now, so it works as well. It's really not much code, I'll see if I can get USBGadget up and running, than I can simply chainload from m1n1.
06:24pipcet[m]Emantor: I meant the configuration as well (I only just heard about barebox). If you want to share that, that would be great :-)
06:25jannauamw: sound like a regression of making checksums optional. I'm not sure if we care as long as chainloading a newer m1n1 works
06:25amwjannau: Yep - I added a note to the Developer Quick Start to help any others in the future. I'm fine with that
06:26alessandrorzz[m]Hi, someone can help me with an issue in arch Linux?
06:26Emantorpipcet[m]: Do you have a 1.2V Uart on the debug port? Otherwise barebox isn't really usable on m1 yet.
06:28Emantorjannau: I think m1n1 on his computer was missing the get/set_SIMD command, so the proxy complained, I don't think this has to do with the checksums.
06:29amwI do have a vague memory that I may have run it with the checksums so I suspect Emantor is right.
06:31pipcet[m]Emantor: no, but just getting it to chain-load would be nice. I understand it doesn't have the drivers yet.
06:31jannauyes, it is the missing P_GET_SIMD_STATE command. I should have looked at the log first
06:36VinDuvwhen it starts up, shell.py fetches methods out of the ProxyUtils instance so you can directly use msr() in the shell instead of u.msr(), but the way it does that makes it fetch the SIMD properties defined here (https://github.com/AsahiLinux/m1n1/blob/main/proxyclient/proxyutils.py#L241)
06:37VinDuvwhich cahses a P_GET_SIMD_STATE which may not exist on the installed m1n1
06:38VinDuvit’s not a huge problem since chainload.py works but it’s probably not optimal
08:12gladiac has quit [Read error: Connection reset by peer]
08:13gladiac has joined #asahi
08:25VinDuvamw: You can try https://github.com/AsahiLinux/m1n1/pull/69 , it should allow you to get a shell without chainloading m1n1 first
09:03svenso... can we somehow virtualize AIC to also get all interrupts in the mmiotrace? :>
09:03sveni really need to fix my setup and get that thing working *sigh*
09:04pipcet[m]do you need to virtualize it? Just mmiotrace reads from the AIC event register?
09:04svendo all interrupts go through the hv right now?
09:04pipcet[m]all interrupts require a read of offset + 0x2004 to know which source it was
09:04svenhm. that might be slow though
09:05svenbut worth a try
09:05pipcet[m]I've done it with my abortive stolen-core pseudo-hypervisor, it seemed okay then.
09:05pipcet[m](but I was logging to memory not USB, so...)
09:06svenjannau: ^-- wanna give that a try? :>
09:06sveni'll try to get my setup working in the meantime
09:08jannauI'll try
09:22jannauworks but is quite noisy and slow. should be handled in m1n1 with the ability to ignore uninteresting event types and numbers
09:23svenyeah, that's what i expected
09:23sventhe interesting ones for the usb port would be 857,858,859,860 and 816
09:23sventhe 816 is especially weird there ;)
09:28sveni can hack the reconnect to work already. just need to check read32(0x502a90008) & 0x0100000 and then do set32(0x502a90004, 3); clear32(0x502a90004, 3)
09:36amwVinDuv: Sorry not sure how to handle that pull-request - I have only git clone of the repository here
09:40VinDuvamw: you can download and apply the patch manually https://github.com/AsahiLinux/m1n1/commit/b135733d733d12907aa0d5af87c770380ae8dc9f.diff -- it’s just a couple of lines in proxyclient/shell.py
09:41amwAhh - The following worked for me: git fetch marcan pull/69/head:VinDuv
09:44pugguu has joined #asahi
09:46amwVinDuv: Yep - that works geat - Thanks
09:46amw*great
09:54jannauI see only 857 after the disconnect
09:54svennice, thanks!
09:55svenand yeah, it only seems to use 857 and 858
09:56svenhm... i think the xhci actually gets a usb disconnect event even in linux
09:56jannau858 seems to be triggered by USB traffic
09:57svenlinux only uses 857 but the dwc3 datasheet i read mentioned something about irq mapping
09:57svenand xhci and dwc3 support multiple irqs
09:57svenso i suspect they just rerouted some irq reasons to 858
10:00pugguu has quit [Read error: Connection reset by peer]
10:00pugguu has joined #asahi
10:01pugguu has quit [Read error: Connection reset by peer]
10:02pugguu has joined #asahi
10:03Izumoo has quit [Ping timeout: 480 seconds]
10:20pugguu has quit [Read error: Connection reset by peer]
10:20svenjannau: could you do another trace where you also connect the device again in the end?
10:20pugguu has joined #asahi
10:20pugguu has quit [Read error: Connection reset by peer]
10:20pugguu has joined #asahi
10:24choozy has joined #asahi
10:31sventhanks!
10:31jannauI'm not sure if the disconnects are exact, there might be regular USB traffic after I marked the position but before I disconnect
10:32svennotice how it just goes off to write to the phy regs after you connect again? it's probably some other interrupt
10:32jannaumaybe some gpio irq? or the usb-pd chip?
10:33svenpossibly, yes
10:33svenmaybe they just do a phy reinit everytime the usb-pd chips triggers an irq :/
10:40jannauI'm off till later. https://gist.github.com/jannau/eaa1baa11ae615cc74293912d5c6c71c is the patch I use for usb-c/aic tracing
10:40pugguu has quit [Remote host closed the connection]
10:42pugguu has joined #asahi
11:06choozy has quit [Ping timeout: 480 seconds]
11:51TheLink has quit [Quit: ZNC 1.8.2 - https://znc.in]
11:51TheLink has joined #asahi
12:02bgb_ has joined #asahi
12:04GreatGodvin[m] has joined #asahi
12:17TheLink has quit [Quit: ZNC 1.8.2 - https://znc.in]
12:17TheLink has joined #asahi
12:22bgb_ has quit [Ping timeout: 480 seconds]
12:22aquijoule_ has quit [Ping timeout: 480 seconds]
12:29richbridger has joined #asahi
12:45malvo has joined #asahi
12:48bgb_ has joined #asahi
12:56bgb_ has quit [Ping timeout: 480 seconds]
13:20bgb_ has joined #asahi
13:50tsida has quit [Remote host closed the connection]
13:53GreatGodvin[m] is now known as ohdamn[m]
13:57VinDuv has quit [Quit: Leaving.]
14:02bgb_ has quit [Ping timeout: 480 seconds]
14:06bgb_ has joined #asahi
14:14bgb_ has quit [Ping timeout: 480 seconds]
14:27VinDuv has joined #asahi
14:37bgb_ has joined #asahi
14:51bgb_ has quit [Ping timeout: 480 seconds]
15:13bgb_ has joined #asahi
15:21bgb_ has quit [Ping timeout: 480 seconds]
15:35Shiz has quit [Read error: Connection reset by peer]
15:36Shiz has joined #asahi
15:45bgb_ has joined #asahi
15:53bgb_ has quit [Ping timeout: 480 seconds]
15:53pugguu has quit [Read error: Connection reset by peer]
15:54pugguu has joined #asahi
15:58pugguu has quit [Read error: Connection reset by peer]
15:58pugguu has joined #asahi
16:07pugguu has quit [Read error: Connection reset by peer]
16:07pugguu has joined #asahi
16:17bgb_ has joined #asahi
16:25bgb_ has quit [Ping timeout: 480 seconds]
16:48bgb_ has joined #asahi
16:57bgb_ has quit [Ping timeout: 480 seconds]
17:00bps has joined #asahi
17:07pugguu has quit [Read error: Connection reset by peer]
17:07pugguu has joined #asahi
17:19pugguu has quit [Read error: Connection reset by peer]
17:20pugguu has joined #asahi
17:23bgb_ has joined #asahi
17:31bgb_ has quit [Ping timeout: 480 seconds]
17:33bloom☁️ On air - https://twitch.tv/asahigpu ☁️
17:35tsida has joined #asahi
17:45jannauany idea why some adt nodes have "#interrupt-cells = 2"? interrupt property looks like it is consectutive interrupts
17:48hexchain has joined #asahi
17:48pipcet[m]the multi-touch device has something weird in the second cell, at least: 0x02000000
17:54jannauthe gpio nodes have 7? consectutive irqs
17:54pugguu has quit [Read error: Connection reset by peer]
17:54pipcet[m]... but their interrupt-parent is aic, which has #interrupt-cells = <1>
17:55pugguu has joined #asahi
17:55pipcet[m]and, yes, the pins are mapped to one of seven IRQ groups
17:58jannauhmm, nodes which use "/arm-io/gpio" as parent have 2 cells
17:58pipcet[m]yes, the #interrupt-cells property applies to interrupt-children :-)
17:59jnthe #*-cells properties usually specify how many cells should be used when the node in question is used as a resource provider for something else, i.e. when the GPIO controller is used to provide GPIO interrupts
17:59jnat least in modern linux usage, but i think this goes back to common times
18:00pipcet[m]so GPIO has seven AIC interrupts, multi-touch has a single GPIO interrupt described by two cells, the first of which is a pin number and the second presumably encoding whether it's edge triggered/level triggered/low/high, or something.
18:01jnwhich node specifies #interrupt-cells = <2>?
18:01bps has quit [Ping timeout: 480 seconds]
18:01pipcet[m]adt.device-tree.arm-io.gpio.#interrupt-cells = <0x00000002>
18:01jannau"/arm-io/gpio" for example
18:24pugguu has quit [Read error: Connection reset by peer]
18:24pugguu has joined #asahi
18:50jannausven: I haven't found an obvious interrupt which fires at connect/disconnect. 190 from "/arm-io/gpio" is very noisy so I can't if that one is used
18:51svenyou can sniff i2c traffic if you want
18:51sventhat should give away if it's using the USB PD chip
18:53jannauI suspect the interrupts property for nodes which uses /arm-io/gpio as interrupt specifies gpio pin, index into /arm-io/gpio's interrupts to get the mapped AIC interrupt
18:55sventhe other alternative i can think of would be to specify if the interrupt triggers on hi/low edge/level
18:55malvo has quit [Ping timeout: 480 seconds]
18:58jannaui2c0 is very noisy as it its interrupt 627
19:00svenhuh, weird. i wouldn't expect much traffic to go through the i2c chip
19:00svenand i think it's only those usb pd chips on i2c0
19:03jannauyes, according to the ADT there's only hpmBusManager on it
19:05svenstrange. might make sense to write something that sniffs i2c traffic
19:05bps has joined #asahi
19:07pugguu has quit [Ping timeout: 480 seconds]
19:25jannauhave you seen a pa semi manual? mac os uses 0x18, 0x2c and 0x44 in addition to the registers in the linux driver
19:30svenno, but there's a decent change you can ignore them
19:30sventhey might be related to interrupts
19:31sveni doubt they matter to sniff the traffic though
19:41Emantor0x44 is weird, always set 1 during the write and reset directly afterwards. From my i2c traces 0x08 with mask 0xff00 could indicate number of received bytes.
19:41pipcet[m]uhm, they are named and documented in the corellium driver (but if you prefer guessing, that's okay, of course)
19:42malvo has joined #asahi
19:43svensure, i believe marcan also has a pa semi datasheet he got by asking the guy who wrote the linux driver. but either way, to sniff i2c traffic all you should need are the two fifo registers
19:44EmantorYep, shouldn't be too hard to turn this into i2c reads/writes.
19:47malvo has quit [Remote host closed the connection]
19:48malvo has joined #asahi
19:48malvo has quit [Remote host closed the connection]
19:48malvo has joined #asahi
19:51jannausecond interrupt cell is more likely flags, the second cell of the bluetooth node is 0x20_0002
20:01kubes has joined #asahi
20:02kubes has quit []
20:02kubes has joined #asahi
20:05kubes has quit []
20:14Emantorsven: I took a look at your dma question in #armlinux, and just saw now that it's been there for a while. I am off now, I can look at this some more tomorrow.
20:45bps has quit [Ping timeout: 480 seconds]
20:49svenEmantor: thanks!
20:52VinDuv has quit [Quit: Leaving.]
21:05bps has joined #asahi
21:40* bloomshould setup the hv hm.
22:15bps has quit [Ping timeout: 480 seconds]
22:16* bloomreads m1n1 wiki again
22:17svenlet me know if you get it work
22:17sveni always hit "panic(cpu 0 caller 0xfffffe0014c6f0f8): "ApplePMGR: virtual void ApplePMGR::initDriver(IOService *):1557 REQUIRE failed: id != kIDReserved"
22:18bloomi was hitting something stupid last time too
22:18svenyeah, i'm 99% sure this is me doing something incredibly dumb
22:18sveni just can't figure what yet
22:19bloomIt would help if my linux laptop had working usb drivers.
22:20bloomdo I have a spare linux machine for this? ummmmm
22:20brentr123[m]I have a spare linux machine
22:20brentr123[m]my pc has a dualboot
22:20bloomthanks.
22:21bloomerm i guess i can requisition the odroid...
22:21brentr123[m]ah but its x86
22:21brentr123[m]may not work
22:21bloomm1n1 shouldn't care
22:21brentr123[m]so what command should i do on the linux machine to help you?
22:22bloomoh, heh, I meant a spare machine for usb stuff here :)
22:22bloomI can't believe the current take away is "I don't have enough computers" ;P
22:22brentr123[m]I have like 5
22:23bloomoh but does the odroid have usb-c
22:24bloomnope, ugh
22:44yrlfbloom: how much control do rooted android phpnes have over their usb c ports?
22:45yrlf*phones
22:45bloomplenty :-p
22:46bloomm1n1 for iOS when
23:11apetresc has quit [Quit: ZNC 1.8.2 - https://znc.in]
23:19bloomTTY> Recovering from exception (ELR=0xfffffe001224ef20)
23:19bloomTTY> Exception taken from GL1t
23:19bloomTTY> Running in GL2
23:19bloom^ Is this something people have seen loop (along with dumped registers) when trying to boot hv?
23:22bloomneeded to rebuild + chainload m1n1
23:22bloomsven: etc
23:22bloomnow i see a progress bar come up and lots of MMIO spammed at me but the display has gone black so I don't know if it's making progress
23:23bloomoh there it is
23:23bloomsven: what is pmp[17] and why is it so noisy during boot?
23:23sveni've only seen "panic(cpu 0 caller 0xfffffe0014c6f0f8): "ApplePMGR: virtual void ApplePMGR::initDriver(IOService *):1557 REQUIRE failed: id != kIDReserved" no matter what i do :(
23:24svenand no idea what pmp[17] is
23:25bloomok it finally boot, nice
23:25bloomhow do I actually.. do anything with this?
23:25bloombetween how slow boot is and that this is all being fed over a serial port err
23:26svenit's also just running on one efficiency core afaik
23:26choozy has joined #asahi
23:27choozy has quit []
23:27bloomyeah that would help lol
23:28bloomwonder if pmp is NVMe
23:28bloomoh der no
23:28bloomPMP: "Power Management Processor?". Handles power functionality
23:28bloomthanks wiki
23:28bloomOk, I have hypervisor macos. Cool.
23:28sveniop,ascwrap-v4
23:28sventhat's pmp apparently
23:29svendon't think that's nvme
23:29bloomyeah sorry im confused
23:29svenhuh. wait.
23:29svenokay, wtf apple
23:30svenwhy do you reuse the iop,ascwrap-v4 compatibility for so many things
23:30svenit's probably talking to some co-processor
23:31bloomyeah ok.
23:31bloomincluding controlling the curosr plane apparently? :p
23:35apetresc has joined #asahi
23:36bloomok, this is awesome
23:37bloomI can poke the display controller regs with macOS booted from hv
23:49bloomnote to self: writing bad things to fb format bits can wedge the whole system, even in macos
23:49bloomexpensive lesson to learn given how slow hv is to boot
…