#
…

2021-02-03

00:07amwmarcan: I cloned the docs-wiki git but permission denied when I tried pushing it
00:07amwmarcan: I cloned it and pushed it to my own git repository: git@github.com:amworsley/asahi-wiki.git
00:08amwIt just has a /images/qemu-boot.png image
00:09amwcdesai: git lfs is available on debian - I haven't enabled it on my repositories yet - any downsides to this?
00:11amwmarcan: Would git lfs - https://git-lfs.github.com/ be acceptable for some binary blobs such as m1n1 / kernel builds?
00:40acelogic has joined #asahi-dev
00:57Namidairothe problem is the insanely small bandwidth limits for lfs on github
00:58Namidairoit may be better to just have something automated like a github action and put it into releases
00:59davidrysk[m]amw: I concur with Namidairo. lfs is not a great idea because you don't want the releases in the repo proper, and lfs puts them there
01:00bastilianamw: There is also a simple trick to get images hosted on github: https://github.com/RWTH-EBC/AixLib/wiki/How-to:-Add-images-to-the-Wiki I think it should also work for Gists.
01:01bastilians/for/with/
01:01Namidairothe threshold for when lfs is mandated there is high anyway, >100mb size on individual files
01:17bastilianHm. I tried the macvdmtool, but I can't seem to be able to get the target to boot into serial, it just boots normally as far as I can see.
01:24vafanlignardebastilian: see #asahi about 5h30m ago. there's no serial output by default.
01:31bastilianAh, i missed that part.
02:18vafanlignardei tried 'macvdmtool serial' with actions 0x206 and 0x304 on an MBA'18 where i had done 'csrutil enable --without nvram;nvram boot-args="-v debug=0x8 serial=1 serialbaud=115200"' (recovery os). nothing showed up on my m1's debug-console. figured it could be worth a try at least. :)
02:20davidrysk[m]vup2: I played with it a little on a MBP '19, the key is wrong
02:20davidrysk[m]unlock key derivation rather
02:20vafanlignarde(https://git.io/JtEHe has a short list of what VDM get action list and actions info report on the apple devices I have)
02:22vafanlignardedavidrysk[m]: sorry for the confusion. i actually ran macvdmtool on the m1 (which was connected to the MBA'18 via cable). but that's interesting, does that mean that it might be possible to get macvdmtool running on non-m1 hardware too?
02:23davidrysk[m]vafanlignarde: I think it might be possible to get it running on T2 hardware. Not sure with what features, and not sure about T1
02:24davidrysk[m]vafanlignarde: when running on the M1, it does successfully reboot the T2 machine
02:25davidrysk[m]vafanlignarde: how are you extracting those actions?
02:29vafanlignardedavidrysk[m]: sounds cool. the reboot action just powers off my MBP'17 and MBA'18 (not sure if they're T1 or T2; neither have touchbar).
02:30davidrysk[m]sounds like T2
02:30vafanlignardedavidrysk[m]: https://git.io/JtBD7 (essentially asahilinux/vdmtool but for an USB-PD trigger device which had an FUSB302 onboard and for which an OSS firmware existed)
02:31davidrysk[m]oh nice. (I don't have a FUSB302)
02:34vafanlignardei've looked around but I haven't found anything that comes with both an FUSB302 and the Type-C D+/- or SBU1/2 pins broken out.. but at least those USB-PD triggers and type-c breakout boards are easy (albeit slow) to source
02:34rafaelmartins has quit [Ping timeout: 256 seconds]
02:49rafaelmartins has joined #asahi-dev
02:49KindOne has quit [Ping timeout: 272 seconds]
03:00davidrysk[m]yeah I think that's what marcan was wanting to make
03:02amwbastilian: Add image to SW:Linux page - from my github repository - seemed simplest
03:06vafanlignardedavidrysk[m]: returning zero from GetUnlockKey() makes the code print "Unlocking: OK". not sure if that means it does succeed in unlocking it or not.. it however fails to both enter and exit 'DBMa' mode on the MacbookAir8,1. I also tried using the board IDs from https://www.theiphonewiki.com/wiki/T8012 as unlock keys with no success.
03:27davidrysk[m]vafanlignarde: I'll have to mess around with it some more.
03:27davidrysk[m]Turns out I have only one data-capable USB-C cable handy :/
03:28PhilippvK has quit [Ping timeout: 260 seconds]
03:28phiologe has joined #asahi-dev
03:32vafanlignardefrom the reference manual regarding the LOCK command: https://imgur.com/a/njMfl1d
03:44dibas has quit [Ping timeout: 272 seconds]
03:48marcanamw: I don't think we want to use git-lfs here
03:48marcanm1n1/kernel builds are what github releases are for
03:49marcanvafanlignarde: I think you might be able to get serial *for the T2* on those macs this way
03:49marcannot for the intel :)
03:50marcanwrong serial port :p
03:51marcanvafanlignarde: zero is locked
03:51marcanif you make the key zero it'll "succeed" in not-unlocking
03:51marcanthe code kind of assumes you're trying to actually unlock the thing, not re-lock it :)
03:52marcantry 'CST1'
03:56davidrysk[m]CST1 seems to unlock it once I swap it (char deviceName[5] = "1TSC";)
03:57davidrysk[m]DBMa mode does not seem to work
03:57marcanyeah, I heard that might not work
03:57qyousef has quit [Ping timeout: 256 seconds]
03:57marcanfrom M1 source to T2 target, you can also try changing the target action to 0x301 (0x1840306 -> 0x1840301 in DoSerial, just the first instance)
03:58marcanwe don't know what 301 is, but it smelled like it could be another serial
03:58marcanthere is also 303, which is on *both* ports on those. worth trying that one on both ports probably
03:59davidrysk[m]"source" is the machine running macvdmtool?
03:59davidrysk[m]I'm trying T2 source -> M1 target
03:59marcanyou might need to undo the old actions first if the "exit conflicting modes" feature gets confused (0x2040306 = unmap)
03:59davidrysk[m](since I'm more interested in messing with the M1)
03:59marcanyeah I'm talking to vafanlignarde
03:59qyousef has joined #asahi-dev
04:02marcanyeah sorry, I was replying to two people at once :)
04:25qyousef has quit [Ping timeout: 240 seconds]
04:27qyousef has joined #asahi-dev
04:29dibas has joined #asahi-dev
04:29dibas has joined #asahi-dev
04:30Namidairo has quit [Read error: Connection reset by peer]
04:30Namidairo has joined #asahi-dev
04:30odmir has quit [Remote host closed the connection]
04:31odmir has joined #asahi-dev
04:35odmir has quit [Ping timeout: 240 seconds]
04:38dibas has quit [Remote host closed the connection]
04:39dibas has joined #asahi-dev
04:39dibas has joined #asahi-dev
05:02odmir has joined #asahi-dev
05:21odmir has quit [Ping timeout: 258 seconds]
05:21acelogic has quit [Remote host closed the connection]
05:23acelogic has joined #asahi-dev
05:24awordnot has quit [Ping timeout: 256 seconds]
05:33odmir has joined #asahi-dev
05:45odmir has quit [Ping timeout: 240 seconds]
05:58awordnot has joined #asahi-dev
06:06amwmarcan: Just sent you an email about latest m1n1 proxyclient change causing qemu serial port loading failures
06:15acelogic has quit [Remote host closed the connection]
06:17marcanamw: try increasing the uart.timeout = 0.15
06:17marcanI tried to keep that short because otherwise it makes script startup slow and for real hardware it should be enough
06:23amwmarcan: I switched the one in the try from 0.15 back to 3 and it seems reliable now
06:25VinDuv has joined #asahi-dev
06:25amwmarcan: I dropped it back to 1 and it worked 5 times out of 5
06:28amwmarcan: I changed it down to .6 and the first two attempts fail then worked for several in a row
06:28amwMore tests had it work 4 times in a row and then fail with proxy.UartCMDError: Reply command mismatch: Expected 0x01aa55ff, got 0x00aa55ff
06:29amwSo some where between .6 and 1 for uart.timeout in the try?
06:30marcanseems like qemu is just slow somehow?
06:30marcanmaybe the serial/tty code in qemu has some kind of timeout condition?
06:31amw.8 gave 2 failures in about 10+ tries (2 in a row so perhaps one failure led to the next...)
06:31marcanit smells like somewhere along the way there is a polling loop
06:32amwJust got 10 out of 10 at .8 from a fresh qemu start up... Yep better let modcodewiz know
06:33odmir has joined #asahi-dev
06:39odmir has quit [Ping timeout: 240 seconds]
07:23VinDuv has quit [Quit: Leaving.]
07:39amw has quit [Ping timeout: 240 seconds]
08:09sumoon[m] has left #asahi-dev ["User left"]
08:10jn__ has quit [Ping timeout: 272 seconds]
08:13jn__ has joined #asahi-dev
08:43amw has joined #asahi-dev
09:10amw has quit [Quit: WeeChat 2.3]
09:11zkrx has quit [Ping timeout: 240 seconds]
09:20amw has joined #asahi-dev
09:26KindOne has joined #asahi-dev
09:32Mary_ has quit [Quit: Bye!]
09:41zkrx has joined #asahi-dev
09:42Mary_ has joined #asahi-dev
10:02amw has quit [Quit: WeeChat 2.3]
10:07amw has joined #asahi-dev
10:11vafanlignardemarcan: i see, thanks for the clarification. +1 on what davidrysk[m] wrote, return '1TSC' in GetUnlockKey() works on olders Macs (MacBookAir8,1; MacBookPro14,1; iMac19,1), DBMa does not.
10:19marcanyeah, so not very useful without DBMa...
10:46amw has quit [Ping timeout: 258 seconds]
10:56TomJepp has quit [Ping timeout: 272 seconds]
10:56TomJepp has joined #asahi-dev
11:19bastilianIs there a document somewhere describing how to install m1n1? I assume it is, compiling it and configure it as boot via kmutil, or is there more to it?
11:29zkrx has quit [Ping timeout: 256 seconds]
11:46zkrx has joined #asahi-dev
12:22Glanzmannbastilian: If you find it, let me know. I ordered a mac mini m1 in order to try vdmtool. Look forward to try it out.
12:25bastilianGlanzmann: sure. I'm gonna dig into later after work. I guess it should be just that, and probably "blessing" the compiled mach file, but there might be more to it.
12:57GlanzmannI assume so. Same instructions as with corelliumhq but with the m1n1.
12:58GlanzmannIt would also be super interesting to have a kernel tree with the correlliumhq drivers. I have not tried them, but according to their twitter post they have most of the essential hardware running (ssd, touchpad, keyboard, network card, wifi).
12:59j`eyGlanzmann: they have their kernel tree on github?
13:01acelogic has joined #asahi-dev
13:11_jannau_https://github.com/corellium/linux-m1 kernel is not compatible with m1ni but requires preloader-m1. works self compiled on a mac mini (my last update was a week ago though)
13:28Glanzmannj`ey: I thought they're no publishing the drivers, don't they?
13:28j`eyGlanzmann: yes, and you can view the source on github ^
13:28GlanzmannSo maybe we can do a kernel that is compatible with m1n1 and has all the drivers.
13:29GlanzmannProbably marcan will do that anyway.
13:30j`eydont think he's interested in their tree/kernel
13:32marcanbastilian: I'm writing something
13:33bastilianmarcan: WOOHOOO! Thank you!
13:34marcanI mentioned this on -re already, but the corellium kernel is developed via binary reverse engineering, which means I will not merge anything from it blindly; it needs to be audited since they are not open about their development process and they have not earned my confidence
13:34marcanbbl, got some errands to deal with
14:30odmir has joined #asahi-dev
14:50modwizcodeamw: yes I forgot to mention that I have local timeout adjustments (although the linux loader didn't need adjustments). Tbh the adjustments aren't needed at all now that I enable the FIFO by default in qemu and fixed it from being totally broken.
14:51KindOne has quit [Ping timeout: 256 seconds]
14:51modwizcodeI'm surprised you had to fuss with it but it's possible I never tested again with the current timeouts, and if it didn't work I'd just rerun the commands
14:59odmir has quit [Remote host closed the connection]
15:00odmir has joined #asahi-dev
15:37Bluerisemarcan: how do I change the usb debug command to use a different pinset? 840306 is SBU1/2?
15:39marcanBluerise: 4 is the pinset
15:39marcanit's a bitfield, 1/2/4
15:39marcan#pin-sets
15:40BlueriseYeah, I saw that, but I didn't see any text telling me which bit is which pinset
15:40marcan1<<pinset
15:40marcancaveat emptor: if you're thinking of using this for serial, note that standard cables crossover SBU1/2 but not D+/D-
15:40marcanso direct serial will only ever work with SBU1/2
15:41BlueriseI have a breakout... but SBU1/2 don't work depending on the orientation of the cable... I'm testing it with ... uhm... you know, connection tester
15:42marcanthe orientation of the cable is compensated for on the mac side, but presumably not on your board side
15:42marcanorientation again swaps SBU1/2
15:43BlueriseWell, what I tried was: connecting two breakout boards to the same cable
15:43Blueriseand check if sbu1 on one breakout board connects to sbu2 on the other
15:43marcanthen yes, flipping either side will flip the connection
15:43Blueriseyeah, but the weird thing is when I flipped it, I only got SBU1 connected, but SBU2 connected nowhere
15:44marcanand the other way you got both?
15:44marcanthen a cable or connector is dodgy
15:44Blueriseit was a 30-40 euro cable from belkin :P
15:44Bluerisewill have a look.
15:44marcan*40* euro cable?
15:45marcanwhat is it, thunderbolt++?
15:45davidrysk[m]modwizcode: would be worth mentioning which port Apple says is the dfu port since it differs
15:45Bluerisemarcan: yes
15:46Bluerisethe more expensive, the better, right? ;)
15:51acelogic has quit [Remote host closed the connection]
15:54acelogic has joined #asahi-dev
15:56davidrysk[m]Bluerise: it's complicated :P
15:56davidrysk[m]some of the more expensive thunderbolt cables are active and we don't want that :p
15:56BlueriseAh, right.
15:57BlueriseYeah, I have two dumb ones here that should work as well
15:57Blueriseat least I'm rather sure they are dumb, because my employer wouldn't buy good ones :D
15:58davidrysk[m]just make sure they're data and not power-only
15:58davidrysk[m]most of my usbc cables are power-only :(
15:59BlueriseNah, those have data
15:59davidrysk[m]was trying to do data migration and was frustrated by it heh
15:59BlueriseI once had someone on a discord who went through three power-only microUSB cables
15:59Bluerisethe fourth cable he found finally had data. until then he blamed the hw :)
16:00Blueriseso either a) 1.8v serial can't read 1.2v serial data
16:00Blueriseb) I already shot my serial port
16:00Bluerisec) the data lines aren't connect properly
16:00Bluerised) the pinmuxing doesn't fit
16:00Bluerisee) my voltage divider doesn't work he
16:01Bluerisemarcan: when I use cu on /dev/tty.debug-console I get "couldn't enable hardwar eflow control"
16:01Bluerisethat's why you use picocom?
16:01Blueriseanything special I need to do to make picocom work?
16:01marcanI've only ever used picocom, no idea about anything else
16:01marcanbut you don't want hardware flow control
16:01modwizcodemarcan: speaking of picocom what omap and imap do you use for that? I always get weird newlines when I throw picocom on the pty for qemu
16:02marcanpicocom --omap crlf --imap lfcrlf
16:03Bluerisepatrick@mone:~/work/github/macvdmtool$ sudo picocom -q --omap crlf --imap lfcrlf -b 115200 /dev/tty.debug-console
16:03Bluerisethat should do?
16:04BlueriseI'm booting a copy of m1n1 you gave me... nothing :(
16:04BluerisePutting target into serial mode... OK
16:04BluerisePutting local end into serial mode... OK
16:04BlueriseExiting DBMa mode... OK
16:06jamadazi has joined #asahi-dev
16:07marcanBluerise: do the reset serial thing if you want to see debug output
16:07marcanotherwise the timing will be messed up, you will either enable serial after the startup messages are already sent, or before a reset that breaks it
16:07marcanthis is with two M1s?
16:07Bluerisem1 air and m1 mini
16:08Blueriseshould i see prints frim iboot?
16:08marcanjust m1n1
16:09marcanmake sure you are connecting on the DFU ports
16:10Bluerisethat works.
16:10BlueriseI see, m1n1 prints something and then goes into proxy mode
16:10Blueriseso there's no prompt, ok
16:10marcanit will reacts to proxy messages
16:10marcanbut ignore everything else
16:10marcanthere is no CLI for humans, for that you have shell.py :p
16:10Blueriseat least I know I'm still getting output
16:11Bluerisegood sign ;)
16:11marcanfor the proxyclient, get python3.9 from homebrew
16:11marcansomething about readline history is broken in the macos 3.8
16:11marcanthen pip3.9 install --user pyserial construct
16:19BlueriseI wonder if my FTDI isn't well enough to recv on 1.2V
16:20Blueriseset to 1.8V, but,.. hm
16:20vimal has quit [Remote host closed the connection]
17:40KindOne has joined #asahi-dev
17:40VinDuv has joined #asahi-dev
17:49taziden has quit [Ping timeout: 272 seconds]
17:58taziden has joined #asahi-dev
18:29Bluerisemarcan, kettenis: ok, one reason is that the HW I got cannot cope with 1.2V
18:30BlueriseI'm testing the voltage divider circuit with the mUART + that 1.8V serial I bought
18:30Blueriseif I use the mUART to send 1.8V TX through the voltage divier, the 1.8V serial can't read it
18:31Blueriseif I use the 1.8V serial to send to the mUART, the mUART can read it
18:31davidrysk[m]fwiw I've found homebrew to be full of bugs on M1; if you have it in /usr/local that's the Rosetta version. I switched back to MacPorts.
18:31Blueriseso I guess I have something to send back to Amazon...
18:31Bluerisedavidrysk[m]: heh, yes, so far they told everyone to use the rosetta version
18:31BlueriseI'm using the native one
18:32davidrysk[m]I tried it, but it has way more bugs than MacPorts
18:32davidrysk[m]I had both installed for a time but I got tired of dealing with the bugs and just ditched it
18:34zkrx has quit [Ping timeout: 240 seconds]
18:46marcanI'm just using the rosetta version, no issues so far
18:47marcanI just alias x86=arch -x86_64
18:47marcanx86 brew install foo etc
19:00zkrx has joined #asahi-dev
19:38mxw39 has joined #asahi-dev
20:11vimal has joined #asahi-dev
21:49Bluerisemarcan: have a solution for the uart. the "bad" 1.8V uart provides 1.8V as reference to the mUART. mUART does TX/RX. That works well
21:49Blueriseunfortunately I only have one uart, but since I have two M1s I'll just ship that muart to kettenis
21:49Blueriseyeah, one usb2serial to provide 1.8V, the other one to do the work lol
21:50jn__with two M1s — is macvdmtool an option?
21:54j`eyjn__: ounds like kettenis doesnt have 2, so theyre getting the muart!
21:57jn__ah, i missed that part of the conversation
21:59BlueriseYeah, exactly. I have one that I ordered to replace my 12" Macbook, that I use with OSX
21:59Blueriseand that I don't want to kill :)
22:00Blueriseso I can connect those two.
22:05VinDuv has quit [Quit: Leaving.]
22:22zkrx has quit [Ping timeout: 246 seconds]
23:07zkrx has joined #asahi-dev
23:57amw has joined #asahi-dev
…