<Forty-Bot>
ok, so the problem is definitely that the fs_loader driver is 32- (or 64-) byte-aligned
<Forty-Bot>
and this is caused by the DM_DRIVER_GET in get_fs_loader
<tlwoerner>
marex: yes, i've printf()'ed up this board's arch/arm/mach-rockchip/spl-boot-order.c → spl_node_to_boot_device() and i see my statements getting hit, so i know i'm in the correct place
<tlwoerner>
i've tweaked the u-boot,spl-boot-order to be: "same-as-spl", &sdmmc;
<tlwoerner>
the code iterates through this list, but for each entry (/mmc@ff480000 and /dwmmc@ff480000) it says "could not find X in FDT"
<Tartarus>
Do you _know_ it has found the FDT for real?
<Tartarus>
I'd maybe do a few checks in that direction (can you find some other node you _know_ must be there, etc)
<tlwoerner>
Tartarus: are there 2 different FDTs for SPL vs full U-Boot?
<tlwoerner>
in any case, at the end of that function is a check and if nothing is found, i can play with which boot device to try
<marex>
tlwoerner: well kind-of
<tlwoerner>
i've hard-coded trying both MMC1 and MMC2 and in both cases i get:
<marex>
tlwoerner: but I think Tartarus question was rather whether you are sure the SPL is processing the correct DT at all
<tlwoerner>
spl: could not initialize mmc. error: -19
<tlwoerner>
marex: i'm trying to guess which node would be a good one to try and would rather not try a bunch that wouldn't be in the SPL's FDT
<marex>
tlwoerner: check your build output, there should be some spl/u-boot-spl.dtb
<marex>
tlwoerner: inspect the output, is the mmc node there ?
<tlwoerner>
marex: nice! good idea
<tlwoerner>
nice! it's not there. ff480000 is not in the spl FDT, but ff490000 is there (which is the onboard emmc, which this board does not have)
<tlwoerner>
how do i get the ff480000 entry to be included in the SPL's FDT (and maybe remove the ff490000 one)?
<Forty-Bot>
and the solution is to add __aligned(4) to the ll_entry_get access
<Forty-Bot>
the real question is how I got lucky with fs_loader in the first place...
<tlwoerner>
is there a u-boot tag i can add to the node to get it included in the SPL's FDT?
<Tartarus>
Forty-Bot: Can you throw that change at CI in Azure please? I wonder a tiny bit about LTO/LLVM
<Forty-Bot>
the alignment one?
<Forty-Bot>
also: maybe we should have __aligned(sizeof(void *)) ?
<f_>
<tlwoerner> Tartarus: are there 2 different FDTs for SPL vs full U-Boot?
<f_>
Sort-of.
<f_>
In the SPL build the DT is cut down to minimum
<f_>
See doc/develop/spl.rst 'Device tree'
<f_>
Only mandatory nodes and nodes with bootph-all/bootph-pre-ram are left intact
persmule has joined #u-boot
<tlwoerner>
thanks
<f_>
Np
<f_>
mainline U-Boot SPL on amlogic coming soon ;)
<Tartarus>
Yeah the alignment one
<Tartarus>
I recall some slight problem with LTO and/or clang and the lists
<Tartarus>
Just want to be sure it doesn't get tripped up
<Forty-Bot>
ok
dsimic has quit [Changing host]
dsimic has joined #u-boot
<Kwiboo>
tlwoerner: your board is a rk3308? sdmmc node already have bootph-all prop in rk3308-u-boot.dtsi, are you missing a status=okay on your sdmmc node? or you may need to add a board -u-boot.dtsi and include soc -u-boot.dtsi
<f_>
and for reference I also pasted the output of aarch64-gcc --version and hostcc gcc --version
<f_>
hostcc isn't really necessary tbh though
<f_>
(by which I mean, didn't really need to paste output of hostcc)
<f_>
I don't really feel like LTO's going to stay by default either
<f_>
LTO is a nice temporary solution to the size limit but I think it would be nice to shrink the size of SPL to the point where LTO isn't needed anymore for compiling to succeed.
<f_>
That issue in the RFC could by caused by LTO, not sure
<f_>
still need to investigate further
<f_>
For now I'm cleaning up some code for easier gxl porting
Stat_headcrabed has joined #u-boot
<Kwiboo>
the issue was still pressent with/without LTO when I tested, only using -O1 or -fno-peephole2 flag fixed the issue for me, or use of uint to remove the alignement hole
<f_>
hmm
<Forty-Bot>
so maybe the bug is that get_fs_loader should use DM_DRIVER_REF and not DM_DRIVER_GET?
<Tartarus>
Entirely different problem, wow
<Tartarus>
But, yeah
<Tartarus>
CI is important for generic changes :)
<f_>
Kwiboo: so I'll let others chime in :)
<Forty-Bot>
but I feel like maybe DM_DRIVER_GET/REF is a footgun
<Forty-Bot>
like, maybe ll_entry_get should warn if the symbol is already declared
<f_>
I wonder why nobody got that bug in U-Boot proper
<f_>
or did it go unnoticed?
<Kwiboo>
yeah, super strange, possible a compiler bug, or cpu errata? but seeing same issue on cortex a53 and a55, cmd.cmdidx is one value before call to mmc_send_cmd_retry() and inside it instead has the same value as data.blocksize
<Kwiboo>
maybe the mixture of 32-bit and 64-bit register in "stp x21,w0,[sp, #data]" could cause the observed issue
<Xogium>
please tell me it is possible to format env variable a little ? Not stuff everything on the same line...
<Xogium>
this is unreadable with a screen reader
<Xogium>
like that for example
<Xogium>
bootcmd_stm32mp=echo "Boot over ${boot_device}${boot_instance}!";if test ${boot_device} = serial || test ${boot_device} = usb;then stm32prog ${boot_device} ${boot_instance}; else run env_check;if test ${boot_device} = mmc;then env set boot_targets "mmc${boot_instance}"; fi;if test ${boot_device} = nand || test ${boot_device} = spi-nand ;then env set boot_targets ubifs0; fi;if test ${boot_device} = nor;then
<Xogium>
env set boot_targets mmc0; fi;run distro_bootcmd;fi;
<Xogium>
this is nearly impossible to parse
<f_>
You use a screen reader?
<Xogium>
yes
<Xogium>
and right now, I wish we could like, put one if/fi on multiple lines
<Xogium>
like it is doable in a boot script
<Xogium>
because ugh
<Xogium>
at some point I'm fairly sure this becomes unreadable even when you have working eyes
<Forty-Bot>
you can do it
<Forty-Bot>
but people generally don't because the newline is longer to type than a space
<Forty-Bot>
and there is already a newline in the config header
<f_>
Xogium: pretty unreadable to me too
<Xogium>
Forty-Bot: so I could store a full script in the env on multiple lines ?
<Forty-Bot>
yes
<Forty-Bot>
it will parse fine
<Xogium>
as long as I do proper quoting, I assume
<Xogium>
setenv even adds \ for you and all, that's nice
dsimic has quit [Quit: Going offline for now]
dsimic has joined #u-boot
Stat_headcrabed has quit [Quit: Stat_headcrabed]
GNUtoo has quit [Remote host closed the connection]
GNUtoo has joined #u-boot
mmu_man has quit [Ping timeout: 252 seconds]
qqq has joined #u-boot
f_ has quit [Ping timeout: 255 seconds]
Clamor has joined #u-boot
Clamor has quit [Quit: Quit]
mmu_man has joined #u-boot
mmu_man has quit [Read error: Connection reset by peer]
mmu_man has joined #u-boot
GNUtoo has quit [Ping timeout: 252 seconds]
GNUtoo has joined #u-boot
vagrantc has joined #u-boot
<tlwoerner>
Kwiboo: yes, the rock-pi-s (rk3308) i'm pretty sure the sdmmc node is not present in the SPL's FDT
<tlwoerner>
i have the cheapest rock-pi-s of the family, the one that doesn't have emmc
<tlwoerner>
but i'll give the suggestions here a whirl and see where it goes
<tlwoerner>
Kwiboo: it's almost like we need to split the device tree into 2: one for the devices with emmc, and one for those that don't have emmc
<tlwoerner>
because all the emmc definitions in the device-tree are not valid for my rock-pi-s
<Kwiboo>
tlwoerner: I have a rock-pi-s v1.3 with sd card and nand storage that I can test on, building latest u-boot master with rock-pi-s-rk3308_defconfig show both emmc and sdmmc node in spl/u-boot-spl.dtb
<tlwoerner>
Kwiboo: aha, yes i see that in the code. i've been testing with v2023.07.02
<tlwoerner>
(which doesn't have the bootph-all for sdmmc)
<tlwoerner>
i've been using the rk3308_ddr_589MHz_uart0_m0_v1.26.bin from rockchip's rkbin as my TPL
<tlwoerner>
which is an older release. it's too bad they got rid of the "uart0" with the newer releases
<tlwoerner>
does anyone know what the "m0" vs "m1" means?
<tlwoerner>
i'll setup a test with master, but fwiw tweaking 2023.07.02 to add the bootph-all for sdmmc gets a little further. it now finds the node but then complains:
<tlwoerner>
unable to select a mode
<tlwoerner>
spl: mmc init failed with error: -524
<tlwoerner>
as they say: a different error message still represents progress ;-)
<tlwoerner>
Kwiboo: wonderful! using master u-boot worked like a charm, no patches required
<tlwoerner>
i seem to have a console issue with the Linux kernel. the heartbeat led is blinking happily, but there's no console on uart0
<tlwoerner>
perhaps it's on uart2?
gsz has quit [Ping timeout: 255 seconds]
<tlwoerner>
w00T!!! w00T!
<tlwoerner>
there it is, brilliant! thanks for the help everyone