#
✕ nick:marcan
#asahi-dev · 2021-09-21 06:19
marcankettenis: yeah, I'd been wondering about that
#asahi-dev · 2021-09-20 16:05
marcan-r
#asahi-dev · 2021-09-20 16:04
marcanbut 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...)
#asahi-dev · 2021-09-20 16:04
marcanif I can at least get *feedback* as things get turned on and off on what real clocks/pds get toggled, that'd be useful
#asahi-dev · 2021-09-20 16:04
marcan*relationship
#asahi-dev · 2021-09-20 16:03
marcantoday I did find a relatinship between devices, clocks, power domains, and events and a pile of consecutive registers, which is if nothing else curious
#asahi-dev · 2021-09-20 16:03
marcananyway... it doesn't *really* matter as long as it works
#asahi-dev · 2021-09-20 16:03
marcanbut it's also not impossible that there are "hidden" relationships, who knows
#asahi-dev · 2021-09-20 16:03
marcan(not that case)
#asahi-dev · 2021-09-20 16:03
marcanI 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
#asahi-dev · 2021-09-20 16:02
marcanhard to say with the power hardware what's real and what isn't
#asahi-dev · 2021-09-20 15:30
marcan(the sample DT in my tree right now mirrors the ADT relationships, but I think they're BS anyway)
#asahi-dev · 2021-09-20 15:29
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)
#asahi-dev · 2021-09-20 15:29
marcanI 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
#asahi-dev · 2021-09-20 15:28
marcanor you can leave that in and just have apcie_st as the only power domain of the ans device node
#asahi-dev · 2021-09-20 15:28
marcanyou 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
#asahi-dev · 2021-09-20 15:27
marcanyeah, 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
#asahi-dev · 2021-09-20 15:22
marcanalyssa: yes
#asahi-dev · 2021-09-20 15:22
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)
#asahi-dev · 2021-09-20 15:22
marcanbut current DTs should largely work with older kernels *if* those devices start out ungated
#asahi-dev · 2021-09-20 15:21
marcan(e.g. uart wants working clocks)
#asahi-dev · 2021-09-20 15:21
marcankettenis: won't work, without the clock driver stuff would fail
#asahi-dev · 2021-09-20 10:33
marcanthe 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
#asahi-dev · 2021-09-20 10:32
marcanhttps://mrcn.st/p/wIV8YsUq
#asahi-dev · 2021-09-20 10:32
marcanj_ey: pushed proper parent/child support for the genpd stuff
#asahi-dev · 2021-09-20 10:28
marcan(linux rightly detects that and fails creating the relationship)
#asahi-dev · 2021-09-20 10:28
marcan(APCIE_ST claims to depend on ANS2, but ANS2 is powered down and APCIE_ST is not)
#asahi-dev · 2021-09-20 10:28
marcantfw Linux power domain init fails because I described the same topology as Apple and it's either a lie or iBoot misconfigures it
#asahi-dev · 2021-09-20 06:53
marcanI can't figure out how to get the auto-pm thing to work though
#asahi-dev · 2021-09-20 06:45
marcan(assuming you deassert reset before powering back on)
#asahi-dev · 2021-09-20 06:45
marcanif you power it off (pstate < 15), reset it, and power it back on, it's not reset
#asahi-dev · 2021-09-20 06:45
marcanso it's a synchronous reset
#asahi-dev · 2021-09-20 06:45
marcanhowever... this only works when powered on!
#asahi-dev · 2021-09-20 06:45
marcanbit 31 is definitely reset, at least on the UARTs it clears all registers and, while set, makes all MMIO ignored
#asahi-dev · 2021-09-20 06:35
marcanbit 10 seems to be a "block" bit or something, it makes accessing the peripheral fail even when it's ostensibly powered up
#asahi-dev · 2021-09-20 06:34
marcanwhich indeed suggests the UARTs don't get power gated (you only ever see 0x2xx there)
#asahi-dev · 2021-09-20 06:33
marcanI bet they are status flags. bit9 = clock was gated, bit8 = power was gated, write 1 to clear
#asahi-dev · 2021-09-20 06:33
marcanahh... I have an idea of what they mean
#asahi-dev · 2021-09-20 06:05
marcanbits 8,9 are weird... they are sometimes set when written to 1 and sometimes cleared?
#asahi-dev · 2021-09-20 05:53
marcanlooks like that's some kind of autosleep feature
#asahi-dev · 2021-09-20 05:53
marcanthen macos clears bit 28, and it goes active
#asahi-dev · 2021-09-20 05:53
marcanso there's a device that is in requested active, but actually clockgated
#asahi-dev · 2021-09-20 05:52
marcan[0xfffffe0012f2ca64] PMGR: W.4 0x23b700358 (MMX.pstate + 0x00) = 0xf0003ff -> 0x4000340
#asahi-dev · 2021-09-20 05:52
marcan[0xfffffe0012f2ca64] PMGR: W.4 0x23b700358 (MMX.pstate + 0x00) = 0x1400034f -> 0x400004f
#asahi-dev · 2021-09-20 05:52
marcanah, this is interesting
#asahi-dev · 2021-09-19 18:04
marcanneeds more research
#asahi-dev · 2021-09-19 18:04
marcanbut some blocks would be
#asahi-dev · 2021-09-19 18:04
marcanj_ey: pretty sure e.g. the uarts aren't individually power-gateable so it should be the same for those
#asahi-dev · 2021-09-19 18:03
marcanok, off to sleep :)
#asahi-dev · 2021-09-19 18:03
marcanyeah

plus ›