#
…

2021-04-17

00:02klaus has quit [Ping timeout: 240 seconds]
00:08raster has quit [Quit: Gettin' stinky!]
00:12DarkShadow44 has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
00:13DarkShadow44 has joined #asahi
00:14bgianf has quit [Remote host closed the connection]
00:25ephe_meral1 has quit [Ping timeout: 246 seconds]
00:32klaus has joined #asahi
00:37klaus has quit [Ping timeout: 252 seconds]
00:40odmir has quit [Remote host closed the connection]
00:41odmir has joined #asahi
00:45odmir has quit [Ping timeout: 240 seconds]
00:52klaus has joined #asahi
00:53bgianf has joined #asahi
01:10klaus has quit [Ping timeout: 246 seconds]
01:12odmir has joined #asahi
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:22Emantor has joined #asahi
01:23klaus has joined #asahi
01:28klaus has quit [Ping timeout: 246 seconds]
01:30odmir has quit [Remote host closed the connection]
01:30odmir has joined #asahi
01:40klaus has joined #asahi
01:44klaus has quit [Ping timeout: 240 seconds]
02:28klaus has joined #asahi
02:33klaus has quit [Ping timeout: 240 seconds]
02:34Necrosporus has quit [Ping timeout: 252 seconds]
02:37robinp has quit [Read error: Connection reset by peer]
02:38robinp has joined #asahi
02:41odmir has quit [Remote host closed the connection]
02:47Necrosporus has joined #asahi
02:50phiologe has quit [Ping timeout: 250 seconds]
02:50phiologe has joined #asahi
03:09klaus has joined #asahi
03:14klaus has quit [Ping timeout: 246 seconds]
03:26marvin24 has quit [Ping timeout: 250 seconds]
03:26marvin24 has joined #asahi
03:57klaus has joined #asahi
04:02klaus has quit [Ping timeout: 252 seconds]
04:25mxw39 has quit [Ping timeout: 240 seconds]
04:25mxw39 has joined #asahi
04:29method_ has joined #asahi
04:32klaus has joined #asahi
04:37klaus has quit [Ping timeout: 246 seconds]
04:49maknho____ has joined #asahi
04:50maknho___ has quit [Ping timeout: 240 seconds]
05:05klaus has joined #asahi
05:10klaus has quit [Ping timeout: 240 seconds]
05:42klaus has joined #asahi
05:46klaus has quit [Ping timeout: 240 seconds]
06:19klaus has joined #asahi
06:24klaus has quit [Ping timeout: 268 seconds]
06:34method_why does klaus keep doing that
06:52klaus has joined #asahi
06:57klaus has quit [Ping timeout: 252 seconds]
07:06armarcan: just wondering, will you apply for a pid from openmoko, use something random, or actually buy your own vid?
07:07marcanar: you joined late, I sent a PR for a PID request earlier in the stream
07:08method_Hey marcan, since you're online and sent a message recently I felt its a good time to ask, Is it alright if I use a bot that relays message to / from discord I wrote, I keep it private to myself of course
07:09method_Just asking because I use discord a lot more than irc, and forget to check my client often
07:10marcanif it's private it's ok
07:10marcanthat's just a funny bouncer
07:10method_Yeah pretty much, it makes it much easier for me to interact
07:11method_I'm actually quite proud of it, I wrote it from scratch myself ^.^
07:11method_First time I've tackled such a project
07:24VinDuv has joined #asahi
07:40klaus has joined #asahi
07:51vlixa has quit [Remote host closed the connection]
08:04jeffmiw_ has joined #asahi
08:04jeffmiw_ has quit [Client Quit]
08:44Chainsaw has joined #asahi
08:46marcanok, USB is done and hooked up to the proxy, and I made Linux boot work properly with it, shutting down and such
08:46marcan(so the host doesn't see a dead USB device)
08:47marcansven: ^^
08:47marcanso you can now do linux.py --tty /dev/<some uart> with M1N1DEVICE=/dev/ttyACM0 (the m1n1 ACM device)
08:47marcanit's all still backwards compatible with ancient versions. I want to see how long I can get away with my old installed m1n1 that doesn't even support the MMU :)
08:48marcan(well, it's not actually backwards compatible at the protocol level, but proxy.py tries the new way before falling back to the old way)
08:48svenvery nice :-)
08:48marcanfixed some fail in USB too (it wasn't actually kicking tx/rx properly, same issue we had with the UART in linux)
08:48marcanand applied for a proper PID for us
08:49svenyeah, i at least know two or three parts in my usb code that weren't exactly compliant to the spec
08:49marcanfixed some spec issues too, yeah
08:49marcanthere are still unimplemented requests but I added a few
08:50svenyeah, i just did the minimum required to get it to work on mac os and linux
08:50svenluckily they are used to horrible usb devices ;)
08:52marcanyou had the endpoint constant defines backwards btw :p
08:52marcan0x80 is IN
08:53svenouch :D
08:53svenit worked though, didn't it? :P
08:53marcanyes, for bulk, because there are both anyway
08:53marcanI was very confused about the interrupt endpoint which you claimed was OUT :p
08:53marcanbut then showed up as IN
08:53marcanI initialize the interrupt EP now, otherwise the host keeps retrying
08:54marcanI never send anything, it just needs to be there and NAK
08:54marcan(not stall)
08:54marcanand same with bulk in, you were sending ZLPs all the time which spams the bus
08:54svenOSError: [Errno 16] Resource busy: '/dev/tty.debug-console'
08:54marcanuh, are you using --tty with the same device as M1N1DEVICE?
08:55marcandid you boot with debug enabled? :p
08:56svensomething's weird, let me try to figure out what's going on
08:59svenah, duh. wrong /dev node
09:00svenit's /dev/cu.debug-console
09:03vimal has quit [Ping timeout: 260 seconds]
09:05maknho____ has quit [Ping timeout: 252 seconds]
09:08maknho____ has joined #asahi
09:12svenmarcan: you forgot to run make format, there's a spurious whiteline in main.c now :P
09:13marcan*force pushes*
09:13marcannobody saw anything
09:13svenriiight :P
09:18svennow i wonder how iboot detects usb reconnects then
09:18raster has joined #asahi
09:19marcansven: reconnects work fine for me
09:19svenreally?
09:19sventhats's... weird
09:20sventhey don't work for me
09:20marcanwait, what happens when you try?
09:20svennothing
09:20sventhe usb device doesn't show up again
09:21svenand i never see any USBRst or USBConnected events
09:21marcanyeah okay
09:21marcanthe problem isn't dwc, it's the TI chip
09:21marcan*dwc* handles reconnects fine
09:21svenyeah, that's what i figured
09:21sveni can manually force a reconnect on the dwc side
09:21marcanbut my cable breaks out only D+/D- to the USB end
09:21marcanso "reconnect" for me means only the USB link, not VBUS
09:22marcanI bet I know what this is; I bet the TI chip does not bring up the DFU mode by default
09:22sventhis also happens when i bring up the phy in host mode
09:22svenand then use linux's xhci driver
09:22sventhe first connection to a port works
09:22svenbut nothing afterwards
09:29marcanactually, not sure, something about my vdm stuff is broken right now
09:29marcannot getting replies
09:37totebagel has quit [Quit: Leaving]
09:47marcanok, it's not the pin mapping; doing it doesn't fix it
09:51vlixa has joined #asahi
09:52svenyeah, it's something strange
09:52sveneven bringing up the TI chip with that special apple command doesn't help
09:53svenit does enable the PD negotiation stuff though
09:53svenmy best bet still is that it somehow relies on interrupts from the TI chip :/
09:54svenwhich we could poll as well but ugh...
10:06Bublik_ has quit [Ping timeout: 252 seconds]
10:08Bublik_ has joined #asahi
10:33ephe_meral1 has joined #asahi
10:53marcansven: I wonder if there is a VBUS pin going to the dwc?
10:55sveni've looked at the whole dwc register space using RegMonitor and I didn't see any interesting bits flip when connecting a usb cable
10:55sveni didn't look at the atc-phy space though
11:02kettenisjust pushed a rebase of the pcie branch
11:03svenhrm. wait. maybe i just found a bit that's flipped
11:04svenit's not part of the known dwc3 range though i think
11:04marcansven: in iphone schematics at least, there is a VBUS_DETECT pin on the soc
11:07sven0x502200024 starts at 0xa2000042, then goes to 0xa1000042 after i connect the cable and then finally to 0xa0000042 when i disconnect the cable again
11:07svenbut it just stays there then if i connect it again
11:10marcansven: does it work again if you re-init the phy and such?
11:14svenmarcan: i mean.. it works if i just manually force the dwc3 part to reinit the device even without touching the phy
11:15svenit's weird
11:15marcan*something* has to change then
11:15svenjust not sure what that it yet
12:09kettenisaddressed sven's comments on the pce pull request
12:11kettenisso that might be ready to be merged
12:13svenlgtm :)
12:27kettenisbeen thinking a bit about the pcie dt-bindings
12:27kettenisapcie is somewhat unique in that is a RC with three integrated ports
12:28odmir has joined #asahi
12:28kettenisamost all other pcie RCs that Linux supports in DT mode have only a single port
12:29kettenisso that raises the question where to put properties like reset-gpios and max-link-speed
13:45marcanI thought the three instances were largely unique; what's shared?
13:46Chainsaw has quit [Remote host closed the connection]
13:54kettenisconfig space!
13:56kettenis(and I'm talking about the RC that has the onboard devices, not the Thunderbolt stuff)
14:04arndkettenis: are you sure we actually need these properties? Do you ever need to configure the link speed or trigger a reset using gpio?
14:05kettenisWe (or at least u-boot) needs the reset gpios
14:06kettenismy current understanding is that max-link-speed isn't strictly necessary
14:07ketteniswould be merely an optimization to not try the higher link speeds on peripherals that don't support them
14:07kettenisit seems the SoC supports pci gen4, but the peripherals are gen3 (wifi) gen2 (xhci) and gen1 (ethernet)
14:08kettenisit also seems that the SoC supports clkreq (no surprise for what's essentially a phone SoC)
14:10kettenisbut the refclk-always-on-2 property in the corellium tree suggests that clkreq may not be supported for the ethernet device
14:10arndIs the link speed set through standard pcie registers, or a hardware specific phy driver?
14:11arndmy hope was that this would all be part of what m1n1 can do before u-boot does the bus scan
14:11kettenislooks like it is special glue logic like on most/all dwc pcie controllers
14:12ketteniscorellium has some code dealing with the link speed that uses a max-speed-2 property
14:12arnda lot of the server chips actually use dw-pcie implementations, but all the phy handling is done in firmware before it gets handed off to the OS
14:14kettenisbringing up the links could be moved in m1n1, but then you'd lose the ability to turn them off for suspend
14:15kettenisthat's something most server SoCs don't worry about...
14:16kettenisif we can express all this using proprties from the standard pci-bus binding I don't see why we shouldn't
14:18arndwhich implies using the dw-pcie driver plus some hardware glue, right?
14:18kettenisif my reading of the pci-bus.yaml schema is correct it is allowed to have reset-gpios and max-link-speed on pci-pci bridge nodes
14:19kettenisnot sure if using the dw-pcie driver code in linux makes a lot of sense as there is very little actual logic that you'd be able to re-use
14:20kettenisbut I guess that's up to whoever is going to write the linux driver
14:22arndthat makes sense, since you can have nested buses. I think part of the problem is the the DT bindings for PCI largely go back to the pre-pcie days where a lot of things worked differently, and that the dw-pcie hardware in particular only normally implements a single port rather than a root complex
14:23arndIt might be helpful to look at what the older Marvell PCIe driver does, since that emulates a root complex with multiple ports on top of hardware that is somewhat similar to the separate dw-pcie ports
14:24arndso I think the the mvebu pcie binding reflects the root complex that does not actually exist in hardware
14:26arndBut since it seems that Apple actually implemented a proper root complex with multiple ports, we wouldn't need to emulate one here, just adjust the Linux driver to properly deal with multiple ports
14:31kettenisright; the example I found of a RC with actual ports is the "old" tegra20 one
14:31kettenisthat is an example of how it could be done
14:33kettenisneeds some msi-related properties added to it, but maz already had a suggestion for that
14:36kettenisthe "pci@2,0" node will be needed anyway to add the child device node for the ethernet controller such that we can stick the "local-mac-address" property there
14:38arndright, it seems that the binding is not actually the problem here, it's more a question of how to convince the linux dw-pcie driver to handle it correctly
14:38arndkettenis: is the u-boot driver for dw-pcie derived from the Linux driver?
14:39kettenisnot as far as I can tell
14:40ketteniscurrently there are seperate standalone drivers for all the dwc variants u-boot supports
14:40kettenisI've seen a patch series to unify them in some way
14:41kettenisbut even then I think you end up with 90% of the code being overrides
14:42arndthat might actually help here. In the Linux driver, the common code for dw-pcie makes the assumption that port==root_complex==host_bridge, unlike the tegra driver you found and the mvebu driver that fakes a root complex
14:44arndNot sure how much this needs to be reworked, but if we need to introduce the concept of actual ports, the dw_pcie 'struct pcie_port' probably needs to be split into the port specific bits and those that are shared for the root complex
14:45arndor possibly just renamed if it turns out that everything in there is common to all ports
14:48arndThere is already a 'struct dw_pcie' that is looks like it should represent the root complex, but it contains a single 'struct pcie_port', along with members that should be port specific (num_lanes, link_gen, ...), while the 'struct pcie_port' seems to only have members that should be part of the root complex
14:49ketteniseverything upside down
14:49arndI suppose the current split exists in order to separate endpoint from host most
14:50arnd'dw_pcie' contains the information for both modes, while 'pcie_port' only contains the bits that are specific to host mode
14:55kettenisso as far as I can tell, Apple didn't integrate the DesignWare ATU
14:56kettenisthat means almost all code in pcie-designware.c would be unused
14:56kettenisthe interrupt code is also completely different
14:57kettenisand ECAM is properly implemented
14:57kettenisso most if pcie-designware-host.c is useless as well
14:57kettenisat that point you might as well pretend it isn't designware at all ;)
15:03arndkettenis: so what is left beyond what the generic pcie host support gives us? only suspend mode, or something beyond that?
15:04kettenisand beside the msi support?
15:05kettenisthere is an issue that the wifi chip needs to be powered on
15:05kettenisthis done by sending commands to the SMC
15:05arndMSI doesn't have to be done in the pci host bridge driver, I think it's usually done in there because it shares the register space, but in this case there are no registers for MSI
15:06kettenisthere are registers for MSI
15:06kettenisso really that has to be handled by the host bridge driver
15:07arndwhat do the registers do? I think when I read the corellium driver a while back, it didn't touch any registers for MSI, just passed everything down to the AIC
15:08kettenishost ridge registers need to be initiaized to make that happen
15:10arndbut isn't that someting that could be done in m1n1 or u-boot rather than having the OS know about it?
15:14kettenisyou still have to have something that mappes an MSI vector number to an AIC vector number
15:18ketteniscorellium modelled the wifi power control using some sort of emulated GPIO
15:18kettenisbut it may make more sense to make it a power domain
15:19kettenisI didn't find a precedent for hardware that needs to explicitly power on a pcie device
15:30marcanarnd: will poke around nvme next btw (now that I can load kernels fast :))
15:43arndkettenis: does the wifi device show up at all if you don't enable the power? As long as the driver can bind to the device, it can read a custom property to do whatever is necessary
15:44arndif the power needs to be enabled first, we may have to add the equivalent of drivers/mmc/core/pwrseq.c for pci
15:45arndkettenis: regarding the MSI mapping, I'm aware that this needs to be done somewhere, but as I said that does not involve registers, so it could be outside of the PCI host bridge driver if that ends up being easier
16:18klaus has quit [Ping timeout: 252 seconds]
16:24klaus has joined #asahi
16:42choozy has joined #asahi
16:58kettenisarnd: the device doesn't show up at all if you don't power it up
16:58artemist has joined #asahi
17:02arndok, I see
17:04kettenisjudging from the ADT contents, the SMC is involved in power management and wakeup
17:05kettenisso maybe having the SMC manage thing indepently from pcie is an option
17:06arndany idea if macos toggles it at runtime? if not, it's probably enough again to have u-boot turn it on before starting Linux
17:07arndif we decide that it is needed, then a copy of Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml for PCI should work
17:09vimal has joined #asahi
17:09arndMMC currently has a generic "simple" power sequencing driver that handle almost all devices, plus two device specific ones for those that are not as easily abstracted
17:10arndcompliant MMC/SDIO devices shouldn't need any of those, but it's fairly common to have to kick an SDIO device in some for (clock-enable, reset, regulator, ...) before it can be probed
17:11arndIn theory, SDIO is not different from USB or PCI here, but I don't recall it being needed on these so far
17:11kettenisno clue about what osx does, but it appears to be a simple on/off toggle
17:12kettenisnot sure why the corellium folks came up with code that supports somewhat more complicated power sequencing
17:13arndit probably comes down to how much power we can save by turning it off then, compared to just doing the regular PCIe ASPM
17:13arndif the power savings are not substantial, I'd just turn it on during boot
17:14arndor is this possibly needed for RFKILL functionality?
17:14arnd(i.e. airplane mode)
17:16arndIn that case, I suspect it could be modeled as a platform specific rfkill device, as long as pcie hotplug works correctly to bring it back up
17:24odmir has quit [Remote host closed the connection]
17:24kettenisright, I'll see if I can figure out what happens if I turn it on after booting OpenBSD
17:25odmir has joined #asahi
17:26kettenisthe root ports don't advertise native pcie hutplug support though
17:30odmir has quit [Ping timeout: 240 seconds]
17:50odmir has joined #asahi
18:21m42uko has quit [Quit: Leaving.]
18:21m42uko has joined #asahi
18:22pipcet[m]so I was looking for the most trivial device in my MacBook Pro's ADT, and I think I found it: I've figured out enough about the keyboard backlight PWM for it to be useful, I think; I can control it from m1n1 or Linux now, no driver code yet though
18:34marcanarnd: I don't want to waste time on PM stuff until I know that there are savings worth having
18:34marcani.e. until I sit down with a power meter
18:35marcanpipcet[m]: nice :)
18:39pipcet[m]the built-in power metering/energy budgeting looks fairly sophisticated (plus there are all those temperature sensors), so maybe we don't need that meter...
18:46Chainsaw has joined #asahi
18:57maknho____ has quit [Ping timeout: 265 seconds]
19:00maknho____ has joined #asahi
19:02marcanif we can figure it out, definitely
19:03marcanis that in-soc only, or does it include external parts?
19:03marcanI'd probably still want to cross-check with external metering just to be sure we understand it though :)
19:05pipcet[m]probably a good idea. No idea about the hardware side of it, I just saw it in the device tree (and I think it was mentioned in the Corellium code or docs somewhere...)
19:36jeffmiw has quit [Read error: Connection reset by peer]
19:50odmir has quit [Remote host closed the connection]
19:50LucasTorrobaHenn has joined #asahi
19:51odmir has joined #asahi
19:55odmir has quit [Ping timeout: 240 seconds]
20:06maknho____ has quit [Quit: WeeChat 2.3]
20:07maknho has joined #asahi
20:12pipcet[m]does anyone happen to know which API keyboard backlights are supposed to use? pwm-leds or pwm-backlight?
20:22jeffmiw has joined #asahi
20:25opticrondang, I used to know this
20:25odmir has joined #asahi
20:29jannaupipcet[m]: I'd say backlight is for displays, existing keyboard backlight seem to use led_classdev
20:32pipcet[m]makes sense
20:40pipcet[m]so what about the touchbar thingy? I think that has a separate backlight ...
20:40kettenis#define LED_FUNCTION_KBD_BACKLIGHT "kbd_backlight"
20:48VinDuv has quit [Quit: Leaving.]
20:55odmir has quit [Ping timeout: 240 seconds]
20:56kettenispipcet[m]: "apple,fpwm-s5l8920x"
20:57kettenisthat suggests this is another hardware block that survises from when Apple used Samsung SoCs in their phones
20:57kettenisdis you check pwm-samsung.c?
20:59pipcet[m]I had a quick look at pwm-* and they seemed different, but I'll have another look at that one...
21:03kettenisregisters match if the backlight uses channel 1
21:05pipcet[m]not really?
21:06pipcet[m]there's certainly no prescaler in +0x00 that affects anything, and +0x08 doesn't show anything in the bits corresponding to channel 1.
21:07pipcet[m]+0x10 isn't writable, either
21:09odmir has joined #asahi
21:10vlixa has quit [Remote host closed the connection]
21:22choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
21:29ephe_meral1 has quit [Ping timeout: 252 seconds]
21:41vlixa has joined #asahi
21:43odmir has quit [Ping timeout: 268 seconds]
21:44Caloludr has quit [Quit: Textual IRC Client: www.textualapp.com]
21:44Caloludr has joined #asahi
21:55odmir has joined #asahi
22:02jeffmiw_ has joined #asahi
22:04odmir has quit [Remote host closed the connection]
22:05odmir has joined #asahi
22:34vlixa has quit [Remote host closed the connection]
22:38vlixa has joined #asahi
23:56jeffmiw_ has quit [Remote host closed the connection]
…