#
#asahi-dev · 2022-11-23 03:05
marcanor just the sleeps
#asahi-dev · 2022-11-23 03:04
marcancyrozap: re the instability, maybe we need the confirmed mmio write thing?
#asahi-dev · 2022-11-23 03:02
marcanstill should probably use the public part number for the firmware name
#asahi-dev · 2022-11-23 03:01
cyrozapI have a Kaitai Struct definition for their firmware images, in case you're curious: https://github.com/cyrozap/asmedia-xhc-re/blob/59708d5b5eb17593f6f5459f2bf20b73e90b159d/tools/asm_fw.ksy
#asahi-dev · 2022-11-23 03:00
marcanohh that's where I got that from
#asahi-dev · 2022-11-23 03:00
cyrozapmarcan: "2214" comes from the RCFG/FW headers, which are "2214A_RCFG"/"2214A_FW" for the ASM2142 and ASM3142 (https://github.com/cyrozap/asmedia-xhc-re/blob/59708d5b5eb17593f6f5459f2bf20b73e90b159d/monitor/make_image.py#L32). I assume "2214A" is ASMedia's internal name for the chip, but I have no idea why they rotate the number right by one place compared to the model numbers they write on the chips.
#asahi-dev · 2022-11-23 02:52
marcanlovely that I typoed the firmware filename... good thing we have fwextract to fix that...
#asahi-dev · 2022-11-23 02:52
marcanprobably meant to write 2142
#asahi-dev · 2022-11-23 02:52
marcanalso now I wonder where the hell I got ASM2214 from, that has to be a typo...
#asahi-dev · 2022-11-23 02:43
marcanI just reverse engineered that by copying what macOS does, I don't know what the indirect write regs do
#asahi-dev · 2022-11-23 02:43
marcancyrozap: we're still having trouble with the "reset to ROM code for firmware upload" step sometimes, so if you find anything wrong in the code please do tell...
#asahi-dev · 2022-11-23 02:40
marcanah, yeah
#asahi-dev · 2022-11-23 02:25
chadmedpython tries to install /usr/bin/asahi-fwextract now which makes no sense if we have it in asahi-scripts
#asahi-dev · 2022-11-23 02:24
chadmedmarcan: i think 7cf5c453e960 on asahi-installer collides with the latest asahi-scripts
#asahi-dev · 2022-11-23 01:50
cyrozapwrite to an address larger than 48 bits?
#asahi-dev · 2022-11-23 01:50
cyrozapI have some questions regarding the DART IOMMU. If my understanding is correct, some Apple SoCs only have a 36-bit address space, while others have a 42-bit address space. Is this just the physical limit, and the I/O virtual address can be larger (e.g., greater than 48 bits)? Or does this limit apply to the virtual addresses as well? Like, would Linux running on an Apple SoC ever tell a PCIe device to
#asahi-dev · 2022-11-23 01:03
cyrozappovik: Thanks again for your help--I've managed to successfully download and extract the ASMedia firmware. Interestingly, the firmware version ("191118_70_11_11") is newer than any other I've seen in the wild so far. I wonder if they fixed the bug where trying to read from two devices simultaneously can sometimes cause a bad DMA write...
#asahi-dev · 2022-11-23 00:56
amarioguy2re: the "go into OS selector every time" question there's probably some hacky workaround but officially sanctioned i don't think so
#asahi-dev · 2022-11-22 22:31
cyrozapbtw, if anyone has any questions about the ASMedia USB host controllers, I've done a lot of in-depth RE of them, so feel free to ask!
#asahi-dev · 2022-11-22 22:30
ChaosPrincessi do not think thats possible, os picker is actually full macos that runs the 'os picker' app, which then sets the apple equivalent of BootNext and reboots
#asahi-dev · 2022-11-22 22:28
cyrozapSo, uh, thanks, Apple, for using functionality in ASMedia's newer host controllers that no other system vendors seem to be using. And big thanks to marcan for doing the RE work on that--you've saved me a lot of time and energy :)
#asahi-dev · 2022-11-22 22:28
nicolas17default boot OS = "none, ask me every time"
#asahi-dev · 2022-11-22 22:28
nicolas17is it possible to configure the Mac to boot to the OS selector?
#asahi-dev · 2022-11-22 22:22
cyrozapcertain that those BAR0 registers are accessing MMIO because the registers accessed through them (e.g., https://github.com/AsahiLinux/linux/blob/893f672e78d075fbb7b4530ffc190173dc700871/drivers/usb/host/xhci-pci-asmedia.c#L222-L223) match the ones I've documented (https://github.com/cyrozap/asmedia-xhc-re/blob/59708d5b5eb17593f6f5459f2bf20b73e90b159d/data/regs-asm2142.yaml#L108-L173).
#asahi-dev · 2022-11-22 22:22
cyrozapOh, interesting... Looking at the kernel code, it looks like ASMedia moved the direct MMIO access functionality from the PCI config space to BAR0. And so the only other differences in the process are really just some MMIO address and bit field changes, which makes sense since the ASM2142 and later use a different range of addresses for their MMIO compared to the ASM1142 and earlier. And I know for
#asahi-dev · 2022-11-22 22:12
ChaosPrincessabsolutely none, i do not have a m2
#asahi-dev · 2022-11-22 22:12
nicolas17ChaosPrincess: any progress on M2 nvram?
#asahi-dev · 2022-11-22 22:01
ChaosPrincessMade a step 1 to having a 'reboot to macos' command - nvram read/write tool. seems to be working, but i do not recommend using it if you are not ready to do a dfu restore https://github.com/WhatAmISupposedToPutHere/asahi-nvram
#asahi-dev · 2022-11-22 21:50
cyrozappovik, jannau: Thank you both, that's really helpful information! I'm surprised to see they're using a bog-standard ASM3142, and not some special part customized by Apple. And the mask ROM firmware version (0x010250090816, normally written like 160809_50_02_01) confirms that, since that's the same version I see with the ASM2142 and ASM3142 chips I have.
#asahi-dev · 2022-11-22 21:46
povik(including the extraction of the asmedia firmware itself)
#asahi-dev · 2022-11-22 21:44
povikand the extraction steps are written into https://github.com/AsahiLinux/asahi-installer
#asahi-dev · 2022-11-22 21:41
jannaufor 4) the kernel is include in the ipsw system images, see https://ipsw.me/product/Mac
#asahi-dev · 2022-11-22 21:40
jannaucyrozap: ifixit says asm3142 for the 4 port 24" imac https://www.ifixit.com/Teardown/iMac+M1+24-Inch+Teardown/142850#s288729 not sure about the mac studio. those are the two models which have the asmedia usb host controller
#asahi-dev · 2022-11-22 21:32
povikalso that might answer 1) and 3)
#asahi-dev · 2022-11-22 21:32
povikcyrozap: ad 2) https://github.com/AsahiLinux/linux/commit/893f672e78d075fbb7b4530ffc190173dc700871
#asahi-dev · 2022-11-22 21:32
povikthanks!
#asahi-dev · 2022-11-22 21:32
svenpovik: soc for stuff that will only ever run on apple Silicon SoCs (e.g. rtkit), platform for things that are also useful for older apple machines (x86 macs etc.) imho
#asahi-dev · 2022-11-22 21:28
cyrozapfrom Apple and extract the firmware myself?
#asahi-dev · 2022-11-22 21:28
cyrozapor they have it disabled by default. So, I have a few questions: 1) Which ASmedia USB host controller is Apple using in their devices? 2) Has the firmware upload protocol that Apple is using been documented anywhere? 3) Which Apple models contain these ASMedia USB host controllers? 4) Is there a way to download the macOS XNU kernel binary (which the post said contains the ASMedia firmware) directly
#asahi-dev · 2022-11-22 21:28
cyrozapdocumented here: https://github.com/cyrozap/asmedia-xhc-re/blob/59708d5b5eb17593f6f5459f2bf20b73e90b159d/doc/src/index.adoc#code-ram-write-access, example code here: https://github.com/cyrozap/asmedia-xhc-re/blob/59708d5b5eb17593f6f5459f2bf20b73e90b159d/tools/asm_tool.py#L156-L213) are the ASM1042A and ASM1142--the others (ASM1042, ASM2142/ASM3142, and ASM3242) either lack the functionality in hardware
#asahi-dev · 2022-11-22 21:28
cyrozapHi, all! I just read the recent progress report, and the part about the ASMedia firmware loading functionality really interested me. I've been working on my own ASMedia USB host controller RE project for a couple years now (https://github.com/cyrozap/asmedia-xhc-re), and from my research, the only ASMedia USB host controllers I found that include hardware-based firmware upload over PCIe (functionality
#asahi-dev · 2022-11-22 21:26
poviki am not clear on the difference between drivers/platform/apple and drivers/soc/apple
#asahi-dev · 2022-11-22 21:25
povikwhere in linux tree should a driver for the LEAP coprocessor go?
#asahi-dev · 2022-11-22 20:49
svenokay, wtf, I just had access to the tbt pcie and everything else but now I rebooted and now the same kernel results in SErrors again?!
#asahi-dev · 2022-11-22 18:51
svenguess I’ll have to convince macOS to go into device mode and see what it does differently
#asahi-dev · 2022-11-22 18:51
svenrqou_: ah, pity. it’s probably still broken then
#asahi-dev · 2022-11-22 18:45
millenialhackerI can connect an external keyboard, but I just wanted to know if it was a known issue
#asahi-dev · 2022-11-22 18:45
as400Oh crap
#asahi-dev · 2022-11-22 18:45
millenialhackerGentoo hates me :D
#asahi-dev · 2022-11-22 18:44
millenialhackerafter grub boots Linux it's gone

plus ›