<apritzel>
jernej: it's a bit hacky, and not really suited for mainline, but compiling the SPL for arm(32) fixes the Avaota-A1 return-to-FEL issue for me (since we don't need to go to AArch64 and back):
Schimsalabim has quit [Read error: Connection reset by peer]
apritzel has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
gsz has quit [Ping timeout: 480 seconds]
ftg has quit [Read error: Connection reset by peer]
hexdump01 has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
<jernej>
apritzel: thanks! IIRC that's also good enough to boot TF-A, since that has independent code for switching to aarch64, right?
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
apritzel has quit [Ping timeout: 480 seconds]
dsimic is now known as Guest5483
dsimic has joined #linux-sunxi
Guest5483 has quit [Ping timeout: 480 seconds]
sh1 has quit [Ping timeout: 480 seconds]
sh1 has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
apritzel has joined #linux-sunxi
gsz has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
apritzel has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
apritzel has joined #linux-sunxi
<apritzel>
jernej: TF-A itself has no provision to switch to AArch64, it expects to be always entered in AArch64/EL3
<apritzel>
but you can use the "reset64" feature of sunxi-fel to do this for you
<apritzel>
that's what the "uboot" command would do internally: upload everything from the FIT image, then do a reset64 to the TF-A load address
<apritzel>
jernej: one interesting design question we would need to answer is where to put TF-A into. Traditionally SRAM-A2 would be the place, and it looks big enough, but is also used by the SPL
junari has quit [Remote host closed the connection]
junari has joined #linux-sunxi
linkmauve has joined #linux-sunxi
gsz has quit [Ping timeout: 480 seconds]
junari has quit [Remote host closed the connection]
BroderTuck has joined #linux-sunxi
<BroderTuck>
apritzel: (or anyone else with a A523-family SoC) Did anyone else see the weirdness that I saw with the rtc clock, where the rtc ends up on this line in clk_summary
<BroderTuck>
bus-r-cpucfg 1 1 0 100000000 0 0 50000 Y 7090000.rtc bus
psydroid has quit [Ping timeout: 480 seconds]
mripard has quit [Quit: WeeChat 4.4.4]
apritzel_ has joined #linux-sunxi
psydroid has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
<BroderTuck>
Been staring at the code, but can't really make heads or tail of it
<jernej>
apritzel: I concur, SRAM A2 seems like a good candidate. TF-A could be located in DRAM at first and then it relocates itself to SRAM A2? U-Boot proper already does that.
<apritzel>
TF-A should never be in DRAM, we just did this for the H616, because there is no suitable SRAM available there
<apritzel>
so I was thinking to split SRAM A2, and leave say the first 64K for the SPL, and the rest (80K?) for TF-A
<apritzel>
jernej: compare to the A64 and H6: we use only SRAM A2 for TF-A there, no DRAM involved
<apritzel>
jernej: btw: if you compile for PLAT=sun50i_r329, and use that, you should see at least some output from TF-A, because the UART address is the same on the R329
<apritzel>
you might need to adjust the TF-A load address, though
<jernej>
ah, yes, split SRAM A2 is easiest. my current SPL size is 40 KB, so plenty of space left for complicated DRAM driver ;)
<jernej>
just to be sure to avoid already used regions
<apritzel>
jernej: those are good questions!
<apritzel>
I thought the RISC-V core *is* the MCU?
<apritzel>
similar to OpenRISC and arisc?
<apritzel>
but pretty surely we should leave SRAM A3 alone
<apritzel>
and since the manual indeed says "MCU uses SRAM A1", I was trying to avoid that region, since there might be say crust running there, during boot even (suspend/resume)
<apritzel>
and oddly enough the BROM doesn't use SRAM A1 either, at least not for loading boot0/SPL
<jernej>
right, A1 and A3 are for MCU, a.k.a. RISC-V
<apritzel>
and the manual doesn't mention this, but traditionally SRAM A2 is the secure SRAM, so not accessible by non-secure world, which makes it perfect for TF-A
<apritzel>
(ignoring for a moment that at least A64 and H6 ignore this fact unless you use "secure boot")
<apritzel>
actually TF-A could use even more of SRAM A2, since when TF-A starts, SPL should not be there anymore
<jernej>
did you check how secure A2 is?
<apritzel>
don't remember, need to check on that tablet, but I think I never ran non-secure code there. But I guess with your DRAM code I could actually run U-Boot now ...
<jernej>
note that usually also cedrus and display engine use SRAM C, but I don't see any mention of them here
<jernej>
so that would also be interesting to check
<jernej>
and system controller documentation is sadly missing
apritzel has quit [Ping timeout: 480 seconds]
juri__ has left #linux-sunxi [#linux-sunxi]
juri_ has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
<apritzel>
BroderTuck: ah, found the reason for your RTC issue: the clock numbers in the DT binding headers changed, between the kernel on my Github and my local trees
<apritzel>
BroderTuck: you can fix this for now by renumbering the clocks in include/dt-bindings/clock/sun55i-a523-r-ccu.h: CLK_BUS_R_SPI must become 11, and everything from down there must follow
<apritzel>
so that CLK_BUS_R_RTC will be 25, not 24
<apritzel>
then recompile the kernel - I know, sorry! ;-)
<BroderTuck>
apritzel: Well, I guessed it was an off-by-one somewhere, just didn't know enought to figure out where it came from
<BroderTuck>
Will try this as soon as my H3 box is behaving again (had a bit of a problem with the sd card, trying to rebuild a new working fs for that machine)
colinsane has joined #linux-sunxi
<BroderTuck>
I see now that there are 2 other TV boxes with H728 available, but both of them only have 1 USB2.0 (and one 3.0)
gsz has quit [Ping timeout: 480 seconds]
colinsane has quit [Ping timeout: 480 seconds]
<BroderTuck>
So, CLK_BUS_R_PWMCTRL stays 9, but CLK_BUS_R_SPI and everything after gets shifted 1 step?
<apritzel>
yes, because I inserted CLK_R_SPI, that's the new 10
<BroderTuck>
Not surprising then, most clocks remained the same, only a few got shifted around. Sounds like it will fix the issue, and why noone else seems to have noticed
<BroderTuck>
Will have it tested by tomorrow
<BroderTuck>
Now if only fixing the emmc was as easy :)
<apritzel>
BroderTuck: most people either don't care about the RTC, or just use consistent DTs. Your issue was because I put a newer DT in U-Boot, not matching the binding used in the kernel on my github
<apritzel>
since the DT and the whole code is in development, that's expected
<BroderTuck>
Things being in flux, yeah, that's to be expected. I had more or less verified that it was not my kernel itself that was the problem, so was actually wondering if it was some incompatibility with your uboot, and indeed it turned out to be.