#
…

2021-01-17

00:36acelogic has joined #asahi-dev
01:07Shizafter a bunch of silly bit twiddle debugging, to-adt now works and roundtrips successfully :)
01:27Shiz~/d/m/img4 ❯❯❯ ./dt.py find devtree_after_iboot.bin name=wdt
01:27Shiz/arm-io/wdt
01:27Shiz~/d/m/img4 ❯❯❯ ./dt.py regs devtree_after_iboot.bin /arm-io/wdt
01:27Shiz0x23d2b0000 16384
01:27Shizwith new useful subcommands
01:28j`ey /arm-io/aic pls
01:31j`eyShiz: that repo is self contained right? no pip or whatever
01:31Shizgit clone --recursive is all you need for dt.py
01:31Shizimg4.py needs asn1parse
01:31Shizasn1crypto*
01:32j`eyis that a python thing
01:32Shizit's also in requirements.txt :p
01:32Shizbut again, not needed for just dt.py
01:35acelogic has quit [Ping timeout: 246 seconds]
01:39dstzd has quit [Quit: ZNC - https://znc.in]
01:42dstzd has joined #asahi-dev
02:32qyousef has quit [Ping timeout: 256 seconds]
03:01qyousef has joined #asahi-dev
03:04qyousef1 has joined #asahi-dev
03:07qyousef has quit [Ping timeout: 272 seconds]
03:08qyousef1 has quit [Client Quit]
03:08qyousef has joined #asahi-dev
03:10qyousef has quit [Client Quit]
03:11qyousef has joined #asahi-dev
03:30tbodt has quit [Ping timeout: 256 seconds]
03:31tbodt has joined #asahi-dev
03:41mindentropy has joined #asahi-dev
04:00_whitelogger has joined #asahi-dev
04:39_whitelogger has joined #asahi-dev
05:24_whitelogger has joined #asahi-dev
05:53krzywix has joined #asahi-dev
06:08Shizdt gained a few more useful functions (chief among 'show'), should be somewhat ready for actual usage now
06:10marcanShiz: I wonder if we should build our tooling on git
06:10marcanadt->fdt tree, plus real-fdt tree
06:10marcancherry-pick changes
06:11Shizwhat i do internally right now is convert everything to ADT because it's simpler
06:11Shizhave you seen the diff output? it's rather git-ish :p
06:15Shizmarcan: so dt.py can export to dts, i figure we could just use that in combination with git :)
06:15Shizmuch easier to cherry-pick than fdt
06:18clayfreemandoes dtc(1) always output in big endian? might cause issues with comparisons unless you compensate for that
06:18clayfreemanI think I remember the bin marcan posted being LE
06:20sirn has quit [Ping timeout: 260 seconds]
06:20sirn has joined #asahi-dev
06:22Shizclayfreeman: i do compensate for that
06:22ShizApple device trees are little-endian
06:23ShizFlattened device trees (dtb/fdt) are big-endian
06:23Shizas per the spec
06:23clayfreemanah, excellent!
06:26Shizthere 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
06:33clayfreemanI might try to implement to_fdt if I get some free time
06:33clayfreemanopened a small PR for a typo that breaks regs
06:34Shizah whoops, merged
06:35Shizto_fdt is rather annoying as a fair warning :) you might get wrapped up in the struct library, hehe
06:35Shizfeel free to ping me anytime about it
06:36clayfreemanIf to_fdt can be done, then we could use dtc(1) to convert the dtb to dts and vice-versa
06:37Shizit already supports dts output
06:37Shizsee the `to-src` command :)
06:37clayfreemantrue, but it's less code ownership that you have to worry about
07:54acelogic has joined #asahi-dev
08:00Necrosporus has quit [Killed (verne.freenode.net (Nickname regained by services))]
08:00Necrosporus has joined #asahi-dev
08:04Esmil has quit [Ping timeout: 256 seconds]
08:04Esmil has joined #asahi-dev
08:22CalumK has joined #asahi-dev
08:30_whitelogger has joined #asahi-dev
09:26marcanShiz: yeah sorry, I meant dts
09:26marcannot fdt of course
09:34VinDuv has joined #asahi-dev
09:36rwhitby has quit [Ping timeout: 264 seconds]
09:38rwhitby has joined #asahi-dev
09:44CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:44CalumK has joined #asahi-dev
09:44CalumK has quit [Client Quit]
09:45CalumK has joined #asahi-dev
09:45CalumK has quit [Client Quit]
09:46CalumK has joined #asahi-dev
09:46CalumK has quit [Client Quit]
09:47CalumK has joined #asahi-dev
09:47CalumK has quit [Client Quit]
09:47CalumK has joined #asahi-dev
09:48CalumK has quit [Client Quit]
09:48CalumK has joined #asahi-dev
09:48CalumK has quit [Client Quit]
09:49CalumK has joined #asahi-dev
09:49CalumK has quit [Client Quit]
09:50CalumK has joined #asahi-dev
09:50CalumK has quit [Client Quit]
10:12mindentropy has quit [Quit: Leaving]
10:13dstzd has quit [Quit: ZNC - https://znc.in]
10:15dstzd has joined #asahi-dev
10:15dstzd has quit [Client Quit]
10:16dstzd has joined #asahi-dev
10:18dstzd has quit [Client Quit]
10:19dstzd has joined #asahi-dev
10:21dstzd has quit [Client Quit]
10:21dstzd has joined #asahi-dev
10:22acelogic has quit [Ping timeout: 246 seconds]
10:24dstzd has quit [Read error: Connection reset by peer]
10:24dstzd_ has joined #asahi-dev
10:25dstzd_ is now known as dstzd
10:26dstzd_ has joined #asahi-dev
10:30dstzd has quit [Ping timeout: 264 seconds]
10:30dstzd_ is now known as dstzd
11:10CalumK has joined #asahi-dev
11:23CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:48qyousef1 has joined #asahi-dev
11:49qyousef1 has quit [Client Quit]
11:51qyousef has quit [Ping timeout: 256 seconds]
11:56CalumK has joined #asahi-dev
11:59furkan has joined #asahi-dev
12:03qyousef has joined #asahi-dev
12:06qyousef has quit [Client Quit]
12:07qyousef has joined #asahi-dev
12:34mogery has joined #asahi-dev
13:09frode_0xa has joined #asahi-dev
13:41yrlfcurrently 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
13:42j`ey(as a last resort, you could look in the streams)
13:44j`ey0x8056280000
13:44j`eyI think
13:49frode_0xa has quit [Quit: leaving]
13:54yrlfyeah, I thought to look in there, but haven't found a convenient moment yet. thanks :)
13:54yrlfyeah, so then that's probably what's wrong: 0x10020 is not a good boot_args address xD
13:55j`eyno that doesnt look right :-)
13:55j`eybtw someone posted some patches for clang.. unless that was you?
13:55j`eyyrlf: and I assume you have a gcc build working?
13:56yrlfyes, 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
13:56yrlf*svenpeter
13:57svensame person :-P
13:57svenjust once from matrix and once from irc
13:57sveni've built the binary, it blackscreened on my mba
13:57svenand then at least we got some crash log
13:57yrlfI already found one weirdness: the clang assembler doesn't understand '\r' and writes a literal 'r' instead
13:59furkan has quit [Remote host closed the connection]
14:00j`eyweird, because boot_args just looks passed along
14:05j`eyyrlf: uh, x9 is a callee-saved register
14:05j`eyyrlf: can you get the objdump of the clang built binary, or at least just the asm for the apply_reloc function
14:05j`ey***calller-saved register
14:06svenhah, nice find. 8f3c: 29 84 41 f8 ldr x9, [x1], #24
14:06sven(that's inside apply_reloc)
14:06j`eyso change that x9 to x19
14:06sven*apply_rela
14:07j`eyi dont want to create a pr (long story, employer etc), but I wouldnt mind a spotted by credit or something :P
14:09yrlfin the meantime, I found the LLVM bug:
14:09yrlfcase for '\\r' is missing here
14:10yrlfnice find j`ey!
14:11yrlfsven, do you wanna write the PR, or should I just push that fix as another commit on the clang branch?
14:12svengo ahead, i have to run some errands right now anyway
14:14yrlfjust niced, x10 is also used accross the apply_rela call
14:14yrlf*noticed
14:14mindentropy has joined #asahi-dev
14:14svenprobably should fix that as well :)
14:14j`eyah nice, so your base is probably off by a bit too!
14:15j`ey(oh well, dunno if apply_rela is actually using x10..)
14:15svennot right now, but it might if something in the compiler changes
14:18yrlfI pushed the fixes to the clang branch :)
14:18yrlfwoops, forgot signoff, one moment
14:21yrlfshould be fine now :)
14:21marcanthis is my arm32 calling convention leaking :p
14:22marcannice catch
14:22marcanthat worked... once
14:23marcansomething makes it explode on a re-chainload
14:23sventhat's progress at least :D
14:23marcanTTY> PC: 0x809d3568c (rel: 0x809d3568c)
14:23marcanthat looks *really* wrong :D
14:24yrlfthat "relative" address looks broken
14:24yrlfsven: thx :D
14:24marcan$ python shell.py
14:24marcanBase at: 0x0
14:24marcanyeah it has no idea where it is
14:24marcanrelocations are broken
14:24marcanI'm surprised it gets this far without that :D
14:24marcancheck the rela section between gcc and clang
14:36yrlfyeah, for some reason the relocation for base doesn't actually exist. like, what?
14:36yrlfI'll dig through print_regs and see whatever the hell clang produced there
14:47marcanmaybe the linker symbols do not have relocations emitted for some reason?
14:49yrlfrelocations do exist, but, for some reason, it looks like clang or lld decided to use the _vectors_start relocation for base as well
14:49yrlf_base isn't actually defined anywhere
14:49yrlfit's just declared, and clang gets confused and just puts it somewhere
14:51yrlfoh, woops, that's a linker script symbol
14:51yrlfmy bad
14:53yrlfhuh, so I guess it's time to understand how that "get my own base address" hack works portably then
15:03yrlfokay, I think I found a way to fix it
15:06bastilianIf 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?
15:06yrlfit seems LLD thinks all symbols in the linker script defined outside of the SECTIONS block are absolute apparently
15:15yrlfthe relocation resolves correctly in binaryninja now, for both GCC and clang
15:21superk has joined #asahi-dev
15:59CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:02mogeryy has joined #asahi-dev
16:05Esmil has quit [Ping timeout: 256 seconds]
16:05Esmil has joined #asahi-dev
16:05mogery has quit [Ping timeout: 256 seconds]
16:06mogeryy is now known as mogery
16:42marcanyrlf: 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
16:42marcanI've resolved to properly fix my sleep schedule starting this week, so I'll review tomorrow :)
16:43yrlfno problem :) Thanks a lot for the testing assistance with the crash logs as well :)
16:45marcannp, feel free to throw more binaries at me. takes me 5 seconds to reload and give you a dump
16:57CalumK has joined #asahi-dev
17:12CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:12CalumK has joined #asahi-dev
17:12CalumK has quit [Client Quit]
17:13CalumK has joined #asahi-dev
17:13CalumK has quit [Client Quit]
17:14CalumK has joined #asahi-dev
17:14CalumK has quit [Client Quit]
17:14CalumK has joined #asahi-dev
17:15CalumK has quit [Client Quit]
17:15CalumK has joined #asahi-dev
17:15CalumK has quit [Client Quit]
17:16CalumK has joined #asahi-dev
17:16CalumK has quit [Client Quit]
17:17yrlfwoohoo! clang-built m1n1 works!
17:17CalumK has joined #asahi-dev
17:17CalumK has quit [Client Quit]
17:19CalumK has joined #asahi-dev
17:28modwizcode has joined #asahi-dev
17:44CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:08q3k|m has quit [Ping timeout: 264 seconds]
18:09q3k|m has joined #asahi-dev
18:25mindentropy has quit [Quit: Leaving]
18:37crafteck[m] has joined #asahi-dev
18:53CalumK has joined #asahi-dev
19:01CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:20modwizcode_ has joined #asahi-dev
19:22modwizcode has quit [Ping timeout: 256 seconds]
19:23modwizcode_ is now known as modwizcode
19:41CalumK has joined #asahi-dev
19:54CalumK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:54CalumK has joined #asahi-dev
19:54CalumK has quit [Client Quit]
19:55CalumK has joined #asahi-dev
19:55CalumK has quit [Client Quit]
19:56CalumK has joined #asahi-dev
19:56CalumK has quit [Client Quit]
19:57CalumK has joined #asahi-dev
19:57CalumK has quit [Client Quit]
19:57CalumK has joined #asahi-dev
20:00CalumK has quit [Client Quit]
20:23acelogic has joined #asahi-dev
21:19mogery has quit [Quit: Leaving]
21:28ewlsh[m] has joined #asahi-dev
21:38irl25519 has joined #asahi-dev
22:07irl25519 has quit [Quit: irl25519]
22:09irl25519 has joined #asahi-dev
22:16DarthCloud has quit [*.net *.split]
22:22DarthCloud has joined #asahi-dev
22:36irl25519 has quit [Quit: irl25519]
22:53Shiz product-description = "Mac mini (M1, 2020)";
22:53Shiz allow-32bit-apps = <0x1>;
22:53Shiz compatible-device-fallback = "iPad8,6";
22:53Shizinteresting things from the devicetree
22:53Shiz graphics-featureset-class = "APPLE7";
22:53Shiz compatible-app-variant = "MacFamily20,1";
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:01yrlf has joined #asahi-dev
23:07rockinrobstar[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
23:09j`eyrockinrobstar[m]: framebuffer is supported, but communicating to m1n1 is only UART
23:11j`ey(for now)
23:13rockinrobstar[m]yeah, was meaning as a full interactive console - still need to fix usb for hid etc before that can happen :-)
23:20yrlf2 has joined #asahi-dev
23:21Esmil has quit [Ping timeout: 256 seconds]
23:21Esmil has joined #asahi-dev
23:22yrlf has quit [Read error: Connection reset by peer]
23:22bastilianrockinrobstar: 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.
23:46yrlf2 is now known as yrlf
23:53rwhitbybastilian: 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.
23:57bastilianNice! Thank you rwhitby!
23:58rwhitbyNext I'm going to explore the external debug I2C interfaces to the PD controllers.
23:58rwhitbybe aware the UART interfaces are 1.2V
…