<opalfruit>
Hi, with u-boot and bl31, i can see ATF when used as bl31, sets the spsr before jumping back to u-boot, is the spsr set originally though in u-boot? If this is the case, can i force the value of spsr in u-boot somewhere
Stat_headcrabed has joined #u-boot
goliath has quit [Quit: SIGSEGV]
valdemaras has quit [Quit: valdemaras]
Stat_headcrabed has quit [Quit: Stat_headcrabed]
Stat_headcrabed has joined #u-boot
valdemaras has joined #u-boot
<marex>
opalfruit: what are you trying to achieve ? on which SoC ?
<opalfruit>
allwinner h6
<opalfruit>
trying to set a particular value from u-boot
<marex>
does git grep -i spsr in U-Boot sources provide any hints how to do that ?
<opalfruit>
yeah i tried changing the values that i could fine, but that didn't seem to change ATFs value
<opalfruit>
for values where spsr =...
<marex>
use msr spsr...
<marex>
opalfruit: what is the end result you want to achieve ?
<opalfruit>
msr would only only be usable once u-boot is loaded? wouldnt it
<marex>
arch/arm/lib/vectors.S: msr spsr, r13 @ switch modes, make sure moves will execute
<opalfruit>
thanks
<opalfruit>
i'm trying to force a paricular value as currently the ATF isn't jumping back
<opalfruit>
correctly to u-boot
<marex>
you still did not answer either of my questions however ... so it is hard to provide any more meaningful hint
<marex>
ha
<opalfruit>
that's the reason heh
<marex>
doesnt atf do some switch to EL2 and then jump to entry point ?
<marex>
why would spsr play a role in that ?
<marex>
note that spsr is per-EL , so make sure you set the correct one
<marex>
SPL is EL3, TFA is EL3->EL2, U-Boot is usually EL2
<opalfruit>
i'm somewhat confused, i just know if i force the spsr to a particular value in the ATF, it jumps back to u-boot correctly, and hangs otherwise. I'm now trying to do this from u-boot rather than by modifying ATF
<marex>
you may not be able to do that if youre not in the right EL anymore
<opalfruit>
ah, i tried altering the value in arch/arm/include/asm/macro.h, that didn't change things alas, going to try in vector.S now
<xypron>
Tartarus: I found some bugs related to comparisons between integers of different signedness in U-Boot. Should we strive to build with -Wsign-compare?
<marex>
xypron: there is still a few of those, yeah
<marex>
xypron: ideally, I'd say we should build with Werror cleanly
<xypron>
Tartarus: -Wsign-compare is not included in -Wall but in -Wextra.
<marex>
xypron: ah ... I still think the more errors we remove and autoavoid, the better
vagrantc has joined #u-boot
ikarso has quit [Quit: Connection closed for inactivity]
valdemaras has quit [Quit: valdemaras]
goliath has joined #u-boot
Clamor has quit [Ping timeout: 246 seconds]
Clamor has joined #u-boot
Stat_headcrabed has quit [Quit: Stat_headcrabed]
dgilmore has quit [Excess Flood]
dgilmore has joined #u-boot
mckoan is now known as mckoan|away
ikarso has joined #u-boot
mmu_man has quit [Ping timeout: 246 seconds]
prabhakarlad has quit [Quit: Client closed]
<marex>
mkorpershoek: I am truly surprised how the usb udc stuff did not explode too much, thanks for testing
<mkorpershoek>
you're welcome! I did some very basic testing (just reflashing one raw partition) and multiple => fastboot ; Ctrl-C to make sure re-connection works
<marex>
mkorpershoek: I so very much want to get rid of that udc uclass crap with 4 UDCs
sng has quit [Read error: Connection reset by peer]
<Tartarus>
xypron: Are you finding these issues with Coverity or something else?
<Tartarus>
marex: OK
Clamor has quit [Quit: Quit]
<marex>
sjg1: that boot meth blow up above, I don't get it
<marex>
sjg1: boot menu command is missing, I enabled that, but uh ... what exactly is that thing doing ?
<marex>
should this print anything ? ./u-boot -Tc 'bootflow scan'
ikarso has quit [Quit: Connection closed for inactivity]
<Kwiboo>
marex: that Wrong image format for "source" command is possible FIT_SIGNATURE=y without LEGACY_IMAGE_FORMAT=y
<marex>
nope
<marex>
that looks more like sandbox and sandbox64 requiring different image formats
<marex>
like arm and arm64
<marex>
ah wait, LEGACY_IMAGE_FORMAT=y is missing
<Kwiboo>
yep, it is missing so bootmeth script will not work
<Tartarus>
... then some bootmeth needs to be select'ing something I think
<Kwiboo>
more correctly bootmeth script will only work with scripts in FIT format, not with common mkimage -T script format due to LEGACY_IMAGE_FORMAT having default y if !FIT_SIGNATURE
ikarso has joined #u-boot
Clamor has joined #u-boot
Clamor has quit [Client Quit]
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #u-boot
stefanro has quit [Quit: Leaving.]
<sjg1>
Tartarus: Well, be careful, because it provides a back door to get around FIT_SIGNATURE
<Tartarus>
And then one thing, or the other, needs to be disabled, yes
<Tartarus>
Likely
<sjg1>
marex: Re ./u-boot -Tc 'bootflow scan' - add the -l flag if you want something printed
slobodan_ has joined #u-boot
slobodan has quit [Read error: Connection reset by peer]
opalfruit has quit [Quit: Connection closed for inactivity]
<ja_02>
after commit 65cc0e2a65d2c9f107b2f42db6396d9ade6c5ad8 "global: Move remaining CONFIG_SYS_* to CFG_SYS_*" CFG_SYS_UBOOT_START no longer is shown in Makefile causing mkimage to have the wrong entry if it is set to not the default value.
<ja_02>
All cortex-M7s jump to the start of
<ja_02>
this patch adds jump_to_image_no_args for imxrt to jump to the reset
<ja_02>
dissabled on boot, the imxrt has is enabled.
<ja_02>
vector table. which has invalid instructions. normaly usagefault is
<ja_02>
yes CONFIG_SYS_UBOOT_START is visible in the makefile when set in the header file. when its CFG_SYS_UBOOT_START its not exported in the Makefile
flom84 has quit [Ping timeout: 256 seconds]
<marex>
ja_02: why ? :)
<sjg1>
marex: Without -l it still scans, but doesn't list anything
<marex>
ja_02: oh ... one possible fix could be to convert that symbol to Kconfig symbol , i.e. add 'config SYS_UBOOT_START' to fitting Kconfig, and then turn it back to CONFIG_SYS...
<marex>
ja_02: then it would be exposed in Makefile and problem solved, no ?
slobodan has quit [Read error: Connection reset by peer]
<ja_02>
@marex i mean yeah, but as of now we just set the offset of __image_start to reset in CFG_SYS_UBOOT_START which isnt ideal
<marex>
ja_02: I probably dont fully understand the problem you're solving
<ja_02>
and ontop of that imxrt is the only platform that sets it to an arbitrary value we could do this CONFIG_TEXT_BASE + 0x1fd but then it would need to be evaluated
<marex>
if you're loading image from SPL, why not simply set load address of that uImage and entry point to different values and let uboot load/jump to the right address(s)
<Tartarus>
ja_02: Ugh. What platform exactly is showing this kind of problem?
<Tartarus>
Ah,, I see, hum
<ja_02>
thats what CFG_SYS_UBOOT_START does but it is broken. the reason we are using it is because the load address and copy address are the same for the cortex m7 which will jump to the vector table which has invalid instructions. arch/arm/lib/vectors_m.S. on stm32 invalid instruction falts are disabled at boot, same will the arm m7 spec, so no one noticed that. what we did is set CFG_SYS_UBOOT_START to be the address of reset in u-boot
<Tartarus>
Seems reasonable, just cc the maintainers
<ja_02>
k
<ja_02>
to convert it to a Kconfig symbol i just replace CFG_ back to CONFIG_?
Guest4494 has quit [Ping timeout: 246 seconds]
<marex>
ja_02: and add Kconfig 'config SYS...' entry
ezulian has quit [Ping timeout: 246 seconds]
slobodan_ has quit [Ping timeout: 246 seconds]
ikarso has quit [Quit: Connection closed for inactivity]
davlefou has quit [Ping timeout: 256 seconds]
<marex>
sjg1: so on sandbox64, the fwu_mdata_read test fails because fwu_get_mdata() fwu_read_mdata() is called with g_dev = NULL
<marex>
seems like fwu_boottime_checks is a bit weird, for one thing, it is never called, for other I think the sandbox check should be a bit later
<sjg1>
marex: Oh don't get be started on all that. I cannot seem to explain to these people how to design for test
<marex>
sjg1: who, amd/xilinx ?
davlefou has joined #u-boot
<sjg1>
marex: ARM / Linaro
<marex>
sjg1: oh don't get me started on that
<marex>
but uh ... how could that test even work
<marex>
I mean ... wtf
<sjg1>
They insist on restarting sandbox to see if it does the right thing...I have spent months trying to explain that they can just kick of the 'thing' immediately in the test
<marex>
sjg1: uh ... but the test just triggers undefined behavior
<marex>
it just cannot ever work in its current state
<marex>
sigh
<marex>
it is plain wrong
<sjg1>
marex: I'm not sure...perhaps something changed in the interim. It's always going to be brittle...one day they will see the light I hope
<sjg1>
marex: I don't know what changed
<marex>
lib/fwu_updates/fwu.c uses GLOBALS ?!
* marex
faints
<marex>
I guess 246ec2a12c4 ("fwu: meta-data: switch to management by common code")
<marex>
fwu_get_dev_mdata looks like the right kind of function, so it was removed ... sigh