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
vagrantc has quit [Quit: leaving]
hlauer has quit [Ping timeout: 480 seconds]
<smaeul> Jacmet: add "thead,c900-plic" as a fallback compatible to the PLIC node in the device tree. the issue is that OpenSBI is using this new compatible (https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd), but the Linux tree is out of date
<smaeul> I hope to get Linux rebased and pushed again by the end of this week
apritzel has quit [Ping timeout: 480 seconds]
juri_ has joined #linux-sunxi
jakllsch has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has joined #linux-sunxi
ftg has quit [Ping timeout: 480 seconds]
<Jacmet> smaeul: ahh, thanks - Will try that!
<Jacmet> smaeul: hmm, but that opensbi commit is in upstream opensbi, I am using your opensbi branch (d1-wip) as well, which hasn't been updated since August
nyama has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
hlauer has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
tnovotny has joined #linux-sunxi
apritzel has joined #linux-sunxi
prefixcactus has joined #linux-sunxi
jakllsch has joined #linux-sunxi
Mangy_Dog has joined #linux-sunxi
<smaeul> Jacmet: the upstream commit is in that branch (https://github.com/smaeul/opensbi/commits/d1-wip). It's been rebased several times, so you probably want to check the commit date (2021-10-20), not the author date (2021-08-08)
<Jacmet> smaeul: correct, current top is b9125c6f8909d
<Jacmet> smaeul: I am not sure I get the relation to Linux here, what dtb is opensbi using? The u-boot one in the toc1 file?
<smaeul> Jacmet: yes, opensbi uses the dtb in the toc1
<smaeul> ah, I see what you mean. the instructions have the dtb in the toc1 coming from the u-boot build, so yes, you could fix it up there, regardless of Linux
<Jacmet> ok, thanks
hallyn has quit [Read error: Connection reset by peer]
hallyn has joined #linux-sunxi
tnovotny_ has joined #linux-sunxi
tnovotny has quit [Remote host closed the connection]
tnovotny has joined #linux-sunxi
tnovotny_ has quit [Ping timeout: 480 seconds]
<Jacmet> smaeul: thanks, it works - The trick is to REPLACE the existing sifive,plic-1.0.0 entry and not just append thead,c900-plic to it as opensbi looks for sifive first (and u-boot doesn't care)
sunshavi has quit [Read error: No route to host]
<apritzel> Jacmet: that sounds like an OpenSBI bug then? It should adhere to the proper semantics of compatible fallback strings?
sunshavi has joined #linux-sunxi
<Jacmet> apritzel: arguable yes, but this is largely libfdt code so U-Boot /Linux probably behaves the same?
<apritzel> well, maybe the *order* of the calls is wrong, then? So if the THead PLIC needs a quirk, it should be searched for first, and only then it should look for the SiFive PLIC?
<Jacmet> apritzel: registering the plic driver causes opensbi to call fdt_find_match which calls fdt_node_offset_by_compatible for each compatible of the driver in turn, so the sifive compatible "wins" over the thead one even though the thead compatible is listed before the sifive one in the dts (E.G. it scans in driver compatible order, not in dts compatible order)
<Jacmet> apritzel: true
<apritzel> Jacmet: so that part of the PLIC is not architected, hence the need for an implementor specific compatible string?
<apritzel> What would be the result if the generic sifive code would be used instead? If there is a problem preventing this to work on THead hardware, then using a fallback is not the right solution
<Jacmet> apritzel: see https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd - The d1 needs to flip a bit to make the plic accessible from S-mode so Linux can use it
<Jacmet> apritzel: other than that it is afaik compatible with the sifive one
<apritzel> Jacmet: ah, I see, so that distinction is irrelevant for Linux itself?
<apritzel> in this case I wouldn't even bother with coding this in the DT, just have that hardcoded in OpenSBI, for the D1
<Jacmet> apritzel: yes (afaik at least, I'm pretty much a riscv noob)
<apritzel> or maybe have a DT property noting that, instead of a compatible string
<Jacmet> apritzel: the conclusion seems to be to simply drop the sifive compatible for Linux: https://lists.infradead.org/pipermail/opensbi/2021-November/002040.html
<apritzel> so the bit can only be set from M-mode?
<Jacmet> apritzel: I believe so, I haven't actually seen any of this documented in the D1 user manual
<apritzel> "documented in the D1 user manual": LOL, welcome to Allwinner
<Jacmet> yeah ;)
<apritzel> I guess for those parts they would just refer to the THEAD manuals anyway (and rightfully so), like they do for the ARM GIC
hlauer has quit [Ping timeout: 480 seconds]
prefixcactus has quit [Ping timeout: 480 seconds]
<jernej> apritzel: did you have time to look into H616 clock issue?
<apritzel> jernej: no, sorry, "make" wanted to do a full rebuild, for which I didn't have enough patience ;-)
<jernej> ok
<jernej> apritzel: r-apb2-rsb warning issue can be bypassed by changing this line https://elixir.bootlin.com/linux/latest/source/drivers/bus/sunxi-rsb.c#L692 to clk_prepare_enable(rsb->clk);
<jernej> which is weird, because pm_runtime_resume(rsb->dev) is supposed to do just that
<jernej> however, this doesn't resolve reboot issue
<jernej> so I there must be another issue
<jernej> not sure if I'll have time to investigate this further today
<apritzel> jernej: thanks! I will try to remember typing "make" *before* having dinner ;-)
<jernej> how long does it take on your PC? it's just few minutes for me
<jernej> or is this too long for you? :)
<apritzel> jernej: my main machine is a good ol' Thinkpad X230, that takes about 30 minutes for a full build, while screaming loudly. And watching Youtube meanwhile makes it even take longer ;-)
<jernej> ah :)
<apritzel> I have other, faster machines around, but syncing trees and the compiled images gets tedious and error prone over time
tnovotny has quit [Quit: Leaving]
apritzel has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has quit []
hlauer has joined #linux-sunxi
Nemo_bis has quit [Remote host closed the connection]
Nemo_bis has joined #linux-sunxi
Nemo_bis has quit [Ping timeout: 480 seconds]
Nemo_bis has joined #linux-sunxi
<jernej> apritzel: smaeul: it looks like power management in RSB bus driver is wrong. From what I figured, you can't resume already disabled "PM runtime", even if it is suspended.
Nemo_bis has quit [Ping timeout: 480 seconds]
<jernej> however, if sunxi_rsb_hw_exit() is called first and pm_runtime_disable() after that, all is well
<jernej> but I don't know if this is acceptable
Nemo_bis has joined #linux-sunxi
anarsoul has quit [Quit: ZNC 1.8.2 - https://znc.in]
anarsoul has joined #linux-sunxi
<jernej> apritzel: sun8i_dwmac_exit() actually hangs at regulator_disable()
<jernej> actually, this might be a bit weirder
<jernej> If I just remove regulator from emac node, it still hangs at reset, even if regulator code is commented out
mripard has quit [Ping timeout: 480 seconds]
vagrantc has joined #linux-sunxi
mripard has joined #linux-sunxi
apritzel has joined #linux-sunxi
<smaeul> apritzel: for the 8211e issue, all that should be needed is a DT sync. I was planning to do that, but the driver change got merged first...
<smaeul> jernej: I guess I was trying to be too clever with the RSB code. maybe changing it to `if (!pm_runtime_status_suspended(rsb->dev)) clk_disable_unprepare(rsb->clk);` would be ideal
<smaeul> Jacmet: it is definitely a bug that opensbi's compatible matching does not follow the order in the DT -- the difference vs Linux/U-Boot is that opensbi is starting with a dirver and trying to find a node; the usual way is to start with a node and try to find a driver
<apritzel> smaeul: do you know if this PLIC compatible string discussion has settled? If this is a pure firmware quirk to allow access from S-mode, it doesn't sound like compatible string material at all.
<apritzel> instead it should be quirk property, or even not mentioned in the DT at la
<apritzel> ... at all, but instead hardcoded in firmware
<smaeul> apritzel: yes, there are differences visible in S-mode: claiming an IRQ masks it until EOI, which sifive PLIC does not do
<smaeul> but even if the S-mode behavior was the same, the DT describes the hardware to the M-mode code too, so I would still say it belongs in the DT
<apritzel> yeah, but I think there is precedence for this being handled in properties
<apritzel> but actually if it has those incompatible differences, it shouldn't use the fallback at all?
<smaeul> right, it shouldn't use the fallback
<smaeul> > add "thead,c900-plic" as a fallback compatible to the PLIC node // here I meant that "thead,c900-plic" should be a fallback for "allwinner,sun20i-d1-plic", not that the sifive,*/riscv,* compatible should be there
<apritzel> ah, I see
<smaeul> Jacmet: btw delegation register this is documented in the D1 manual: PLIC_CTRL_REG on page 210
<smaeul> s/delegation register this/this delegation register/
vagrantc has quit [Quit: leaving]
<apritzel> jernej: real 32m46.624s ;-)
<apritzel> smaeul: DT sync for the phy-mode property, you mean? We already have "rgmii-txid" for the Pine64+ in U-Boot
<smaeul> yes
<smaeul> hmm, not sure what the issue is with that specific board then. of course we will need phy-mode for a bunch of other boards
<smaeul> I will try my Pine64+ here
<apritzel> smaeul: I see the same as Tom here: Pine64+ Ethernet stops working with that 8211e patch