#
…

2021-02-17

02:02qyousef has quit [Ping timeout: 256 seconds]
02:03riker77_ has joined #asahi-dev
02:04qyousef has joined #asahi-dev
02:04riker77 has quit [Ping timeout: 264 seconds]
02:04riker77_ is now known as riker77
03:12phiologe has quit [Ping timeout: 260 seconds]
03:12phiologe has joined #asahi-dev
06:10VinDuv has joined #asahi-dev
07:33VinDuv has quit [Quit: Leaving.]
08:00maor26 has joined #asahi-dev
08:06amw has joined #asahi-dev
08:25never_releasedmodwizcode: There are two IPIs methods
08:25never_releasedthe AIC IPIs over IRQs
08:25never_releasedand the fast IPIs over FIQs
08:32M0_osx[m] is now known as osxre
08:33osxre is now known as M0_osx[m]
08:57amw has quit [Ping timeout: 246 seconds]
08:59bisko has quit [Ping timeout: 240 seconds]
09:00redbluescreen[m] has quit [Quit: Idle for 30+ days]
09:00rockinrobstar[m] has quit [Quit: Idle for 30+ days]
09:00crafteck[m] has quit [Quit: Idle for 30+ days]
09:46bisko has joined #asahi-dev
10:38amw has joined #asahi-dev
10:42amw has quit [Ping timeout: 256 seconds]
10:56marcanmodwizcode: that "defer" doesn't mean what I called "deferred IPIs" for non-AIC
10:56marcanthat's corellium terminology, and i don't agree with it
10:57marcanwhoever wrote that QEMU code copied the register defines from the corellium patchset
10:59marcanI need to test those extra registers again though
10:59marcanalso, uh
11:00marcanthere is hex-rays output in that file
11:00marcanI'm sorry, I can't trust someone who plasters *decompiler output* all over their repo in a *target repo*
11:00marcanlike wtf
11:15dhewgat least it's just a comment and not actually compiled :P
11:25bisko_ has joined #asahi-dev
11:26bisko has quit [Read error: Connection reset by peer]
12:00w3a has joined #asahi-dev
12:03w3a has quit [Read error: Connection reset by peer]
12:06JTL has quit [Ping timeout: 246 seconds]
12:14JTL has joined #asahi-dev
12:31bisko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:50roxfanit's documentation!
16:00odmir has quit [Remote host closed the connection]
16:00bisko has joined #asahi-dev
16:01odmir has joined #asahi-dev
16:16modwizcodeYeah I noticed that it's pretty yikes
16:17modwizcodeThe point still stands that as far as I know what they call the "deferred" ipis are currently not documented on our AIC page
16:26odmir has quit []
16:27jato_ is now known as jato
16:28modwizcodeI think it's fair that someone using a repo as a storage place might keep notes in the comments to explain their code. They make some really weird implementation choices overall though.
16:37yrlfmodwizcode: sure, but as I understand it, a public fork of a GPL project most likely counts as distribution, so adding decompiler output _anywhere_ in that repo is questionable at best from a copyright perspective
16:37yrlf(IANAL, of course)
16:59odmir has joined #asahi-dev
17:09modwizcodeThat's... probably a good point
17:10modwizcodeAlthough I think you could probably use the argument that technically distribution as a public github repo doesn't imply licensing others to actually use the code.
17:10modwizcodeBut even that is nullified by the fact that they put the GPL license header at the top of the additional files with the copyrighted code decompiled in it
17:21marcanmodwizcode: distribution of any kind triggers the GPL rules, and putting something up on github absolutely counts as distribution
17:30vimal has joined #asahi-dev
17:38VinDuv has joined #asahi-dev
17:49vimal has quit [Remote host closed the connection]
18:05arekm has quit [Ping timeout: 264 seconds]
18:07arekm has joined #asahi-dev
18:17bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:18svenhttps://github.com/AsahiLinux/m1n1/pull/30/files alright.. that's probably everything I can figure out by poking dart mmios and playing with the framebuffer.
18:19svennow I need to somehow bring up something that lets me see the memory space from the device-side :)
18:50modwizcodeOpen up the soc and poke some probes in c;
18:51kettenissven: did you manage to find a way to enable some sort of bypass mode?
18:52Namidairo has quit [Read error: Connection reset by peer]
18:54Namidairo has joined #asahi-dev
18:58svenkettenis: so I assume that there needs to be a "bypass base address" and some "bypass enable" flag. I wasn't able to find them though and doing it just with the frame buffer is a little bit inconvenient because I can't control the device address
19:01svenmy best guesses for the bypass enable: 1) the enable/disable flag is in 0xfc, 2) some bit in what I call TCR, 3) somewhere in the 0x140...0x200 range which I haven't spent much time with yet
19:01svenI kinda forgot about 3, so maybe I'll poke around in there some more
19:03svenI haven't looked at what corellium does yet though because I wanted to approach this without any assumptions. maybe they have that bypass flag in their tree.
19:03kettenisThey don't
19:04kettenisI poked around a bit within u-boot based on the register names in their code
19:04svenmy best bet is the TCR or something in that range I forgot about fwiw.
19:05never_releasedbypass-only as currently implemented in pongoOS
19:07kettenisok, thanks
19:07svenhrm. that doesn't seem to work for the frame buffer.
19:10never_releaseddid you convert the pointer?
19:10never_releasedto the proper base
19:11kettenisthe problem with the framebuffer is that the graphics hardware will be using a translation
19:11svenI've disabled translations
19:11kettenisso enabling bypass mode without reprogramming the display engine probably won't work
19:11svenset32(0x231304000+0x100, (8<<16)|0x100); <-- that should disable translation (by clearing 0x80) and enable bypass mode with a base at the start of RAM
19:12svenand I know where the display engine expects the frame buffer to be at and I wrote 0xff's to the start of ram plus that address
19:18svens/set32/write32/, but same result
19:19kettenisis the framebuffer the only thing that's mapped in that particular DART?
19:20sventhere are more things mapped, but I just recreated the mapping and only mapped that frame buffer. still works then
19:20vimal has joined #asahi-dev
19:20sven(where "more things" = "one more page")
19:22svenI can set 0xff1bdf in the TCR so that bypass mode kinda agrees with that
19:22svenlet me try to poke some bits, maybe it needs something else in there as well
19:23never_releasedwill ask, might be that you'd have to avoid touching the DISP0 DART
19:24sventhe flush thing also looks.. strange. just write 0 to two registers?
19:26vimal has quit [Ping timeout: 272 seconds]
19:31kettenisaccording to the corellium driver you need to write a bitmask of the devices on which to operate in one of those
19:32kettenisand a non-zero code in the other one
19:33svenso I've poked that register before and couldn't really see anything. there's a second block of memory in the device tree (for disp0 0x4000 bytes before) and after 0x2000 there is some kinda of pagetable cache
19:34svenmaybe it just doesn't effect that though
19:34svenbut all that happened when setting bits in 0x20 was that bits were set and nothing else
19:45vimal has joined #asahi-dev
19:48svenoh... interesting. writing zero to that register does set bit 0x4 for a brief moment though
19:48modwizcodesven: can you post up a full dump of dart space values somewhere?
19:49svenactually, writing anything to that register sets bit 0x4 for a short time
19:49svenI guess invalidate actually is somewhere in there then :-)
19:50kettenis0x4 seems to be a "busy" bit
19:50svenyeah, that makes sense
19:51svenI always did write32(reg, something); read32(reg); from python. kinda obvious that I couldn't see that busy flag :)
19:51svenwhen I do str directly followed by ldr I do see it though
19:51modwizcodeMaybe an op to write and immediately read would be helpful
19:52sven+ def writeread32(self, addr, data):
19:52sven+ return self.request(self.P_WRITEREAD32, addr, data)
19:52svengreat minds think alike and yet fools seldom differ :P
19:53modwizcodeheh I don't think I've ever heard that one
19:54modwizcodeProbably unlikely but is there any chance there's even just minor overlap with SMMU concepts?
19:55svenoh... I definitely need to take a closer look at that one range I forgot about again
19:55sven0184: 0001000c
19:55sventhere's 16 values for 16 devices in there that seem to contain more flags
19:56kettenisnot familliar with SMMU, but in the end it's just a page table of sorts and some registers to poke to flush cached translation entries
19:57modwizcodethanks sven
19:57sventhat's disp0 after a fresh reboot
19:58sven0180 - 01bc looks interesting as well. let's see if I can figure out what they do
19:58modwizcodeLots of zeros in the 0x3000 range
19:59sveneverything after 0x300 seems to be zero.
19:59sven0x200 - 0x300 are the pointers to the pagetables
19:59sven4 per device, bit 31 indicates if they're active
20:09svenhuh, now I can't reproduce that busy bit anymore.
20:15kettenisif there is nothing to flush it will probably clear immediately
20:17kettenisanyway, I'll probably get to the point where I can play with bypass mode for the PCIe devices in a few days
20:19odmir has quit []
20:27svenwell, it used to set the busy bit even when I wrote 0 to it
20:27svenbut no idea what I've done before that to trigger that :/
20:29svenah... got it. looks like you need to write to that device selection register first
20:29sventhat kinda makes sense ;)
20:30svenactually, no, it just doesn't like you if select a device that is disabled
20:37brandas[m]1 has joined #asahi-dev
20:47rockinrobstar[m] has joined #asahi-dev
20:51odmir has joined #asahi-dev
20:53brandas[m]1 has left #asahi-dev ["User left"]
20:58modwizcodesven: any progress on bypass mapping the display?
21:04sventhe whole top_byte<<16 | 0x100 would fit though since I can only set 0xff1bdf and that lines up nicely
21:05svenI think I'll need some device to be able to see the virtual address space
21:05svenmaybe the display is doing something strange that breaks when bypass is enabeld
21:21modwizcodesven: Is the dart device for the display #0? It looks like there's multiple entries in that register set
21:21svenyes, there are two blocks of registers
21:21sventhat one that I dumped + another one just before that
21:21sventhe one just before that contains some kind of pagetable cache starting at 0x2000
21:22svenand something else before that, but I haven't looked into that yet
21:22modwizcodeI meant like there's the #16ish entries or ids or whatever
21:22svenoh, yes
21:22svendevice #0 is the framebuffer
21:22sventhere's also #4 which I have no clue about
21:22modwizcodeI love arbitrary numeric identifiers
21:23sventhe index is somewhere in the device tree
21:23modwizcodeI got quite mad when I realized that for all the dynamic stuff of pcie, you still have to know what each BAR represents :p
21:23svenmapper-disp0 and mapper-disp0-piodma
21:23modwizcodeinteresting
21:29modwizcodewhat is this?
21:29sventhe pagetables for disp0 from iboot
21:30svendevice 04 is this piodma thing
21:36adamcstephens has joined #asahi-dev
21:42modwizcodeI'm trying to make sense of those mappings
21:42VinDuv has quit [Quit: Leaving.]
21:45modwizcodesven: did you mess with the mappings before that dump was taken?
21:45sventhat was after a clean reboot
21:47modwizcodeweird... why is your fb base at such a strange address...?
21:47modwizcodeEven the mappings don't make sense to me, assuming that the first dev there is the fb mappings, those are different virtual mappings than I would expect
21:47adamcstephens has left #asahi-dev ["The Lounge - https://thelounge.chat"]
21:49sventhe beginning makes sense I think. it's mapping the frame buffer starting from vaddr 0423c000
21:49svenbut things get weird after the framebuffer ends
21:51sventhese vaddrs also appear in the "fault address" status register if I disable that mapping
21:53modwizcoderight but why is your fb from the boot arguments set to what appears to be the physical address?
21:54svenFB at: 0x9e0df8000
21:54svenpage (143): 0423c000 ... 04240000 -> 00000009e0df8000 [0b11]
21:54modwizcodeOh are those backwards?
21:54modwizcode(i.e. device->host)
21:55modwizcodebackwards from what I was thinking
21:56modwizcodewait what type of device are you using sven?
21:57modwizcodewhat model of mac
21:57svenMac mini
21:57modwizcodethat doesn't help then :/
21:57svenmy m1 MacBook Air is just the UART adapter :P
21:57modwizcodeI'm confused because your address for the framebuffer is very different from what I was seeing in marcan'
21:57modwizcodemarcan's streams
21:58modwizcodeand it's not like a nice round number too
21:59sven🤷‍♂️
22:12kubes has quit [Quit: Leaving]
23:28maor26 has quit [Ping timeout: 256 seconds]
23:53zopieux has quit [Ping timeout: 272 seconds]
23:54zopieux has joined #asahi-dev
…