#
…

2022-02-04

00:03yuyichao has quit [Ping timeout: 480 seconds]
00:25yuyichao has joined #asahi-dev
01:19nirgo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:27chadmed has joined #asahi-dev
02:40jbowen has quit [Ping timeout: 480 seconds]
02:54balrog has quit [Ping timeout: 480 seconds]
03:00bmrgz[m] has quit [Server closed connection]
03:01bmrgz[m] has joined #asahi-dev
03:01balrog has joined #asahi-dev
03:29lewurm has quit [Server closed connection]
03:29lewurm has joined #asahi-dev
03:49kov has quit [Quit: Coyote finally caught me]
03:52kov has joined #asahi-dev
04:01PhilippvK has joined #asahi-dev
04:02marcanpushed SMC stuff I had to smc/work; going to work on hooking up the GPIOs to PCIe now
04:04phiologe has quit [Ping timeout: 480 seconds]
04:04marcanjannau, sven: why not just have a property in the DART node that tells the driver to not reset it and inherit the iova mappings (the driver should then verify that none of them are in the normal RAM range, and complain loudly about firmware bugs if they are)
04:05marcanthat works for both locked and non-locked DARTs then, it'd basically implement the same thing
04:05marcan(except for non-locked DARTs we can move the TTBR if we want to)
04:05marcanafter all, we need this for locked DARTs anwyay
04:05marcan(a subset)
04:05marcan*superset
04:06marcanfirmware leaving behind mappings in normal RAM space is a bug anyway
04:06marcanprior stages should always clean up
04:07marcanfor DARTs for devices that can be shut down, the TTBRs should be torn down entirely; for DARTs that need to stay alive (DCP and DISP0), all mappings in normal RAM should be removed
04:08marcanI added code to m1n1 to clean up DART page tables that are allocated out of the heap on exit, for DCP/DISP0
04:10marcanin fact this feature is sort of orthogonal to locked DART support; there should be an apple,inherit-mappings thing or something, and that would be set both for DCP and DISP0; it would mean on startup we walk the page tables and validate/absorb those mappings
04:10marcanthen if the DART is not locked, we just set a TTBR as usual replacing the existing one (and from that point on we don't care about the firmware-allocated PTs)
04:10marcanif the DART is locked we atomically copy out the top level PT on top of the existing one, then use that instead
04:11marcanand that's orthogonal to whether the mappings got inherited or not (though in practice there's no case where they aren't and the DART is locked of course)
04:14LorenzKofler[m] has quit [Server closed connection]
04:14LorenzKofler[m] has joined #asahi-dev
04:21drwhax[m]1 has quit [Server closed connection]
04:21drwhax[m]1 has joined #asahi-dev
04:32jbowen has joined #asahi-dev
04:38as400[m] has quit [Server closed connection]
04:38as400[m] has joined #asahi-dev
04:40latko[m] has quit [Server closed connection]
04:40latko[m] has joined #asahi-dev
04:41jbowen has quit [Ping timeout: 480 seconds]
04:41l3k[m] has quit [Server closed connection]
04:41l3k[m] has joined #asahi-dev
04:42Sebhl[m] has quit [Server closed connection]
04:42Sebhl[m] has joined #asahi-dev
04:47dsrt^ has joined #asahi-dev
04:49_jannau_ has quit [Server closed connection]
04:49_jannau_ has joined #asahi-dev
05:09RianSouzaSantos[m] has quit [Server closed connection]
05:09RianSouzaSantos[m] has joined #asahi-dev
05:44Rhys[m] has quit [Server closed connection]
05:45Rhys[m] has joined #asahi-dev
05:53mini has quit [Server closed connection]
05:54mini has joined #asahi-dev
06:25riker77 has quit [Server closed connection]
06:25riker77 has joined #asahi-dev
06:30deathdisco[m] has quit [Server closed connection]
06:30deathdisco[m] has joined #asahi-dev
06:32ogimgd[m] has quit [Server closed connection]
06:33ogimgd[m] has joined #asahi-dev
06:33jbowen has joined #asahi-dev
06:35jannaumarcan: that's more or less what alyssa already did for dcp see https://github.com/jannau/linux/commit/e4ec146a8fc6fb565a18e8fb6c501b4f7f8bc7fb
06:37jannauI'm under the impression that sven thinks upstream will not like/accept it
06:39jannauthis currently is controlled by the dart being locked, the disp0 dart is soft-locked by a property in the dtb
06:40jannaudecoupling locked form inherit-mapping would not be a problem
06:41jbowen has quit [Ping timeout: 480 seconds]
06:41svenI briefly talked with robin who maintains the iopgtbl code and he was not very happy about reading out mappings and iirc called that something like a last resort
06:42svenIt also requires a bit of hacking because for DCP we’ll need to switch from the default dma domain to an unmanaged domain
06:56jannauthe only problem I see with having the memory-regions/mappings in the dtb is that there are no bindings to express that
06:58jannauI'm working on a proposal that would work for dart/dcp: using reserved-memory and define how it should be mapped in the iommu node
07:01svenyeah, I think he then pointed me to that thread on the iommu list that’s been in flight for months now because no one cares enough to see it through ;)
07:04svenhrm, i guess if we do have to fall back to apple,inherit-mappins we could read them out in probe, stash them somewhere and the re-create them when a domain is attached before overwriting the TTBR though
07:08jeffmiw has quit [Ping timeout: 480 seconds]
07:48joske has joined #asahi-dev
07:54joske has quit [Quit: Leaving]
08:08marcanI mean, what's the advantage of putting this in the DT vs reading out mappings?
08:08marcanin principle the firmware could decide to do whatever crazy mappings it wants all within reserved memory, and we'd have to preserve that
08:09sveniirc his point was that other people have wanted something similar for a while so it would be nice to use this chance to add that feature (see the whole thread jannau linked https://lore.kernel.org/dri-devel/YUIPCxnyRutMS47%2F@orome.fritz.box/)
08:10sveni'm also fine with apple,inherit-mappings and making sure those mappings don't point to normal RAM fwiw
08:10ybk[m] has quit [Server closed connection]
08:11ybk[m] has joined #asahi-dev
08:13svenif we do that we'd need to adjust iopgtbl to allow walking the pagetable and returning the mappings and then re-create them on every domain attach (which we need for the switch from DMA to UNMANAGED and also if we wanted to support re-probing because that also cycles the iommu domain iirc)
08:26IsfarSifat[m] has quit [Server closed connection]
08:26IsfarSifat[m] has joined #asahi-dev
08:27wollymilkcap[m] has quit [Server closed connection]
08:27wollymilkcap[m] has joined #asahi-dev
08:33jbowen has joined #asahi-dev
08:34sppdqd[m] has quit [Server closed connection]
08:35sppdqd[m] has joined #asahi-dev
08:35josipknezovic[m] has quit [Server closed connection]
08:35josipknezovic[m] has joined #asahi-dev
08:41jbowen has quit [Ping timeout: 480 seconds]
08:55Major_Biscuit has joined #asahi-dev
09:21kettenismarcan: we still don't really have a clue what the 0x800000 on the wifi gpios is about is it?
09:34j`eymarcan: I noticed the smcgpio doesnt have an of_match_table, obviously it's still WIP, but is that just missing, or does it get probed some other way?
09:54NotHere[m] has quit [Server closed connection]
09:54NotHere[m] has joined #asahi-dev
09:55citruscitrus[m] has quit [Server closed connection]
09:55citruscitrus[m] has joined #asahi-dev
10:03dsrt^ has quit [Remote host closed the connection]
10:03dsrt^ has joined #asahi-dev
10:03rethematrix[m] has quit [Server closed connection]
10:03rethematrix[m] has joined #asahi-dev
10:04long[m] has quit [Server closed connection]
10:04long[m] has joined #asahi-dev
10:04matthewayers[m] has quit [Server closed connection]
10:04matthewayers[m] has joined #asahi-dev
10:07ryanhrob[m] has quit [Server closed connection]
10:07ryanhrob[m] has joined #asahi-dev
10:08roxiun[m] has quit [Server closed connection]
10:09roxiun[m] has joined #asahi-dev
10:11dsrt^ has quit [Ping timeout: 480 seconds]
10:11dsrt^ has joined #asahi-dev
10:16j`eyah no, I figure it out, smc_core.c has a bunch of drivers in apple_smc_devs
10:18mariogrip[m] has quit [Server closed connection]
10:18mariogrip[m] has joined #asahi-dev
10:18nirusu[m] has quit [Server closed connection]
10:19nirusu[m] has joined #asahi-dev
10:19dsrt^ has quit [Ping timeout: 480 seconds]
10:21ghantaz[m] has quit [Server closed connection]
10:21ghantaz[m] has joined #asahi-dev
10:22sproede[m] has quit [Server closed connection]
10:22sproede[m] has joined #asahi-dev
10:25Rhys[m] is now known as Rhys[m]1
10:25Rhys[m]1 is now known as Rhys[m]12
10:25Rhys[m]12 has quit [Quit: Reconnecting]
10:25Rhys[m]12 has joined #asahi-dev
10:25gladiac has quit [Quit: Ping timeout (120 seconds)]
10:25gladiac has joined #asahi-dev
10:28marcankettenis: we don't, I'm just going to ignore it for now. seems to work fine without it.
10:28marcanwouldn't even be that surprising if it's useless and some legacy thing even
10:33jbowen has joined #asahi-dev
10:34j`ey# cat sys/class/power_supply/macsmc-battery/capacity
10:34j`eyhmm, looks like I will have to reboot into 1tr to actually see if I only have 15% left :P
10:36j`ey(and yes, i do only have 15% left, nice!)
10:41jbowen has quit [Ping timeout: 480 seconds]
10:52yrlf has quit [Server closed connection]
10:52yrlf has joined #asahi-dev
11:05suricato has quit [Server closed connection]
11:06suricato has joined #asahi-dev
12:12jato has quit [Server closed connection]
12:12jato has joined #asahi-dev
12:18Retr0id3 has joined #asahi-dev
12:18Retr0id has quit [Remote host closed the connection]
12:18Retr0id3 is now known as Retr0id
12:23leah has quit [Server closed connection]
12:23leah has joined #asahi-dev
12:23leah is now known as Guest1763
12:33jbowen has joined #asahi-dev
12:37blasty has quit [Server closed connection]
12:37blasty has joined #asahi-dev
12:41flying_sausages has quit [Server closed connection]
12:41jbowen has quit [Ping timeout: 480 seconds]
12:42flying_sausages has joined #asahi-dev
13:08alyssaif I'm not mistaken, your examples for the big-endian machine are all backwards?
13:08alyssa%p4ch should be different for big/little, whereas %p4cl and %p4cb should be the same?
13:09alyssaunless I don't understand what the &(u32) notation means?
13:11phireAm I right in assuming that 0x1507008000 is a userspace pointer?
13:12phirehv_translate returns 0
13:13sventhat's certainly not a kernel pointer
13:14svenwhat are you looking at? it's a bit too large for something mapped through DART
13:14sven(though, some DARTs may support >32bit on the Max/Pro)
13:14phireThis is a pointer that's being passed into AGX (I think)
13:14svenah, could be something mapped through the GPU's IOMMU then
13:15phirewhich there doesn't seem to be any details about in the adt
13:15svenyeah, that node is just a hack
13:15sventhe kext that attaches to it just calls back into the main GPU kexy
13:15alyssaphire: ah the GART
13:16phireis that it's name?
13:16kaprests has quit [Server closed connection]
13:16kaprests has joined #asahi-dev
13:22alyssaas opposed to DART
13:22alyssaApple are... quite creative when it comes to naming.
13:25phireDo we know anything about it? Can we assume it's just a more specialized DART
13:25phireor might it be something completly difrent
13:25sveni briefly looked at the strings of the kext and it sounded very different
13:26phirewhich kext?
13:26sventhe agx kext, i'd have to look up its name
13:26svenbut it had strings about GART
13:27chadmedwould it be a GART in the tradtitional sense?
13:27svenabsolutely not :D
13:33phireIOGraphicsFamily.kext doesn't mention it
13:39svenAGXG13X.kext
13:39svennot sure if that's the correct one but it has some strings about "Gart"
13:39sven"AGXSecureGart""
13:42phirethat's it
13:43ketteniswhat is a "GART in the traditional sense"?
13:43chadmedgraphics address remapping table
13:44chadmedbut no, theyve just reused the acronym for something different in a graphics device. real genius stuff.
13:44phireThey refer to "GartTables" in the string
13:47chadmedioreg also lists AGXGart/AGXSecureGart classes in IOKit
13:49svenyes, that's the stub kext that just forwards everything to the real gpu driver
13:50phirethe strings seem to indicate that the firmware is in charge of Gart
13:51phirebut I haven't seen any messages to the firmware with enough entropy to even setup Gart
13:51phireso I'm missing a communication channel
13:52alyssaphire: I would expect gart to be registers direct to the CPU no?
13:52alyssaProgramming the MMU sounds like the kernel's job
13:52phireThat's what I would have thought
13:53alyssabut it's missing in the DT?
13:54svenlet's move to -re :)
14:33jbowen has joined #asahi-dev
14:36yuyichao has quit [Ping timeout: 480 seconds]
14:42jbowen has quit [Ping timeout: 480 seconds]
15:03nirgo has joined #asahi-dev
15:07jbowen has joined #asahi-dev
16:56yuyichao has joined #asahi-dev
16:58Gaspare has joined #asahi-dev
17:54Major_Biscuit has quit [Ping timeout: 480 seconds]
19:24m6wiq has joined #asahi-dev
21:20povikthe ADMAC peripheral appears to have four independent interrupt line outputs
21:20povikand e.g. /arm-io/admac-sio has only the second line wired to AIC
21:21povikhow do i express this in devicetree?
21:21povikoptions:
21:21povik(1) interrupt-names containing one of four names
21:22povik(2) vendor property
21:22povik(3) there's something called interrupt-map in pci bindings, may apply here
21:23poviki like (1) but binding documentation discourages looking interrupts by name, not having fixed order in interrupts=
21:30povik(later i will confirm this in an experiment, but by looking at ADT i see that /arm-io/admac-aop-audio, another ADMAC instance, exposes different output to AIC, so this can't be hardcoded)
21:33povikand in case of (2) i accept naming suggestions, if there's standard nomenclature for this kind of thing better than apple,interrupt-line
21:34povikfwiw apple seems to call this irq-destination-index
21:40kettenisI don't understand, there is only a single interrupt listed for those admac controllers
21:41povikyes, from the register map you can tell there are four independent interrupt outputs on ADMAC
21:41povikand the one selected by irq-destination-index is the one listed
21:46kettenisso you mean for the other ADMAC you have to look at the register at offset 0x0030 to get the mask of channels that have interrupts pending?
21:48povikactually it would be 0x0038, if i am not mistaken, as opposed to 0x0034 on the ADMAC we know
21:48povikthat's in effect what this is
21:49ketteniswait, index 1 maps to 0x0038 and index 2 maps to 0x0034?
21:49povikno the other way
21:49povikindex 1 is on /arm-io/admac-sio, where we look at 0x34
21:49povik2 on the other, we look at 0x38
21:50povikyeah, seems to check out with the driver code
21:50povikor are you looking at 0x38 in your driver and it works? that would we weird
21:51kettenisoh wait, audio is on admac-sio and admac-aop-audio is used for something else...
21:51povikmicrophones :-)
21:52povikyou know what. let me do one other thing then i will do the experiment
22:02ketteniswell, I think the interrupts property can only describe interrupts that are actually connected to the interrupt controller
22:02kettenisso you'll need another property to describe which register to look at
22:05Gaspare has quit [Quit: Gaspare]
22:13povikuh, this isn't so easy enabling all the power domains for admac-aop-audio
22:21Deewiant has joined #asahi-dev
22:27povikfu, that took longer than expected, anyway let's poke
22:30poviklet's see where those AIC registers are again
22:34povikyeah, one should look at 0x38 for /arm-io/admac-aop-audio
22:34povikbehaves as postulated
22:35j`ey has quit [Server closed connection]
22:35j`ey has joined #asahi-dev
22:39ketteniswell, that isn't an AIC register
22:40povikno, but i am looking at HW_STATE register in AIC to confirm which interrupt line it reflects
22:41povik"which of 0x30, 0x34, 0x38, 0x3c will reflect what the AIC's HW_STATE does?"
22:45povik(i am having the cause and effect in reverse here but you get the idea)
23:07Glanzmann has quit [Server closed connection]
23:17bluerise has quit [Server closed connection]
23:17bluerise has joined #asahi-dev
23:44m6wiq has quit []
23:54yuyichao has quit [Ping timeout: 480 seconds]
…