#
✕ nick:sven
#asahi-dev · 2022-04-22 20:01
svenstill no access to the pcie range though. i guess I actually need to bring up this NHI thing for that
#asahi-dev · 2022-04-22 20:01
sven[ 1.165477] apple-thunderbolt 501f00000.nhi: RTKit: IOP power state transition: 0x0 -> 0x20
#asahi-dev · 2022-04-22 20:00
svenright, so maybe i should not unconditionally return ENODEV from my probe function 🤦‍♂️
#asahi-dev · 2022-04-22 19:43
svenafter that there's implementing apple's version of that USB4 NHI and at least this tunneled pcie controller and that 64 SID dart
#asahi-dev · 2022-04-22 19:42
svenoh, there's still a lot of stuff to do. so far NHI isn't even up yet
#asahi-dev · 2022-04-22 19:33
sven*completely
#asahi-dev · 2022-04-22 19:33
svenhrm, wait, it doesn't actually boot completelt though. wtf.
#asahi-dev · 2022-04-22 19:32
sven[ 1.052647] apple-thunderbolt 501f00000.nhi: RTKit: Initializing (protocol version 12) <-- no more random reboots when I actually handle rtkit messages from that thing. the pcie controller still only reads back 0xff... though :(
#asahi-dev · 2022-04-22 08:41
sventhe pcie and pcie-dart range doesn't SError anymore but always return 0xffffffff when trying to read from it now so there's clearly something else missing
#asahi-dev · 2022-04-22 08:39
svener.. nvm. triggers was correct :D
#asahi-dev · 2022-04-22 08:39
sven*trigger
#asahi-dev · 2022-04-22 08:39
sventhis is just great. i can start the ACIO thing it seems but it always triggers some watchdog ~1-2 minutes later and reboots my machine. i wonder what's missing :(
#asahi-dev · 2022-04-21 10:11
svenapple only enables that special clock when a thunderbolt cable is connected fwiw, but modeling that sounds very painful
#asahi-dev · 2022-04-21 10:11
svenif that works the phy will just become a power-domain or clock provider for thunderbolt then
#asahi-dev · 2022-04-21 10:10
sventrying to figure out if I can keep usb3 working without powering down the entire phy the whole time now
#asahi-dev · 2022-04-21 10:10
sveniirc the dart binding already has clocks in there left over from when we thought everything was clocks
#asahi-dev · 2022-04-21 09:41
sveni guess the phy itself provides the clocks for all of the thunderbolt hw
#asahi-dev · 2022-04-21 09:41
svenit only stops serroring once the atcphy is up and I poke a weird thing with a hard coded addresses inside the pmgr kext
#asahi-dev · 2022-04-21 09:40
svenno :/
#asahi-dev · 2022-04-21 09:27
sven*sigh* representing this is going to be even more annoying that i thought
#asahi-dev · 2022-04-21 09:24
svenhuh, so it looks like I can't even access that acio dart registers before the atc phy is up :/
#asahi-dev · 2022-04-20 21:14
svenit happens :-)
#asahi-dev · 2022-04-20 21:13
sven(or something like that)
#asahi-dev · 2022-04-20 21:13
sven"system power management interface protocol"
#asahi-dev · 2022-04-20 21:13
svendo you mean SPMI?
#asahi-dev · 2022-04-20 21:12
svenjust because it runs rtkit doesn't mean it speaks the thing we call "RTKit protocol" over that thing we call "ASC mailbox"
#asahi-dev · 2022-04-20 21:11
sveniirc airtags run it too
#asahi-dev · 2022-04-20 21:11
svenRTKit is just Apple's custom real-time OS fwiw
#asahi-dev · 2022-04-20 15:31
svenvirt -> phys is easy but phys -> virt will probably require you to write some XNU pagetable walking. but chances are you don't need to do that depending on what you're trying to do
#asahi-dev · 2022-04-20 15:28
svenwhy do you need their virtual address?
#asahi-dev · 2022-04-20 15:26
svenuh, from inside the hypervisor? and what are you trying to do?
#asahi-dev · 2022-04-20 09:54
svenyup :)
#asahi-dev · 2022-04-20 09:44
svenftrace can more or less do the same inside the kernel fwiw
#asahi-dev · 2022-04-19 18:36
svenbut apple’s NHI doesn’t look too different from what I can tell
#asahi-dev · 2022-04-19 18:36
svendidn’t look at the corellium thing yet. I first want to figure out which crimes I’d commit against drivers/thunderbolt before I look at that ;)
#asahi-dev · 2022-04-19 18:05
svenah. yeah, that sentence is more than a bit confusing.
#asahi-dev · 2022-04-19 17:28
svenurgh... usb4/thunderbolt is going to be nvme all over again. the current driver only supports PCI.
#asahi-dev · 2022-04-19 15:23
svenread/write protection also changed iirc
#asahi-dev · 2022-04-19 15:23
svenoh, just in general
#asahi-dev · 2022-04-19 15:22
sveniirc there’s a flag that can be passed to map something as uncashed
#asahi-dev · 2022-04-19 15:22
svensomeone should pick up that t6k dart series and correctly add support for that new PTE format now that we know these bits
#asahi-dev · 2022-04-19 14:24
sven(note that it's actually not a full cycle but a 64bit counter but same difference)
#asahi-dev · 2022-04-19 14:24
svenyou already know that a full cycle takes 3 minutes. a full cycle is 2**32 events, i.e. 2**32 / 3 minutes which is ~24 MHz
#asahi-dev · 2022-04-19 14:21
svenand I just happened to know that by heart because I wrote the watchdog driver where I did that calculation
#asahi-dev · 2022-04-19 14:20
svenbecause 2**32 ticks with a 24 MHz frequency take about 3 minutes ;)
#asahi-dev · 2022-04-19 14:19
svensounds like some timer based on that 24 MHz clock then
#asahi-dev · 2022-04-19 13:12
sventhat address is *read* and increases. looks like a counter at first glance
#asahi-dev · 2022-04-19 13:11
svencould be a ringer buffer that gets advanced, or maybe some timeout. hard to tell without context
#asahi-dev · 2022-04-19 11:04
svenapple's clang 12.0.5 also doesn't
#asahi-dev · 2022-04-19 11:03
svenhuh. which compiler is that?

plus ›