<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
<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.
<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