marcan changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
acelogic has joined #asahi-dev
<Shiz> after a bunch of silly bit twiddle debugging, to-adt now works and roundtrips successfully :)
<jn__> \o/
<Shiz> ~/d/m/img4 ❯❯❯ ./dt.py find devtree_after_iboot.bin name=wdt
<Shiz> /arm-io/wdt
<Shiz> ~/d/m/img4 ❯❯❯ ./dt.py regs devtree_after_iboot.bin /arm-io/wdt
<Shiz> 0x23d2b0000 16384
<Shiz> with new useful subcommands
<j`ey> /arm-io/aic pls
<j`ey> :-)
<j`ey> Shiz: that repo is self contained right? no pip or whatever
<Shiz> git clone --recursive is all you need for dt.py
<Shiz> img4.py needs asn1parse
<Shiz> asn1crypto*
<j`ey> is that a python thing
<j`ey> ?
<Shiz> yeah
<Shiz> it's also in requirements.txt :p
<Shiz> but again, not needed for just dt.py
acelogic has quit [Ping timeout: 246 seconds]
dstzd has quit [Quit: ZNC - https://znc.in]
dstzd has joined #asahi-dev
qyousef has quit [Ping timeout: 256 seconds]
qyousef has joined #asahi-dev
qyousef1 has joined #asahi-dev
qyousef has quit [Ping timeout: 272 seconds]
qyousef1 has quit [Client Quit]
qyousef has joined #asahi-dev
qyousef has quit [Client Quit]
qyousef has joined #asahi-dev
tbodt has quit [Ping timeout: 256 seconds]
tbodt has joined #asahi-dev
mindentropy has joined #asahi-dev
_whitelogger has joined #asahi-dev
_whitelogger has joined #asahi-dev
_whitelogger has joined #asahi-dev
krzywix has joined #asahi-dev
<Shiz> dt gained a few more useful functions (chief among 'show'), should be somewhat ready for actual usage now
<marcan> Shiz: I wonder if we should build our tooling on git
<marcan> adt->fdt tree, plus real-fdt tree
<marcan> cherry-pick changes
<marcan> :-)
<Shiz> heh
<Shiz> what i do internally right now is convert everything to ADT because it's simpler
<Shiz> have you seen the diff output? it's rather git-ish :p
<Shiz> marcan: so dt.py can export to dts, i figure we could just use that in combination with git :)
<Shiz> much easier to cherry-pick than fdt
<clayfreeman> does dtc(1) always output in big endian? might cause issues with comparisons unless you compensate for that
<clayfreeman> I think I remember the bin marcan posted being LE
sirn has quit [Ping timeout: 260 seconds]
sirn has joined #asahi-dev
<Shiz> clayfreeman: i do compensate for that
<Shiz> Apple device trees are little-endian
<Shiz> Flattened device trees (dtb/fdt) are big-endian
<Shiz> as per the spec
<clayfreeman> ah, excellent!
<Shiz> there is one issue right now, which is the endian-ness of prop-encoded-array fields, whose parsing is nontrivial and as such not done automatically
<clayfreeman> I might try to implement to_fdt if I get some free time
<clayfreeman> opened a small PR for a typo that breaks regs
<Shiz> ah whoops, merged
<Shiz> to_fdt is rather annoying as a fair warning :) you might get wrapped up in the struct library, hehe
<Shiz> feel free to ping me anytime about it
<clayfreeman> will do :)
<clayfreeman> If to_fdt can be done, then we could use dtc(1) to convert the dtb to dts and vice-versa
<Shiz> well
<Shiz> it already supports dts output
<Shiz> see the `to-src` command :)
<clayfreeman> true, but it's less code ownership that you have to worry about
acelogic has joined #asahi-dev
Necrosporus has quit [Killed (verne.freenode.net (Nickname regained by services))]
Necrosporus has joined #asahi-dev
Esmil has quit [Ping timeout: 256 seconds]
Esmil has joined #asahi-dev
CalumK has joined #asahi-dev
_whitelogger has joined #asahi-dev
<marcan> Shiz: yeah sorry, I meant dts
<marcan> not fdt of course
<marcan> :)
VinDuv has joined #asahi-dev
rwhitby has quit [Ping timeout: 264 seconds]
rwhitby has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
mindentropy has quit [Quit: Leaving]
dstzd has quit [Quit: ZNC - https://znc.in]
dstzd has joined #asahi-dev
dstzd has quit [Client Quit]
dstzd has joined #asahi-dev
dstzd has quit [Client Quit]
dstzd has joined #asahi-dev
dstzd has quit [Client Quit]
dstzd has joined #asahi-dev
acelogic has quit [Ping timeout: 246 seconds]
dstzd has quit [Read error: Connection reset by peer]
dstzd_ has joined #asahi-dev
dstzd_ is now known as dstzd
dstzd_ has joined #asahi-dev
dstzd has quit [Ping timeout: 264 seconds]
dstzd_ is now known as dstzd
CalumK has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qyousef1 has joined #asahi-dev
qyousef1 has quit [Client Quit]
qyousef has quit [Ping timeout: 256 seconds]
CalumK has joined #asahi-dev
furkan has joined #asahi-dev
qyousef has joined #asahi-dev
qyousef has quit [Client Quit]
qyousef has joined #asahi-dev
mogery has joined #asahi-dev
frode_0xa has joined #asahi-dev
<yrlf> currently debugging a crash of the clang build of m1n1; what is a sensible value of the address of boot_args? knowing if that address still makes sense or if it already broke before that is useful
<j`ey> (as a last resort, you could look in the streams)
<j`ey> 0x8056280000
<j`ey> I think
frode_0xa has quit [Quit: leaving]
<yrlf> yeah, I thought to look in there, but haven't found a convenient moment yet. thanks :)
<yrlf> yeah, so then that's probably what's wrong: 0x10020 is not a good boot_args address xD
<j`ey> no that doesnt look right :-)
<j`ey> btw someone posted some patches for clang.. unless that was you?
<j`ey> yrlf: and I assume you have a gcc build working?
<yrlf> yes, that's my patch. I don't have an M1, so I'm effectively reversing this with a crash log and binary sven got from marcan
<yrlf> *svenpeter
<sven> same person :-P
<sven> just once from matrix and once from irc
<sven> i've built the binary, it blackscreened on my mba
<sven> and then at least we got some crash log
<yrlf> I already found one weirdness: the clang assembler doesn't understand '\r' and writes a literal 'r' instead
furkan has quit [Remote host closed the connection]
<j`ey> weird, because boot_args just looks passed along
<j`ey> yrlf: uh, x9 is a callee-saved register
<j`ey> yrlf: can you get the objdump of the clang built binary, or at least just the asm for the apply_reloc function
<j`ey> ***calller-saved register
<sven> hah, nice find. 8f3c: 29 84 41 f8 ldr x9, [x1], #24
<sven> (that's inside apply_reloc)
<j`ey> so change that x9 to x19
<sven> *apply_rela
<sven> yeah
<j`ey> i dont want to create a pr (long story, employer etc), but I wouldnt mind a spotted by credit or something :P
<yrlf> in the meantime, I found the LLVM bug:
<yrlf> case for '\\r' is missing here
<yrlf> nice find j`ey!
<yrlf> sven, do you wanna write the PR, or should I just push that fix as another commit on the clang branch?
<sven> go ahead, i have to run some errands right now anyway
<yrlf> just niced, x10 is also used accross the apply_rela call
<yrlf> *noticed
mindentropy has joined #asahi-dev
<sven> probably should fix that as well :)
<j`ey> ah nice, so your base is probably off by a bit too!
<j`ey> (oh well, dunno if apply_rela is actually using x10..)
<sven> not right now, but it might if something in the compiler changes
<yrlf> I pushed the fixes to the clang branch :)
<yrlf> woops, forgot signoff, one moment
<yrlf> should be fine now :)
<marcan> this is my arm32 calling convention leaking :p
<marcan> nice catch
<marcan> that worked... once
<marcan> something makes it explode on a re-chainload
<sven> that's progress at least :D
<marcan> TTY> PC: 0x809d3568c (rel: 0x809d3568c)
<marcan> that looks *really* wrong :D
<yrlf> that "relative" address looks broken
<yrlf> sven: thx :D
<marcan> $ python shell.py
<marcan> Base at: 0x0
<marcan> yeah it has no idea where it is
<marcan> relocations are broken
<marcan> I'm surprised it gets this far without that :D
<marcan> check the rela section between gcc and clang
<yrlf> yeah, for some reason the relocation for base doesn't actually exist. like, what?
<yrlf> I'll dig through print_regs and see whatever the hell clang produced there
<marcan> maybe the linker symbols do not have relocations emitted for some reason?
<yrlf> relocations do exist, but, for some reason, it looks like clang or lld decided to use the _vectors_start relocation for base as well
<yrlf> oh.
<yrlf> _base isn't actually defined anywhere
<yrlf> it's just declared, and clang gets confused and just puts it somewhere
<yrlf> oh, woops, that's a linker script symbol
<yrlf> my bad
<yrlf> huh, so I guess it's time to understand how that "get my own base address" hack works portably then
<yrlf> okay, I think I found a way to fix it
<bastilian> If I were interested in testing Asahi at some point, like tooling, early builds and help validate bug reports, etc. In addition to a dedicated Apple Silicon test machine, what other hardware/devices would be helpful to do that?
<yrlf> it seems LLD thinks all symbols in the linker script defined outside of the SECTIONS block are absolute apparently
<yrlf> the relocation resolves correctly in binaryninja now, for both GCC and clang
superk has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mogeryy has joined #asahi-dev
Esmil has quit [Ping timeout: 256 seconds]
Esmil has joined #asahi-dev
mogery has quit [Ping timeout: 256 seconds]
mogeryy is now known as mogery
<marcan> yrlf: btw, I know I need to reply to your PR but tl;dr what you're doing all looks good to me, keep it up
<marcan> I've resolved to properly fix my sleep schedule starting this week, so I'll review tomorrow :)
<yrlf> no problem :) Thanks a lot for the testing assistance with the crash logs as well :)
<marcan> np, feel free to throw more binaries at me. takes me 5 seconds to reload and give you a dump
CalumK has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
<yrlf> woohoo! clang-built m1n1 works!
CalumK has joined #asahi-dev
<sven> :-)
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
<mogery> \o/
modwizcode has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Shiz> nice!
q3k|m has quit [Ping timeout: 264 seconds]
q3k|m has joined #asahi-dev
mindentropy has quit [Quit: Leaving]
crafteck[m] has joined #asahi-dev
CalumK has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
modwizcode_ has joined #asahi-dev
modwizcode has quit [Ping timeout: 256 seconds]
modwizcode_ is now known as modwizcode
CalumK has joined #asahi-dev
CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
CalumK has joined #asahi-dev
CalumK has quit [Client Quit]
acelogic has joined #asahi-dev
mogery has quit [Quit: Leaving]
ewlsh[m] has joined #asahi-dev
irl25519 has joined #asahi-dev
irl25519 has quit [Quit: irl25519]
irl25519 has joined #asahi-dev
DarthCloud has quit [*.net *.split]
DarthCloud has joined #asahi-dev
irl25519 has quit [Quit: irl25519]
<Shiz> product-description = "Mac mini (M1, 2020)";
<Shiz> allow-32bit-apps = <0x1>;
<Shiz> compatible-device-fallback = "iPad8,6";
<Shiz> interesting things from the devicetree
<Shiz> graphics-featureset-class = "APPLE7";
<Shiz> compatible-app-variant = "MacFamily20,1";
yrlf has quit [Quit: The Lounge - https://thelounge.chat]
yrlf has joined #asahi-dev
<rockinrobstar[m]> bastilian: if you want to play around with m1n1 before framebuffer support you will need a USB C UART breakout that supports the Apple VDM PD commands. Details in the wiki
<j`ey> rockinrobstar[m]: framebuffer is supported, but communicating to m1n1 is only UART
<j`ey> (for now)
<rockinrobstar[m]> yeah, was meaning as a full interactive console - still need to fix usb for hid etc before that can happen :-)
yrlf2 has joined #asahi-dev
Esmil has quit [Ping timeout: 256 seconds]
Esmil has joined #asahi-dev
yrlf has quit [Read error: Connection reset by peer]
<bastilian> rockinrobstar: Thank you! I was already looking into that a bit, is the wiring the one mentioned in the vdmtool repo with using an Arduino? I'll also get a hdmi capture card that will allow to see something in any case.
yrlf2 is now known as yrlf
<rwhitby> bastilian: yes, that's what marcan is using (Arduino and FUSB302). if you have any USB-PD VDM questions, I can help too. I don't use the same setup as marcan but I'm using USB-PD messages from a different proprietary card to explore the interface.
<bastilian> Nice! Thank you rwhitby!
<rwhitby> bastilian: https://gist.github.com/rwhitby/b98254e84ae402e87a25c6b981303511 is where I'm at so far
<rwhitby> Next I'm going to explore the external debug I2C interfaces to the PD controllers.
<rwhitby> be aware the UART interfaces are 1.2V