ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
___nick___ has joined #asahi-dev
<alyssa> and now have all the modes visible in modetest
boardwalk has joined #asahi-dev
PhilippvK has joined #asahi-dev
phiologe has quit [Ping timeout: 480 seconds]
quarkyalice__ has joined #asahi-dev
quarkyalice__ has quit [Ping timeout: 480 seconds]
<marcan> ah, this is interesting
<marcan> [0xfffffe0012f2ca64] PMGR: W.4 0x23b700358 (MMX.pstate + 0x00) = 0x1400034f -> 0x400004f
<marcan> [0xfffffe0012f2ca64] PMGR: W.4 0x23b700358 (MMX.pstate + 0x00) = 0xf0003ff -> 0x4000340
<marcan> so there's a device that is in requested active, but actually clockgated
<marcan> then macos clears bit 28, and it goes active
<marcan> looks like that's some kind of autosleep feature
<marcan> bits 8,9 are weird... they are sometimes set when written to 1 and sometimes cleared?
maor26 has joined #asahi-dev
<marcan> ahh... I have an idea of what they mean
<marcan> I bet they are status flags. bit9 = clock was gated, bit8 = power was gated, write 1 to clear
<marcan> which indeed suggests the UARTs don't get power gated (you only ever see 0x2xx there)
<marcan> bit 10 seems to be a "block" bit or something, it makes accessing the peripheral fail even when it's ostensibly powered up
<marcan> bit 31 is definitely reset, at least on the UARTs it clears all registers and, while set, makes all MMIO ignored
<marcan> however... this only works when powered on!
<marcan> so it's a synchronous reset
<marcan> if you power it off (pstate < 15), reset it, and power it back on, it's not reset
<marcan> (assuming you deassert reset before powering back on)
<marcan> I can't figure out how to get the auto-pm thing to work though
aleasto has joined #asahi-dev
quarkyalice has quit [Remote host closed the connection]
quarkyalice has joined #asahi-dev
quarkyalice_ has joined #asahi-dev
quarkyalice has quit [Ping timeout: 480 seconds]
gabuscus_ has joined #asahi-dev
gabuscus has quit [Ping timeout: 480 seconds]
chadmed has quit [Quit: Konversation terminated!]
quarkyalice has joined #asahi-dev
quarkyalice__ has joined #asahi-dev
unrelentingtech has quit []
quarkyalice_ has quit [Ping timeout: 480 seconds]
quarkyalice_ has joined #asahi-dev
quarkyalice has quit [Ping timeout: 480 seconds]
quarkyalice has joined #asahi-dev
quarkyalice__ has quit [Ping timeout: 480 seconds]
quarkyalice_ has quit [Ping timeout: 480 seconds]
frode_0xa has joined #asahi-dev
<marcan> tfw Linux power domain init fails because I described the same topology as Apple and it's either a lie or iBoot misconfigures it
<marcan> (APCIE_ST claims to depend on ANS2, but ANS2 is powered down and APCIE_ST is not)
<marcan> (linux rightly detects that and fails creating the relationship)
<marcan> j_ey: pushed proper parent/child support for the genpd stuff
<marcan> the apcie_st domain fails to add, I left it like that for now. We should probably just have the actual ans driver depend on both instead
chadmed has joined #asahi-dev
leah2 has quit [Remote host closed the connection]
leah2 has joined #asahi-dev
<alyssa> marcan: to make sure i understand, apple,t8103-pmgr-pstate and the corresponding driver wholly replaces the clock gates driver from sven I'm carrying?
<alyssa> clk: add support for gate clocks on Apple SoCs
<alyssa> ^ that one
<alyssa> (and apple,t8103-gate-clock-controller compatible)
<kettenis> yes
<kettenis> this also means that "clock" properties of devices such as NVMe and PCIe need to be replaced with appropriate "power-domains" properties
frode_0xa has quit [Quit: leaving]
jbowen has joined #asahi-dev
X-Scale has joined #asahi-dev
X-Scale` has quit [Ping timeout: 480 seconds]
<alyssa> fun. thanks
<kettenis> you might be able to get away with keeping the clock stuff and just adding the power-domain stuff if you want to have a DT that works with older kernels as well
skipwich has joined #asahi-dev
<alyssa> kettenis: no interest in older kernels, just need to know what to splice in and out of my tree
skipwich has quit [Remote host closed the connection]
skipwich has joined #asahi-dev
<kettenis> heh, then forget what I said
<alyssa> I love forgetting advice people give me :-p
<tophevich[m]> Ha, you know what is even better, ignoring your own advice ,_`o`O_,
<marcan> kettenis: won't work, without the clock driver stuff would fail
<marcan> (e.g. uart wants working clocks)
<marcan> but current DTs should largely work with older kernels *if* those devices start out ungated
<alyssa> marcan: also to clarify this is the same as the pmgr enable /arm-io/foo stuff in m1n1?
<marcan> (which is the case for UART but not e.g. ANS, though that might change as I'm considering adding pmgr code to m1n1 to clean up after iBoot's stupidity)
<marcan> alyssa: yes
<alyssa> got it
<alyssa> (I have a `u.pmgr_enable("/arm-io/ans")` in my linux.py right now 😅)
<marcan> yeah, thanks to the magic of the pm framework, you can remove that and just add the domains... except the sample dt right now fails *without* that exact line because iBoot sucks
<marcan> you can either change the relationship to remove ans2 from the power domains of apcie_st and add apcie_st and ans2 to the power domains of the ans device node
<marcan> or you can leave that in and just have apcie_st as the only power domain of the ans device node
<marcan> I think the relationship is BS anyway so might as well just change it, but i'm also considering adding a cleanup pass to m1n1 to ensure everything is consistent
<marcan> (the problem is the ADT claims apcie_st depends on ans2, yet ans2 is powered down and apcie_st is powered up, which is a contradiction, and Linux' sanity checking catches that)
<marcan> (the sample DT in my tree right now mirrors the ADT relationships, but I think they're BS anyway)
leah2 has quit [Remote host closed the connection]
leah2 has joined #asahi-dev
<alyssa> nods
<alyssa> I have very little confidence in the accuracy of the ADT, it has bullshitted us before and will bullshit us again 🤷
<marcan> hard to say with the power hardware what's real and what isn't
<marcan> I know there is some level of true relationships because enabling a child without enabling a parent, in at least some cases, sets an error flag
<marcan> (not that case)
<marcan> but it's also not impossible that there are "hidden" relationships, who knows
<marcan> anyway... it doesn't *really* matter as long as it works
<marcan> today I did find a relatinship between devices, clocks, power domains, and events and a pile of consecutive registers, which is if nothing else curious
<marcan> *relationship
<marcan> if I can at least get *feedback* as things get turned on and off on what real clocks/pds get toggled, that'd be useful
<marcan> but I have no idea what those registers actually do (something that is somehow homogenerous between all those categories? events is the only thing that makes sense...)
<marcan> -r
<alyssa> 🤷
<kettenis> marcan: I think your pmgr driver should only match on "apple,pmgr-pstate"
<kettenis> the "apple,t8103-pmgr-pstate" compatible is only there as a safety in case the hardware isn't as generic as we think it is
yuyichao has quit [Ping timeout: 480 seconds]
yuyichao has joined #asahi-dev
quarkyalice__ has joined #asahi-dev
quarkyalice__ has quit [Remote host closed the connection]
maor has joined #asahi-dev
maor26 has quit [Ping timeout: 480 seconds]
jbowen has quit [Quit: leaving]
aleasto has quit [Quit: Konversation terminated!]
aleasto has joined #asahi-dev
aleasto has quit []
aleasto has joined #asahi-dev
aleasto has quit [Remote host closed the connection]
aleasto has joined #asahi-dev
aleasto has quit [Quit: Konversation terminated!]
psykose has quit [Ping timeout: 480 seconds]
psykose has joined #asahi-dev
yuyichao has quit [Ping timeout: 480 seconds]
yuyichao has joined #asahi-dev
maor has quit [Ping timeout: 480 seconds]