#
…

2021-01-05

03:51comex has joined #asahi-re
04:18_whitelogger has joined #asahi-re
05:27_whitelogger has joined #asahi-re
06:27JTL has quit [Quit: WeeChat 1.7.1]
07:38rwhitbymarcan: https://gist.github.com/rwhitby/c7547dfe648a2554ca9b337154d97e26 shows the action list responses for Alpine Ridge and Titan Ridge laptops. I updated https://github.com/AsahiLinux/docs/wiki/Hardware:USB-PD and will continue to add information as I explore the 0x11 and 0x12 responses. I need to acquire 1.2V UART capability before going further :-)
07:40marcan(writing some website docs now, will get back to hardware in a bit)
07:51rwhitbymarcan: Re: 0x012: Bit24: "Persist through soft reset. This doesn't seem to work on M1 Macs (the PD controller reboots when the system reboots)." - I think that's referring to a USB-PD Soft Reset rather than a system reboot (or am I misreading what you've written there?).
08:00rwhitbymarcan: are you familiar with the MIPI Narrow Interface for Debug and Test (MIPI NIDnT) https://www.mipi.org/specifications/nidnt ? It contains a structured VDM protocol for remapping debug pins on a Type-C connector. At first glance it doesn't seem to match here, but I'm wondering if any of the concepts have been reused, so thought you might be interested if you haven't seen it before.
08:12rwhitbyIn other news, it seems my 16" MacBook Pro has the same PD controller (CD3217B12) as the M1. So I will document it as well and see if they match.
09:04marcanrwhitby: that came from the t8021 guys, and they said it works on the Intel ones maybe? but I'm not sure tbh
09:05marcanI am not familiar with the MIPI thing, thanks, I'll take a look :)
09:05marcankeep in mind those controllers have a flashed firmware that overrides ROM methods, but I *think* Apple uses the same exact firmware for all Intel macs and probably the M1 ones too? only the parameter area varies for each Intel one
09:05marcanfor machines with the same chip I mean
09:06marcanI have the flash area decompiled, but it only overrides some hookable ROM functions, so it's hard to see the overall code flow, you only get what they added/redid
09:10rwhitbyThe PD controller firmware should be in an external SPI flash if it's the same as the regular TI devices. The TBT controller usually shares the flash.
09:34marcanrwhitby: the PD controller firmware on those TI devices is actually an internal OTP/ROM thing; the external SPI flash only loads *overrides* for the internal ROM code
09:35marcanTI's documentation is horrible on this whole thing, but that's how it actually works
09:35rwhitbyI see. Hmm.
09:35marcanbasically the SPI code gets loaded at a (hieously unaligned) SRAM offset, called, and it overrides function pointer table entries that the ROM uses. The ROM has thunks that call through those pointers to itself (initially), and the SRAM code has more thunks that call back into the ROM functions.
09:36marcanit's not hard to dump the ROM, you can use SWD on the chip pins or just flash some firmware that dumps the ROM out, but I haven't bothered to go there yet
09:36marcan(if we need to I will)
10:20rwhitbyHmm, it seems the information for a certain actionId is different on different devices.
10:21rwhitbyMacBookPro14,2 (Alpine Ridge):
10:21rwhitbySOP"_Debug Apple Unknown VDM Command (0x11) (02 05 00 00) | 8 bytes (11 81 AC 05 02 05 00 00)
10:21rwhitbySOP"_Debug Apple Unknown VDM Command (0x11) Ack (85 03 03 01, 00 00 00 00) | 12 bytes (51 80 AC 05 85 03 03 01 00 00 00 00)
10:21rwhitbyMacBookPro15,2 (Titan Ridge):
10:21rwhitbySOP"_Debug Apple Unknown VDM Command (0x11) (02 05 00 00) | 8 bytes (11 81 AC 05 02 05 00 00)
10:21rwhitbySOP"_Debug Apple Unknown VDM Command (0x11) Ack (03 01 01 05, 00 00 85 03) | 12 bytes (51 80 AC 05 03 01 01 05 00 00 85 03)
10:22marcanyeah, I suspected that too
10:22marcanI think that might include things like what pins it can be muxed on
10:22rwhitbyalthough the data there looks "rotated"
10:23marcanthey use 16-bit tokens, so that looks like 0x385,0x103 for the first, and 0x103,0x501,0x385 for the second
10:23marcanso the only difference is the second adds 0x501
10:23marcan(it's a set)
10:25rwhitbythe same actionId on different ports of the same device seemed to return the same data (for a limited subset I looked at)
10:26marcanare these devices running the same firmware? (same OSX version)
10:27rwhitbyboth are Big Sur, but I just realised the 14,1 is a minor version behind, so I'll update it and see if it changes things.
10:29rwhitbyWill also check the TBT firmware version in the system report after I update it.
10:29marcan14,2 or 14,1?
10:30rwhitbysorry, 14,2 the 2017 alpine ridge one
10:31rwhitbyit was on OSX 11.0.1 whereas the 15,2 is on OSX 11.1
10:31marcanI think there were significant changes there, yeah
10:31marcanthe firmware grew several kilobytes
10:37marcandammit mac codenames are so annoying to relate
10:37marcanthis ACE2 firmware speaks of "A127X" but A1278 is a 2010 macbook which *definitely* wasn't using ACE2
10:38rwhitbylooking at TBT firmware versions, the Titan Ridge 16" 16,1 is at 55.3 (but it's still running OSX 10.15.17 cause I've got things that need to be updated for Big Sur), the Titan Ridge 13" 15,2 is at 47.4 (OSX 11.1) and the Alpine Ridge 13" 14,2 is at 41.4 (OSX 11.1)
10:39marcancan you get the board IDs?
10:39marcanioreg -l | grep -i board-id
10:40marcanthose will point me to the right firmware
10:49rwhitby16,1: Mac-E1008331FDC96864 15,2: Mac-827FB448E656EC26 14,2: Mac-CAD6701F7CEA0921
10:51rwhitby14,2 response to actionId 0x205 is unchanged after updating to OSX 11.1, so remains different to 15,2 response.
10:55marcan15,2/Mac-827FB448E656EC26 is ACE1, so is 14,2/Mac-CAD6701F7CEA0921. 16,1/Mac-E1008331FDC96864 is ACE2.
10:55marcanso only the 16,1 has the same chip as the M1s
10:55marcanACE1 seems to have a somewhat different firmware approach (config area is different)
10:56marcanbut still, let's see
10:58rwhitbyHmm, the 14,2 is "expendable" to me, the 15,2 is important and the 16,1 is my main laptop. I was hoping to be able to experiment on the 14,2 first so I don't damage the others :-)
11:00marcanthe ACE1 ones outright say TPS65983 in the firmware, so I'm pretty sure CD3215C00 == TPS65983 with different OTP/ROM code
11:06rwhitbyI have 65982 and 65987 dev boards, but no 65983
11:09rwhitbyinteresting, the 65983 EVM photo in https://www.ti.com/lit/ug/slvuap1a/slvuap1a.pdf is the same board I have, and shows a 65982 mounted on it.
11:10rwhitbymarcan: the CD3217B12 on the M1 and 16,1 doesn't happen to correspond to the TPS65987 does it?
11:23rwhitbyMarcan probably already knows all this, but for the benefit of others, this document describes the "patch bundles" in the external SPI flash for the PD controller: https://www.ti.com/lit/an/slvae21a/slvae21a.pdf
11:23marcanwe don't know about that one, but it well might
11:23rwhitbyThe TPS65987 EVM I have is somewhat expendable, so could be use for experimentation.
11:24marcando you have a sample firmware for it?
11:25marcanactually just look at the first word
11:25marcan00000000 02 00 e0 ac is what the apple ones have :-)
11:49rwhitbyAll my test clips are at the office, so I'll need to dump this SPI flash tomorrow.
11:58Necrosporusrwhitby, so you got some intel macs with T1 or T2? Or some M1 too?
11:58rwhitbyIntel Macs only at the moment. alpine ridge and titan ridge used for TBT3 interoperability testing
11:59NecrosporusI don't know those letters
11:59rwhitbyThunderbolt 3
11:59NecrosporusAnd I don't know what those ridges are either
12:01Necrosporusrwhitby, do you have a regular PC with GNU/Linux?
12:01NecrosporusAnd USB port
12:02rwhitbyYep. Why do you ask?
12:04NecrosporusBecause marcan did post log of linux dmesg when a macmini was connected by USB-A to USB-C cable
12:04NecrosporusSo I was wondering if intel macs report different USB id or same
12:06Necrosporususb 2-4: New USB device found, idVendor=05ac, idProduct=1901, bcdDevice= 9.01
12:06NecrosporusThat's from mac mini M1 ^^
12:10Necrosporusrwhitby, I have tried to connect my OrangePi4 board via USB typeC (it's only device I have with TypeC port except external HDD case) it wasn't visible as a device
12:10rwhitbyoh, I can get that from the PD Discover Identity. 15,2 is PID 0x166F and BCD 16.0 14,2 is PID 0x1669 and BCD 5.9 16,1 is PID 0x1670 and BCD 20.4.6
12:11rwhitbyNecrosporus: the ridges are the TBT controller chip code names
12:16marcanNecrosporus: only some devices show up as USB devices
12:16marcanrwhitby: do the intel macs actually do OTG like the M1s?
12:16marcanactually I have one here, let's see
12:17marcan[111378.941077] usb 1-10: new low-speed USB device number 23 using xhci_hcd
12:17marcan[111379.076131] usb 1-10: No LPM exit latency info found, disabling LPM.
12:17marcan[111379.083061] usb 1-10: New USB device strings: Mfr=1, Product=2, SerialNumber=1
12:17marcan[111379.083055] usb 1-10: New USB device found, idVendor=05ac, idProduct=1670, bcdDevice=20.46
12:17marcan[111379.083064] usb 1-10: Product: Macintosh
12:17marcanthis looks like a billboard device
12:18j`eybillboard devices makes me sad :( I cant connect my mba to my screen and get that isntead
12:18marcaninterface class 17
12:18rwhitbyyes, most likely. you only get data transfer with a TBT connection I believe.
12:18marcanNecrosporus: so the answer is no
12:18marcanintel macs do not support this
12:18marcan(which is in line with what I'd expect)
12:20rwhitbyok, I'm out. will finish the intel mac 0x11 responses and TI EVM SPI dumps tomorrow.
13:47roxfan2 has joined #asahi-re
13:49roxfan has quit [Ping timeout: 260 seconds]
14:07svenpeter[m]1 is now known as svenpeter[m]
18:47roxfan2 is now known as roxfan
18:49minicom has joined #asahi-re
18:50artemist has joined #asahi-re
18:52sferrini has joined #asahi-re
18:52_ghost_ has joined #asahi-re
18:55ransom has joined #asahi-re
18:55sven has quit [Quit: ZNC 1.7.4 - https://znc.in]
18:59jcs has joined #asahi-re
18:59Jasper[m] has joined #asahi-re
18:59eta has joined #asahi-re
18:59marcan has quit [Quit: Now where's my screwdriver...]
19:01maximus64 has joined #asahi-re
19:03Shiz has joined #asahi-re
19:03gruetzkopf has joined #asahi-re
19:04Raqbit has joined #asahi-re
19:09GaveUp has joined #asahi-re
19:10josiahmendes[m] has joined #asahi-re
19:14jn__ has joined #asahi-re
19:14Fanfwe has joined #asahi-re
19:14austriancoder has joined #asahi-re
19:18DrWhax has joined #asahi-re
19:19flokk has joined #asahi-re
19:19Yuzu has joined #asahi-re
19:21DarthCloud has joined #asahi-re
19:21titanous has joined #asahi-re
19:22x56 has joined #asahi-re
19:22jld has joined #asahi-re
19:28nufflee[m] has joined #asahi-re
19:31konstanter has joined #asahi-re
19:31marcan has joined #asahi-re
19:33sven has joined #asahi-re
19:38chuskywalker has joined #asahi-re
19:38akemin_dayo has joined #asahi-re
19:40nkaretnikov has joined #asahi-re
19:40nemith has joined #asahi-re
19:43flokk has quit [Quit: Leaving]
19:49pg12 has joined #asahi-re
19:51marcan has quit [Ping timeout: 246 seconds]
19:51sven has quit [Read error: Connection reset by peer]
19:51marcan has joined #asahi-re
19:52davidrysk[m]Apple places firmware in /usr/standalone/firmware on macOS
19:52davidrysk[m]I'm not sure if that is merely a staging repository, though
19:54m42uko has joined #asahi-re
19:55sven has joined #asahi-re
19:56davidrysk[m]and also in /usr/share/firmware/wifi
19:56davidrysk[m]err, /usr/share/firmware
20:00davidrysk[m]the wifi device appears to be a BCM4378, which does have firmware, as there is a kext called com.apple.driver.BCMWLANFirmware4378.Hashstore.
20:03mogery has joined #asahi-re
20:09davidrysk[m]yeah I think it's likely that brcm firmware will be needed
20:11prusnak has joined #asahi-re
20:14pdrew has joined #asahi-re
20:14davidrysk[m]Looking at the kexts in general I see a handful of firmware related ones, but I can't tell how many are actually loading firmware. A bunch are loaded though.
20:20Bluerise has joined #asahi-re
20:22BlueriseI figure the BCM4378 should be just another FullMAC, so it'll definitely need firmware. That said, the firmware interface probably doesn't differ a lot from the regular Broadcom FullMACs. At least that's my hope.
20:24BlueriseThere's not a lot to gain in changing the interface anyway. All that p2p stuff is already supported by the normal Broadcom FullMACs.
20:25Blueriseoh nice, it's all there.
20:26davidrysk[m]Where do we stand regarding the BCM4375, which I would expect it to be derived from?
20:26Bluerisefirmware, clm blob, nvram. unencrypted, just laying there. the hardest part is figuring out which file to use.
20:27BlueriseSo, once we find out which file's to use, OpenBSD's bwfm(4) probably works out of the box, and I'm sure Linux' brcmfmac will work as well.
20:29davidrysk[m]Tangential to this, one of the main annoyances I've run into is lackluster Linux support for bcm4360, which is widely used in routers and older Macs
20:29davidrysk[m]From the bits and pieces that we know about that chip, it's built of hacks upon hacks
20:30Necrosporus has quit [Read error: Connection reset by peer]
20:30Necrosporus_ has joined #asahi-re
20:42davidrysk[m]okay I think it's highly likely that the only firmware blob that will be needed is the bcm one.
20:42davidrysk[m]I see most of the others that are managed by kexts present in the Preboot volume
20:47dgb has joined #asahi-re
20:51artemistThat might fit in linux-firmware if we can find another source for it
20:53crabbedhaloablut has joined #asahi-re
20:53bostjan has joined #asahi-re
21:04mogery has quit [Read error: Connection reset by peer]
21:15Simonx22 has joined #asahi-re
21:19HeN has joined #asahi-re
21:21stemnic has joined #asahi-re
21:26jabamin has joined #asahi-re
21:26bostjan has quit [Quit: Leaving]
21:27linkmauve has joined #asahi-re
21:29bostjan has joined #asahi-re
21:29davidrysk[m]artemist: it might be difficult to find another source... hm
21:32blazra[m] has joined #asahi-re
21:32jabamin has quit [Quit: Textual IRC Client: www.textualapp.com]
21:39bostjan is now known as crucifix
21:40sharpiro has joined #asahi-re
21:41grumble has joined #asahi-re
21:42os[m] has joined #asahi-re
21:50dibas has joined #asahi-re
21:51henni has joined #asahi-re
22:06dstzd has joined #asahi-re
22:14larbob has joined #asahi-re
22:15riker77 has joined #asahi-re
22:27TonyRedondo has joined #asahi-re
22:31damia has joined #asahi-re
22:48brinly has joined #asahi-re
22:48max_thrun has joined #asahi-re
22:49max_thrun is now known as bear24rw
22:52ransom has quit [Read error: Connection reset by peer]
22:54chuskywalker has quit [Remote host closed the connection]
22:55kevincox[m] has joined #asahi-re
23:02Namidairo has joined #asahi-re
23:14doof has joined #asahi-re
23:23Stary has joined #asahi-re
23:25ransom has joined #asahi-re
23:26hthh_ has joined #asahi-re
23:27damia has quit [Quit: damia]
23:28damia has joined #asahi-re
23:32mofux[m] has joined #asahi-re
23:45mcnight[m] has joined #asahi-re
…