ChanServ changed the topic of #asahi-re to: Asahi Linux: porting Linux to Apple Silicon macs | Hardware / boot process / firmware interface reverse engineering | WARNING: this channel (only) may contain binary reverse engineering discussion | RE policy: https://alx.sh/re (MANDATORY READ) | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-re
nicolas17 has quit [Quit: switching computers again]
nicolas17 has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
yuyichao_ has joined #asahi-re
marcan has quit [Server closed connection]
marcan has joined #asahi-re
chadmed has joined #asahi-re
amarioguy has joined #asahi-re
sven has quit [Server closed connection]
sven has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Retr0id has quit [Server closed connection]
Retr0id has joined #asahi-re
kit_ty_kate has quit [Server closed connection]
kit_ty_kate has joined #asahi-re
arisu has quit [Server closed connection]
arisu has joined #asahi-re
user982492 has joined #asahi-re
riker77_ has joined #asahi-re
riker77 has quit [Ping timeout: 480 seconds]
riker77_ is now known as riker77
sajattack[m] has quit [Server closed connection]
sajattack[m] has joined #asahi-re
PhilippvK has joined #asahi-re
Deewiant has quit [Server closed connection]
Deewiant has joined #asahi-re
phiologe has quit [Ping timeout: 480 seconds]
doggkruse has joined #asahi-re
blazra[m] has quit [Server closed connection]
blazra[m] has joined #asahi-re
Amey has quit [Server closed connection]
Amey has joined #asahi-re
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user982492 has joined #asahi-re
user982492 has quit []
nicolas17 has quit [Ping timeout: 480 seconds]
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user982492 has joined #asahi-re
the_lanetly_052 has joined #asahi-re
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chadmed has quit [Quit: Konversation terminated!]
chadmed has joined #asahi-re
<marcan> rqou_: the only part that bugs me is why RST_INTERVAL is treated as some kind of reset bit/polled
<marcan> that sounds like it came from the driver and something is not understood properly
<rqou_> yeah i have no idea why that happens. it's indeed ripped from the driver directly
<rqou_> reset_block and set_default_regs are both 100% copypasted driver RE
<marcan> if you get rid of param1 in that set_default_regs, all that's left is an MMIO trace
ChaosPrincess has joined #asahi-re
<rqou_> yeah i have no idea what param1 does either
<marcan> I'm pragmatic about this, if you lower RE'd code to a list of register pokes there's nothing copyrightable left, you could've done the same thing by just copying and pasting a trace (which I've done before too)
<marcan> I've done that before too, looked at a bit of a driver to see what it does in what order and why and then just do the same thing, though I usually prefer to start from the trace and *then* fill in gaps that are hard to figure out from the driver, it's safer
<rqou_> i know, but you would need to trace all the permutations of jpeg chroma subsampling mode and output surface chroma subsampling mode
<marcan> actually the last time I had to really blindly do it with a driver was for WiFi on T2s... there's some nonsense for those chips and I don't have a HV setup for those
<rqou_> i *still* don't 100% understand what is happening here
<rqou_> the driver has a bunch of tables containing magic numbers to map from one format to another
<marcan> ideally we'd work out those permutations from HV traces, or from guesswork at this point
<marcan> but it depends on what those tables are
<rqou_> i started with an MMIO trace, dove into the driver to fill in a bunch of details, and then applied a bunch of manual poking and guesswork on top
<rqou_> it's literally a table that has a bunch of numbers like "8" and "16" and "2"
<marcan> if the table boils down to "these are the register values for this format" then simply document that and let someone else write the ~same table
<marcan> since it's again going to be the same info you get from a trace
<marcan> i.e. just document for each register what values / fields get set for specific formats
<rqou_> i could do that. there are formats that the hardware supports that the driver doesn't though, which i've figured out using guesswork
<marcan> yeah, that's a very good thing
<marcan> it's what I do too
<rqou_> e.g. the hardware can encode any permutation of RGBA values afaict, but the driver can only do RGBA or BGRA
<marcan> right, and working those things out is much preferred
<marcan> but not strictly required
<marcan> basically though, I'm very much not worried about what you have in that dump
<rqou_> yeah, i'm very cognizant of intellectual property laws and try to be careful
<marcan> the unwritten rules are that MMIO traces are fair game, and facts about how the hardware works are not copyrightable, nor are trivial mathematical expressions that are the one obvious way to implement a particular function (like those you have in there) or stuff like a for loop to clear an array
<marcan> especially if you're going through python (which is one very good reason why I prototype in m1n1) since that wipes out any copyritability of language-specific details
<marcan> I've heard a lawyer's opinion that register names are not copyrightable either, though I prefer to change them anyway because usually the "official" names are terrible, but basically I'm not worried about looking at and rewriting register names
Dementor[m] has joined #asahi-re
<marcan> what becomes a problem is when you have nontrivial algorithms
<rqou_> hmm, so i can just clean up the script to be less of a mess, flesh out the docs a bit, and then submit a m1n1 PR with an experiment?
<marcan> I'd say so
<rqou_> kk
<marcan> as I said in the policy, the rule is "cleanroom if I don't know you" by default, especially because I *absolutely* don't want anyone sneaking in RE'd code without declaring it as such, that would get us in a ton of trouble
<marcan> but if you're telling me it's RE'd and I look at it and it's so dumbed down there's nothing copyrightable left... then we're good
<marcan> another story is writing the Linux driver, since that would depend on trusting you not to "accidentally" carry over more than what is actually written down in that script per se; that I cannot guarantee yet (though you do seem to know what you're doing)
<marcan> but the whole point of these m1n1 scripts is to serve as a cleanroom-ish firewall, and given the state this one's in, I'm perfectly happy with someone else taking it and writing the Linux version
<marcan> you've basically written hardware docs with this, it's practically cleanroom already this way the way it ended up
<marcan> (which might just be because this driver is just extra dumb in how it sets up the hardware)
<rqou_> the driver is pretty dumb, but i also deliberately wrote up the docs this way to be careful about accidentally copying over stuff
<marcan> yeah, looks like you did a good job then :)
<marcan> same thing I do when I end up looking at code
<marcan> re the RST_INTERVAL thing, if the HV trace shows that condition being immediately met, it could just be something we can ignore without the poll
<marcan> might even be a workaround for broken older hardware
<marcan> you could try using an asm snippet to race the write/read as fast as possible, if you can't get it to ever fail the loop condition on the first readback, just drop the whole loop
<marcan> basically drop code that is not necessary to make the hardware work, unless there is good reason to suspect it might be necessary in some cases
Glanzmann has joined #asahi-re
chadmed has quit [Quit: Konversation terminated!]
chadmed has joined #asahi-re
chadmed has quit []
chadmed has joined #asahi-re
rowang077[m] has quit [Server closed connection]
rowang077[m] has joined #asahi-re
alicela1n has quit [Server closed connection]
alicela1n has joined #asahi-re
<rqou_> oh lmao i just figured out where the JPEG IP comes from
<rqou_> if you read starting from offset +0x10e0 to +0x10f4 you get ascii text 'SHIKINO KJN-7GI 0001'
<rqou_> no register map though
kameks has joined #asahi-re
<Jamie[m]1> haha
the_lanetly_052 has quit [Remote host closed the connection]
<rqou_> there's almost certainly apple customizations/additions to it though, since the driver mentions things like support for "AGX" compressed/tiled/something input formats
<rqou_> if i were to make a wild guess, i would actually guess that all of the pixel format / subsampling / colorspace / etc. stuff is apple's and only the DCT/huffman/etc. bits are licensed
<rqou_> my wild guess is that the registers below 0x1000 are apple's and the registers above 0x1000 are the licensed ip core
<chadmed> if it supports 10-bit ARGB as per your notes then it seems apple have extensively modified it which would fit your guess
<chadmed> you have to wonder why they bother continuing to integrate it at this point, it seems a rather inflexible little bit of silicon
<chadmed> unless it really uses so much less power just decoding the MJPEG stream from the webcam that it makes sense?
perigoso[m] has quit [Server closed connection]
perigoso[m] has joined #asahi-re
the_lanetly_052 has joined #asahi-re
megalokafes_ has quit [Quit: Connection closed for inactivity]
amarioguy has joined #asahi-re
kameks has quit [Ping timeout: 480 seconds]
amarioguy has quit [Ping timeout: 480 seconds]
chadmed has quit [Remote host closed the connection]
amarioguy has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
amarioguy has joined #asahi-re
doggkruse has joined #asahi-re
yuyichao_ has quit [Ping timeout: 480 seconds]
amarioguy has quit [Ping timeout: 480 seconds]
yuyichao_ has joined #asahi-re
amarioguy has joined #asahi-re
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doggkruse has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
foxtrot has quit [Quit: Goodbye]
foxtrot has joined #asahi-re
foxtrot is now known as Guest325
amarioguy has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
amarioguy has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
amarioguy has joined #asahi-re
Dementor[m] has quit [Server closed connection]
Dementor[m] has joined #asahi-re
abilash1994[m] has quit [Server closed connection]
abilash1994[m] has joined #asahi-re
AdryzzOLEDEdition[m] has quit [Server closed connection]
AdryzzOLEDEdition[m] has joined #asahi-re
ah-[m] has quit [Server closed connection]
ah-[m] has joined #asahi-re
petermlyon[m] has quit [Server closed connection]
petermlyon[m] has joined #asahi-re
arnidg[m] has quit [Server closed connection]
arnidg[m] has joined #asahi-re
Augur[m] has quit [Server closed connection]
Augur[m] has joined #asahi-re
Bastian[m] has quit [Server closed connection]
Bastian[m] has joined #asahi-re
BenPetterborg[m] has quit [Server closed connection]
BenPetterborg[m] has joined #asahi-re
brentr123[m] has quit [Server closed connection]
brentr123[m] has joined #asahi-re
CristianMgheruan-Stanciu[m] has quit [Server closed connection]
CristianMgheruan-Stanciu[m] has joined #asahi-re
daftfrog[m] has quit [Server closed connection]
daftfrog[m] has joined #asahi-re
Liam[m] has quit [Server closed connection]
Liam[m] has joined #asahi-re
user982492 has joined #asahi-re
DiscoPenguin[m] has quit [Server closed connection]
DiscoPenguin[m] has joined #asahi-re
h_ro[m] has quit [Server closed connection]
h_ro[m] has joined #asahi-re
joerosenberg[m] has quit [Server closed connection]
joerosenberg[m] has joined #asahi-re
katatafjsh[m] has quit [Server closed connection]
katatafjsh[m] has joined #asahi-re
mofux[m] has quit [Server closed connection]
konr-72[m] has quit [Server closed connection]
mofux[m] has joined #asahi-re
konr-72[m] has joined #asahi-re
NotHere[m] has quit [Server closed connection]
long[m] has quit [Server closed connection]
NotHere[m] has joined #asahi-re
long[m] has joined #asahi-re
lucifer178[m] has quit [Server closed connection]
lucifer178[m] has joined #asahi-re
NightsOnly[m] has quit [Server closed connection]
NightsOnly[m] has joined #asahi-re
nilsi[m] has quit [Server closed connection]
nilsi[m] has joined #asahi-re
HaoYanQi[m] has quit [Server closed connection]
HaoYanQi[m] has joined #asahi-re
BingDennis[m] has quit [Server closed connection]
BingDennis[m] has joined #asahi-re
retonlage[m] has quit [Server closed connection]
retonlage[m] has joined #asahi-re
rkjnsn has quit [Server closed connection]
rkjnsn has joined #asahi-re
rusty-nail[m] has quit [Server closed connection]
ryanhrob[m] has quit [Server closed connection]
rusty-nail[m] has joined #asahi-re
ryanhrob[m] has joined #asahi-re
nicolas17 has joined #asahi-re
thebigbossch[m] has quit [Server closed connection]
thebrinkoftomorrow[m] has quit [Server closed connection]
thebigbossch[m] has joined #asahi-re
thebrinkoftomorrow[m] has joined #asahi-re
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user982492 has joined #asahi-re
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
the_lanetly_052 has quit [Ping timeout: 480 seconds]
athul[m]1 has quit [Server closed connection]
athul[m]1 has joined #asahi-re
user982492 has joined #asahi-re
amarioguy has quit [Ping timeout: 480 seconds]
m6wiq has joined #asahi-re
Denver has joined #asahi-re
Denver has quit [Read error: Connection reset by peer]
MatrixTravelerbot[m] has joined #asahi-re
<kode54> which reminds me
<kode54> 12.3 seems to have broken webcams that use MJPEG for high resolution / frame rate video
<kode54> I'm stuck with apps either deciding to use the low frame rate high resolution raw video, or apps like Skype deciding to use the highest raw that will do 30fps
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Denver has joined #asahi-re
user982492 has joined #asahi-re
Denver has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
m6wiq has quit []
luxio_39[m] has joined #asahi-re
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yuyichao_ has quit [Ping timeout: 480 seconds]
user982492 has joined #asahi-re