jelly has quit [autokilled: This host violated network policy. Mail support@oftc.net if you think this is in error. (2024-01-25 09:12:05)]
machinehum2 has joined #linux-sunxi
machinehum has quit [Ping timeout: 480 seconds]
jelly has joined #linux-sunxi
apritzel_ has joined #linux-sunxi
machinehum2 has quit [Ping timeout: 480 seconds]
apritzel_ has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
machinehum has joined #linux-sunxi
paulk-bis has quit []
paulk has joined #linux-sunxi
warpme has quit []
machinehum has quit [Ping timeout: 481 seconds]
machinehum has joined #linux-sunxi
dsimic is now known as Guest313
dsimic has joined #linux-sunxi
Guest313 has quit [Ping timeout: 480 seconds]
<Jookia>
I think fractional clocking is broken for the D1, at least for I2S. It won't change the parent clock to an acceptable rate, but if I tell it it's okay to do that it will arrive at the correct clock on paper but in reality it's divided down by something
<apritzel>
Jookia: "fractional clocking is broken for the D1": in hardware, or in the Linux CCU driver?
<Jookia>
The linux driver I think
<Jookia>
I disabled fractional clocking it seems like re-parenting is causing the issue
<Jookia>
Output rate is divided by 1.6
<Jookia>
AUDIO0 and I2S2 clock registers are set correctly to make a 24576000 clock. for my chosen rate and channels it divides by 2 correctly in the I2S clock divider. Hmm
machinehum has quit [Ping timeout: 480 seconds]
<Jookia>
Yeah I just can't get fractional clocking working, it seems to just ignore SDM tables and setting CLK_SET_RATE_PARENT just makes the output weirder
<Jookia>
The fractions included in the ccu aren't even applied
<Jookia>
If anyone can figure out how to enable fractional clocking for audio0, please tell me
machinehum has joined #linux-sunxi
<Jookia>
The two issues I see is clk_set_rate for the i2s2 bus does not try to set audio0 or anything, only pick the closest parent, there is no way to set audio0 at all, and trying to propagate changes up sets it but it never chooses SDM frequencies and puts out odd frequencies on my scope
<Jookia>
Unless there's like a hidden 8 / 5 divisor somewhere
<apritzel>
Jookia: that's on the D1 only? Do you know if that affects other SoCs as well?
<Jookia>
i'm not sure, this is the T113
machinehum has joined #linux-sunxi
warpme has joined #linux-sunxi
<Jookia>
i'm really confused about what conditions cause a rate to be set and why, and why i got a weird clock despite the registers looking fine
<Jookia>
I used ftrace to try and figure out if any ccu_sdm code was running and it wasn't
<Jookia>
I added a rate of 98304000 and calling clk_set_rate with it just seems to do nothing except try to set the i2s divider
<Jookia>
It's very confusing, so I might be misinterpreting something important. I'm just shook that somehow I managed to get a clock that is 1.6x slower than my target one
<Jookia>
I read the registers manually to calculate them and they seemed correct
<apritzel>
could it be that Linux uses a different rate for the SDM table lookup? Something already doubled or halved or so?
<Jookia>
Not sure, I'll check that. I kind of have a suspicion that the datasheet may be lying and the clock it's trying to get (245.76MHz) is too high for the audio0 PLL
<apritzel>
Jookia: can you put some debug in ccu_sdm_helper_has_rate(), to see if that it even called?
machinehum2 has joined #linux-sunxi
<Jookia>
Yeah, shall do when I get to it next. I'll start debugging the clock code a bit more
<Jookia>
I'm just not entirely sure if this is a Linux issue or hardware issue, as the registers all seemed to be set correctly to get the clock Linux wanted, the clock on the output was just wrong
<Jookia>
I am somewhat hoping if I can figure this out I can implement calculating SDM parameters at runtime
machinehum has quit [Ping timeout: 480 seconds]
<apritzel>
do you have any idea of the algorithm? I tried to research that the other day, and that didn't seem easy at all
machinehum has joined #linux-sunxi
machinehum2 has quit [Ping timeout: 480 seconds]
machinehum2 has joined #linux-sunxi
warpme has quit []
machinehum has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
machinehum2 has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has joined #linux-sunxi
machinehum has joined #linux-sunxi
warpme has quit []
machinehum2 has joined #linux-sunxi
machinehum has quit [Ping timeout: 480 seconds]
bauen1 has quit [Ping timeout: 480 seconds]
machinehum2 has quit [Ping timeout: 480 seconds]
machinehum has joined #linux-sunxi
apritzel has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
warpme has joined #linux-sunxi
machinehum2 has joined #linux-sunxi
machinehum has quit [Read error: No route to host]
<Jookia>
apritzel: yes, it's fairly simple. at least if i can test it :)