ChanServ changed the topic of #linux-sunxi to: Allwinner/sunxi development - Did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait for an answer! - This channel is logged at https://oftc.irclog.whitequark.org/linux-sunxi
<apritzel> isn't macromorgan's plan to ditch RSB for all devices completely?
<apritzel> this would not only simplify the shared DTs, but also make this procedure much easier?
<tokyovigilante> it is, but IMO not actually required, if we just do the detection over I2C in SPL we are free to use RSB elsewhere, and reboot is currently broken anyway, because the SPL is unconditionally trying to use I2C to configure the chip when it is set to RSB signalling
<apritzel> ... which would all be nicely solved by not using RSB at all
<apritzel> this rebooting issue is much more severe with those battery powered devices, as both you have learned quite painfully, I believe ;-)
<tokyovigilante> true, if we are all happy to use I2C, I had an idea that RSB had some technical advantages, and if we can do detection at boot in SPL where we are unconditionally using I2C, then that would be a win-win
<tokyovigilante> yup it has been annoying. I am just patching u-boot to reset the 0x3c bus select register for I2C in SPL, then macromorgan can still write the detection code, and reboot will work either way
<apritzel> put you would need to do this reset in RSB mode ...
<tokyovigilante> I think they are orthogonal and it makes sense to check/positively set the bus to I2C signalling before trying it, given that the AXP can potentially still be configured from a previous boot
<tokyovigilante> no, it's just a direct register write, that setting is not done over the bus
<tokyovigilante> at least that is my interpretation of the datasheet
<apritzel> you mean to the RSB controller? for that this must be set up (clocks, reset, pin mux)
<tokyovigilante> 0x68 is the I2C bus, 0x3a3 is RSB, but 0x3e is a separate register to select which is active
<apritzel> and it *will* be transmitted over the bus, to an AXP register
<tokyovigilante> Ah right, so there is no way to reset the device out of RSB mode without using RSB?
<tokyovigilante> Annoying
<apritzel> yeah, that's the point: you *can* pull it off, but it's quite involved
<apritzel> and given that I don't think the advantages of RSB are really a win
<tokyovigilante> in that case better to just use I2C everywhere, agreed
<tokyovigilante> that seems like a real design flaw.
<apritzel> IIRC RSB is faster (3 MHz instead of 100 or 400 KHz), which doesn't strike me as a big advantage, though you can do power transitions faster
<apritzel> the other advantage is that it's easier to program ("fire-and-forget"), but that doesn't really count if we have a driver already
<apritzel> regardless we probably should have code in Linux to reset the PMIC back to I2C, in sunxi_rsb_remove(), but that would assume we always go through that, with an orderly reset
<tokyovigilante> is there value in using RSB after boot, then resetting to I2C on shutdown? Wouldn't be robust to a kernel panic or other unclean shutdown (but cutting power does reset)
<apritzel> yeah, my thoughts exactly, we would still have cases where it doesn't work, although much less frequent
<apritzel> but it feels like the right thing to do, in general, so we should go for it regardless, I think
<apritzel> but given that the Anbernic devices are more problematic due to the battery, and some need I2C-only anyway, and there are more "casual" users of those devices, I'd say we go all I2C there
<tokyovigilante> Yeah I think that's sensible. Practically do you you think there will be much impact on DVFS?
<apritzel> I have no idea, really. I heard arguments that RSB would enable faster switching, but have no idea if that really matters
<tokyovigilante> Sounds good. Shall I just bite the bullet and submit a DT patch to change the devices over to I2C?
<tokyovigilante> The datasheet does suggest that the serial selection register is reset on POR (power-on reset) but that clearly isn't happening in practice
<apritzel> which register? in the AXP, you mean? A watchdog reset/reboot does not affect the AXP ...
<tokyovigilante> oh no, macromorgan has already submitted the DT changes
<apritzel> yeah, exactly
<tokyovigilante> Yeah in the AXP, it suggests on power cycle all the registers labelled POR are reset, but this clearly isn't happening
<apritzel> I think it is, but when do you really power cycle, on a battery powered device?
<tokyovigilante> Quite, in fact it says it's only triggered by holding the power button for >16s, which is a bit user-unfriendly
<apritzel> we could trigger a reset via the AXP instead of the watchdog, in TF-A, maybe that solves that problem?
<tokyovigilante> well, if I understand this correctly, all the registers noted "system reset" are reset by an AXP power cycle, which we *could* do but aren't currently (I think) but the POR registers are only reset by the POR cycle, which is only triggered by holding the power button for 16s. Seems a bit pointless in that case
<tokyovigilante> And that also resets all the battery capacity registers
<tokyovigilante> No I really think you and macromorgan are right, that we should just use I2C
<apritzel> POR is also when the power "comes up", which is the normal way of starting things on dev boards. Any battery really spoils this
<tokyovigilante> Have just tested macromorgan's series briefly, does indeed fix reboot
apritzel has quit [Ping timeout: 480 seconds]
colinsane has quit []
colinsane has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
ftg has quit [Read error: Connection reset by peer]
<macromorgan> so from my perspective if reset doesn't completely reset the device do we need to make sure certain regulators are kept on at shutdown? I'm wondering why reset sends it straight into FEL mode (possibly because the MMC regulator isn't staying on maybe?)
<macromorgan> doesn't writing a 1 to 0x27 cause a reset? Because that's how I can both reset the device and trigger the FEL "glitch" (where it boots straight into FEL mode)
<macromorgan> or 2 to 0x27, one of those two values
vagrantc has quit [Ping timeout: 480 seconds]
wasutton3 has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
aggi has joined #linux-sunxi
ity has joined #linux-sunxi
gsz has joined #linux-sunxi
junari has joined #linux-sunxi
warpme has joined #linux-sunxi
warpme has quit []
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
junari_ has joined #linux-sunxi
junari has quit [Ping timeout: 480 seconds]
junari__ has joined #linux-sunxi
junari_ has quit [Ping timeout: 480 seconds]
junari__ has quit [Read error: Connection reset by peer]
cch_ has joined #linux-sunxi
vagrantc has joined #linux-sunxi
cch has quit [Ping timeout: 480 seconds]
vagrantc has quit [Quit: leaving]
apritzel has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
<Jookia> my friend has a h616 board (a btt pi using a btt cb1) whose rtc runs at 40% of real time D: D: D:
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
aggi has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
montjoie has joined #linux-sunxi
montjoie_ has quit [Ping timeout: 480 seconds]
apritzel has joined #linux-sunxi
<apritzel> Jookia: I think that's a known issue with the RC calibration? There was a thread on the list ...
<Jookia> hmm, wasn't there a patch to calibrate it
<apritzel> well, there was some patch, but it was a against some Armbian branch, and had other issues, IIRC
<Jookia> ah
<apritzel> does the BTT Pi not have a 32KHz crystal oscillator?
<apritzel> because that is actually the root cause: board vendors being too stingy and omitting this part
<Jookia> i don't know
<Jookia> how would you check
<Jookia> i guess without a scope i can't
<apritzel> it should be on the schematics, and you should be able to find the physical part on the board
<Jookia> i would guess the board has one
<Jookia> oh, that might ben an 24mhz one
<tokyovigilante> Jookia: AFAICT that patch was against H6 code, but the H616 clk-ng code sets that register anyway
<tokyovigilante> I think the calibration is not an absolute panacea for a crystal
<Jookia> in this case we're using ntp
<Jookia> to paper over the issue
junari has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
apritzel has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has joined #linux-sunxi
gsz has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
apritzel has joined #linux-sunxi
colinsane has quit []
colinsane has joined #linux-sunxi
dsimic is now known as Guest668
dsimic has joined #linux-sunxi
Guest668 has quit [Ping timeout: 480 seconds]
ftg has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
apritzel has joined #linux-sunxi
junari has quit [Ping timeout: 480 seconds]
apritzel has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
wasutton3 has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
colinsane has quit []
colinsane has joined #linux-sunxi
gsz has joined #linux-sunxi
JohnDoe_71Rus has quit [Quit: KVIrc 5.2.4 Quasar http://www.kvirc.net/]
gsz has quit [Ping timeout: 480 seconds]
wasutton- has joined #linux-sunxi
wasutton3 has quit [Ping timeout: 480 seconds]
apritzel has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
ftg^ has joined #linux-sunxi
ftg has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
colinsane has quit []
colinsane has joined #linux-sunxi
ity has quit [Remote host closed the connection]