#
✕ nick:pipcet[m]
#asahi · 2021-06-06 18:14
pipcet[m]jannau: IIRC macos wifi was sensitive to timing things, so when my code ran too slowly it wouldn't work...
#asahi · 2021-06-06 09:47
pipcet[m]disconnect which side?
#asahi · 2021-06-06 09:42
pipcet[m]yes.
#asahi · 2021-06-06 09:41
pipcet[m]maybe another GPIO pin?
#asahi · 2021-06-06 09:39
pipcet[m]cool!
#asahi · 2021-06-06 09:21
pipcet[m]can you read 0x14/0x15 to see whether anything's pending?
#asahi · 2021-06-06 09:18
pipcet[m]jannau: probably obvious, but you are writing 0x16 for the other port, right, not for the one we're mmiotracing?
#asahi · 2021-06-06 09:15
pipcet[m]I really really hate Apple for sharing that IRQ line
#asahi · 2021-06-06 09:15
pipcet[m]true :/
#asahi · 2021-06-06 09:14
pipcet[m]jannau: there's a second int mask at 0x17, we might have to clear that too
#asahi · 2021-06-06 09:13
pipcet[m]mask the IRQs for the m1n1 uart, then get another mmiotrace in macos to see whether it's the PD IRQ
#asahi · 2021-06-06 09:12
pipcet[m]yes, we need to mask IRQs and see whether that helps.
#asahi · 2021-06-06 09:11
pipcet[m]there has got to be an irq or status register somewhere, just relying on the xhci driver to disconnect isn't good enough.
#asahi · 2021-06-06 09:09
pipcet[m]and we can detect when a device is unplugged from the physical port but we cannot detect when a device is removed from an adapter connected to the port, right?
#asahi · 2021-06-06 09:07
pipcet[m]s/port/phy/
#asahi · 2021-06-06 09:07
pipcet[m]so macos resets the port once in a while and we don't know what triggers it?
#asahi · 2021-06-06 09:04
pipcet[m]oh, wow, thanks, I've got to try that.
#asahi · 2021-06-06 09:02
pipcet[m]but if you don't touch the port, unplugging/replugging power on it works fine.
#asahi · 2021-06-06 09:02
pipcet[m]I believe that's correct, yes. Charging is more of an annoyance because you get a spontaneous reboot when the battery's empty.
#asahi · 2021-06-06 09:01
pipcet[m]yes, that's the issue I meant. if you keep power plugged in from boot everything is fine, if I come home and re-plug power it breaks.
#asahi · 2021-06-06 09:00
pipcet[m]I've been meaning to look into that, yes :-)
#asahi · 2021-06-06 08:59
pipcet[m](which I just ignore since touching it still breaks charging)
#asahi · 2021-06-06 08:59
pipcet[m]sven: that's what I'm doing in Linux for the "stolen" power port
#asahi · 2021-06-06 08:57
pipcet[m]ah.
#asahi · 2021-06-06 08:57
pipcet[m]sven: when you steal the usb port, do you initialize the irq mask of the chip?
#asahi · 2021-06-06 08:55
pipcet[m]since the IRQ line is shared, it's probably trying to handle the interrupt for the PD chip that m1n1 stole.
#asahi · 2021-06-06 08:54
pipcet[m]is the interrupt that the two usb-pd controllers share firing?
#asahi · 2021-06-05 19:41
pipcet[m]uhm, they are named and documented in the corellium driver (but if you prefer guessing, that's okay, of course)
#asahi · 2021-06-05 18:01
pipcet[m]adt.device-tree.arm-io.gpio.#interrupt-cells = <0x00000002>
#asahi · 2021-06-05 18:00
pipcet[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.
#asahi · 2021-06-05 17:58
pipcet[m]yes, the #interrupt-cells property applies to interrupt-children :-)
#asahi · 2021-06-05 17:55
pipcet[m]and, yes, the pins are mapped to one of seven IRQ groups
#asahi · 2021-06-05 17:54
pipcet[m]... but their interrupt-parent is aic, which has #interrupt-cells = <1>
#asahi · 2021-06-05 17:48
pipcet[m]the multi-touch device has something weird in the second cell, at least: 0x02000000
#asahi · 2021-06-05 09:05
pipcet[m](but I was logging to memory not USB, so...)
#asahi · 2021-06-05 09:05
pipcet[m]I've done it with my abortive stolen-core pseudo-hypervisor, it seemed okay then.
#asahi · 2021-06-05 09:04
pipcet[m]all interrupts require a read of offset + 0x2004 to know which source it was
#asahi · 2021-06-05 09:04
pipcet[m]do you need to virtualize it? Just mmiotrace reads from the AIC event register?
#asahi · 2021-06-05 06:31
pipcet[m]Emantor: no, but just getting it to chain-load would be nice. I understand it doesn't have the drivers yet.
#asahi · 2021-06-05 06:24
pipcet[m]Emantor: I meant the configuration as well (I only just heard about barebox). If you want to share that, that would be great :-)
#asahi · 2021-06-05 06:13
pipcet[m]Emantor: barebox looks really cool, thanks for sharing the link. What did you have to change?
#asahi · 2021-06-04 20:56
pipcet[m]marcan: thanks for pointing that out
#asahi · 2021-06-04 20:17
pipcet[m]do you see problems with it apart from being newfangled? I admit it is still unusual, but it is very nice to be able to do the ADT->FDT transformation in userspace (or maybe I'm just horrible at writing code that runs without debugging in the murky depths of prebootland)
#asahi · 2021-06-04 20:12
pipcet[m]it's been around for 20 years or so
#asahi · 2021-06-04 20:09
pipcet[m]more usable than macos, but I don't think that's saying much ;-)
#asahi · 2021-06-04 19:42
pipcet[m]okay, that doesn't appear to trigger in all cases, either.
#asahi · 2021-06-04 19:38
pipcet[m]of course, but having a fallback plan doesn't hurt.
#asahi · 2021-06-04 19:36
pipcet[m]can we work around it by resetting the device whenever connection status changes?
#asahi · 2021-06-04 19:34
pipcet[m]sven: I'm using something based on the Corellium kernel (at https://github.com/pipcet/pearl), so it's possible I broke it somehow, but no, doesn't work. It does if I manually unbind/rebind the driver.
#asahi · 2021-06-03 16:07
pipcet[m]it also matches quite closely what clock-bindings.txt says.

plus ›