Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2025.04, v2025.07-rc1 are OUT / Merge Window is CLOSED, next branch is CLOSED / Release v2025.07 is scheduled for 07 July 2025 / Channel archives at https://libera.irclog.whitequark.org/u-boot
slobodan has quit [Ping timeout: 248 seconds]
naoki has joined #u-boot
qschulz has quit [Remote host closed the connection]
qschulz has joined #u-boot
<matthewcroughan> What is the maximum allowable size for a FIT image loaded in SPL?
<matthewcroughan> 0x40000 for the rockchip 3588 it looks like
<Forty-Bot> it's however much you can fit in DRAM
<matthewcroughan> Yeah how do I figure out how much is available for a board?
<matthewcroughan> I have a 20~MiB fit image that I was wanting to boot in SPL mode
<matthewcroughan> Might be too big, but it's my first time trying to use falcon mode for any board
<matthewcroughan> I end up with "Could not get FIT buffer of 25332224 bytes check CONFIG_SPL_SYS_MALLOC_SIZE"
<Forty-Bot> generally the amount of DRAM is printed when U-Boot runs
<Forty-Bot> oh yeah FITs are malloc'd before being read
jclsn has quit [Ping timeout: 272 seconds]
jclsn has joined #u-boot
<matthewcroughan> Forty-Bot so is the solution to not use Fit and just use legacy kernel stuff?
<Forty-Bot> the solution is right there in the error message
<Forty-Bot> increase SPL_SYS_MALLOC_SIZE
<matthewcroughan> Oh, I haven't been able to change that error by setting that
<matthewcroughan>  Forty-Bot Yeah I just confirmed, setting it doesn't change anything about the log, wonder why
<Forty-Bot> what did you set it to
<matthewcroughan> Forty-Bot; CONFIG_SPL_SYS_MALLOC_SIZE=0x300000
<matthewcroughan> I looked at the default which was 3x less
<matthewcroughan> I bumped it to see if I could change the values in the error, and it didn't
<Forty-Bot> you need to set it to at least 0x10000000
<Forty-Bot> based on the error message
<Forty-Bot> oh, whoops made a typo
<Forty-Bot> should be at least 0x2000000
<Forty-Bot> aka 32 MiB
<matthewcroughan> Ah 32 is the size of my partition exactly, but the fit image is smaller inside of that
<matthewcroughan> so it allocs for the whole partition?
<Forty-Bot> no, it allocs 25,332,224 bytes
<Forty-Bot> the size of the FIT
<matthewcroughan> Yeah I set it to this but it still doesn't change the error, something is not being applied in Kconfig somewhere I guess
<matthewcroughan> CONFIG_SPL_SYS_MALLOC is y
<Forty-Bot> do you have CONFIG_SPL_SYS_MALLOC_SIMPLE enabled
<matthewcroughan> Yeah
<Forty-Bot> disable it
<matthewcroughan> 🫡
<matthewcroughan> Hmm, this also has not changed anything Forty-Bot
* Forty-Bot doesn't have emojis enabled in irc
<Forty-Bot> oh, well worth a shot
<matthewcroughan> Just render them in your mind :D
<Forty-Bot> if you think it's a kconfig problem, you can try changing the debug in mem_malloc_init into a printf
<Forty-Bot> and verify that the arena is the right size
<matthewcroughan> Forty-Bot: Maybe you can see me doing something obviously wrong here, don't laugh at me https://termbin.com/fxad
<matthewcroughan> You see I"m just writing this stuff out manually to try to figure out falcon mode
<Forty-Bot> ok, so you actually have a very helpful error message right above the FIT one
<Forty-Bot> if you grep for it, you can se it's caused by gd->malloc_limit being too low
<matthewcroughan> Derp, yes, that's the value I was trying to change, I thought they were related
<Forty-Bot> and if you grep for that, you can see it's set in common/spl/spl.c
<matthewcroughan> SYS_MALLOC_F_LEN ?
<matthewcroughan> Or is it SPL_SYS_MALLOC_F_LEN
<matthewcroughan> I have tried changing both, but couldn't get the value of 200000 to change
<Forty-Bot> so in U-Boot there's pre-relocation (_f) and pos-relocation (_r)
<Forty-Bot> in SPL there's no relocation; it just refers to when DRAM is available
<Forty-Bot> all the SYS_MALLOC_F stuff is pre-relocation
<Forty-Bot> the goal is to get the board_init_r malloc init stuff to run
<matthewcroughan> it may be that _DM was disabled
<Forty-Bot> no, that shouldn't be it
<matthewcroughan> just went through all the kconfig then, I had DM=n
<Forty-Bot> try putting `#define DEBUG` at the top of common/spl/spl.c
<Forty-Bot> and converting that debug to a printf in mem_malloc_init
<matthewcroughan> SYS_MALLOC_F_LEN depends on SYS_MALLOC_F
<Forty-Bot> make sure it gets called
<matthewcroughan> SYS_MALLOC_F default y if DM
<Forty-Bot> because DM needs malloc pre-relocation
<Forty-Bot> but if you don't have DM enabled you might not need it
<Forty-Bot> it depends on your board
mmu_man has quit [Ping timeout: 245 seconds]
<matthewcroughan> Okay I finally got it to change
<matthewcroughan> Now it just sits there hanging at fdt_root: FDT_ERR_BADMAGIC
<Forty-Bot> congrats
<matthewcroughan> I think it was CONFIG_SPL_SYS_MALLOC_SIMPLE
<Forty-Bot> that error probably means you have the wrong offset somewhere
<matthewcroughan> Forty-Bot: SYS_MMCSD_RAW_MODE_ARGS_SECTOR config option says "Note that if using a FIT image, this and the next option can be set to 0x0."
<matthewcroughan> but when I do set those options to 0x0, I get a compile error saying SYS_MMCSD_RAW_MODE_ARGS_SECTOR is uninitialized
<Forty-Bot> don't use raw mode?
<matthewcroughan>  Don't I need raw mode for falcon mode?
<Forty-Bot> I don't think so
<matthewcroughan> I don't know how to not use raw mode, that isn't documented
<Forty-Bot> CONFIG_SPL_FS_EXT4
<Forty-Bot> and CONFIG_SYS_MMCSD_FS_BOOT
<Forty-Bot> see e.g. spl_load_image_ext_os
<Forty-Bot> IMO you should never use raw mode unless you don't have space for ext4 in SPL
<matthewcroughan> Doesn't it save a hundred ms or so though?
<Forty-Bot> idk; I haven't measured it
<Forty-Bot> if you really need the speed then use the raw partition mode
<matthewcroughan>  Is there more SPL boot documentation I can read anywhere? Nothing I've read uses the EXT4/FS stuff, only raw mode
<Forty-Bot> youn have to read the source :l
<matthewcroughan> And it wants to be ext4 right? Not fat?
<Forty-Bot> you can use fat too
<Forty-Bot> but I like filesystems that don't get corrupted after you sneeze
<matthewcroughan> I am a bit confused about the function of the args though when you're doing FIT/SPL
<matthewcroughan> I wanted to continue using raw mode because it's what i can find examples of, though the Kconfig seems wrong that you can set it to 0x0
<Forty-Bot> ask marex
<Forty-Bot> I've never personally used falcon mode
LeSpocky has quit [Ping timeout: 260 seconds]
LeSpocky has joined #u-boot
KREYREN_ has joined #u-boot
<matthewcroughan> these are good docs actually Forty-Bot
<Forty-Bot> thank xypron
<matthewcroughan> Forty-Bot do I understand correctly that if I use SPL/Fat I can just set CONFIG_SPL_FS_LOAD_PAYLOAD_NAME=”<filepath>” where <filepath> is a .itb (fit image) and it should just work?
<Forty-Bot> yeah
<matthewcroughan> then if I want to save milliseconds later I can try to do it hardcore with addresses and math
<matthewcroughan> Does it just use the first fat partition it sees then?
<Forty-Bot> it uses the first bootable partition
<Forty-Bot> or you can set CONFIG_SYS_MMCSD_FS_BOOT_PARTITION
<Forty-Bot> see spl_mmc_do_fs_boot
<matthewcroughan> Do I have to disable stuff like OS_BOOT and the other falcon boot stuff that I've been touching?
<matthewcroughan> I.e do they interfere?
<Forty-Bot> if there's no args file you'll just fall back to the regular boot flow
<matthewcroughan> args file? is that documented somewhere
<matthewcroughan> it's not on that page
<Forty-Bot> CONFIG_SPL_FS_LOAD_ARGS_NAME
<matthewcroughan> uEnv.txt by default I'm guessing?
<matthewcroughan> checking..
<matthewcroughan> Ah so it's just a file called `args`
<matthewcroughan> `uboot-rock> Address in memory to load 'args' file for Falcon Mode to (SPL_PAYLOAD_ARGS_ADDR) [] (NEW)`
<matthewcroughan> I wonder why this is a problem that it is unset
<matthewcroughan> Ah I had OS_BOOT set to y
<matthewcroughan> hmm no, it still wants it
<matthewcroughan> Oh.. lol, I had it set twice
<Forty-Bot> > had it set twice
<Forty-Bot> you *are* using menuconfig, right?
<matthewcroughan> nope :D
<Forty-Bot> use it
<Forty-Bot> it's very convenient
<Forty-Bot> you can use savedefconfig if you want to generate a config file
<matthewcroughan> This gives me an idea
<matthewcroughan> A web browser ncurses interfaces that lets you do this to anyone's git repo of u-boot, just to make a config file
<matthewcroughan> I'll make this some other day
kiboneu has quit [Ping timeout: 252 seconds]
haritz has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
matthewcroughan has quit [Ping timeout: 240 seconds]
sng has quit [Ping timeout: 248 seconds]
sng has joined #u-boot
sng has quit [Changing host]
sng has joined #u-boot
matthewcroughan has joined #u-boot
cbmuser has quit [Ping timeout: 248 seconds]
cbmuser has joined #u-boot
wbx has quit [Ping timeout: 272 seconds]
wbx has joined #u-boot
monstr has joined #u-boot
goliath has joined #u-boot
frieder has joined #u-boot
<matthewcroughan> Forty-Bot Okay so I have SPL_MMC, SPL_FS_FAT, SPL_FS_LOAD_PAYLOAD_NAME, SYS_MMCSD_FS_BOOT_PARTITION, SPL_FS_LOAD_ARGS_NAME, but SPL doesn't touch anything
<matthewcroughan> Maybe I'm missing some other option? I turned off OS_BOOT/Falcon related stuff, was that wrong to do?
<dormito> I've notice that patches to configs/ files seem to have one of two "subject line" formats "configs: ${defconfig}" or "${arch}: ${cpu-family}: ${board}:". what, if any, are the criteria for selecting the correct one?
<dormito> err "commits" would be a better word than "patches"
pgreco has joined #u-boot
pgreco_ has quit [Ping timeout: 252 seconds]
<matthewcroughan> Forty-Bot: the more I read this, the more I think it is not possible what you suggested me to do
<matthewcroughan> SPL_OS_BOOT means falcon mode, which means raw, which means no FS
<matthewcroughan> But at the same time those options by their names make it seem like you can just tell SPL to load from a partition, but I cannot make this happen
<matthewcroughan> Or am I just expected to hold a custom board init patch?
KREYREN_ has quit [Ping timeout: 264 seconds]
rvalue- has joined #u-boot
rvalue has quit [Read error: Connection reset by peer]
blackbox has joined #u-boot
enok has joined #u-boot
rvalue- is now known as rvalue
blackbox has quit [Ping timeout: 252 seconds]
blackbox has joined #u-boot
kevery1 has joined #u-boot
kevery has quit [Ping timeout: 268 seconds]
kevery1 is now known as kevery
ldevulder has joined #u-boot
ldevulder has quit [Remote host closed the connection]
blackbox has quit [Ping timeout: 245 seconds]
sszy has joined #u-boot
enok has quit [Ping timeout: 252 seconds]
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
matthewcroughan has quit [Ping timeout: 240 seconds]
enok has joined #u-boot
blackbox has joined #u-boot
mckoan|away is now known as mckoan
enok has quit [Quit: enok]
enok71 has joined #u-boot
kilobyte_ch has quit [Ping timeout: 244 seconds]
enok71 is now known as enok
<f_> matthewcroughan: SPL does not necessarily imply raw.
<f_> You *can* make it load firmware from a FAT/ext4 partition just fine, would be surprised if you couldn't do it with the kernel.-
blackbox has quit [Ping timeout: 244 seconds]
kilobyte_ch has joined #u-boot
Poltawer has joined #u-boot
blackbox has joined #u-boot
enok71 has joined #u-boot
enok has quit [Read error: Connection reset by peer]
enok71 is now known as enok
enok71 has joined #u-boot
enok has quit [Read error: Connection reset by peer]
enok71 is now known as enok
enok has quit [Read error: Connection reset by peer]
enok has joined #u-boot
blackbox has quit [Ping timeout: 276 seconds]
enok has quit [Quit: enok]
blackbox has joined #u-boot
rvalue has quit [Read error: Connection reset by peer]
enok has joined #u-boot
rvalue has joined #u-boot
rvalue- has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
rvalue has quit [Ping timeout: 260 seconds]
rvalue- is now known as rvalue
blackbox has joined #u-boot
enok71 has joined #u-boot
enok has quit [Ping timeout: 268 seconds]
enok71 is now known as enok
enok71 has joined #u-boot
enok has quit [Ping timeout: 248 seconds]
enok71 is now known as enok
naoki has quit [Ping timeout: 248 seconds]
enok has quit [Remote host closed the connection]
enok has joined #u-boot
blackbox has quit [Ping timeout: 276 seconds]
slobodan_ has joined #u-boot
enok has quit [Changing host]
enok has joined #u-boot
slobodan_ has quit [Read error: Connection reset by peer]
enok has quit [Quit: enok]
enok has joined #u-boot
mmu_man has joined #u-boot
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
prabhakalad has quit [Ping timeout: 244 seconds]
prabhakalad has joined #u-boot
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
davlefou has quit [Ping timeout: 248 seconds]
davlefou_ has quit [Ping timeout: 248 seconds]
davlefou has joined #u-boot
davlefou_ has joined #u-boot
naoki has joined #u-boot
naoki has quit [Client Quit]
Poltawer has quit [Ping timeout: 265 seconds]
Poltawer has joined #u-boot
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 265 seconds]
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 244 seconds]
Poltawer has quit [Quit: WeeChat 4.6.2]
blackbox has joined #u-boot
<kcxt> How do we feel about printing TEE version info in ufetch? :P https://social.treehouse.systems/@cas/114466709863046605
monstr has quit [Read error: Connection reset by peer]
enok71 has joined #u-boot
enok has quit [Ping timeout: 252 seconds]
enok71 is now known as enok
monstr has joined #u-boot
blackbox has quit [Ping timeout: 260 seconds]
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 248 seconds]
<marex> kcxt: like one dependency I would like to not have in U-Boot ... dependncy on another non-free-software blob
enok has quit [Quit: enok]
enok has joined #u-boot
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
enok has quit [Remote host closed the connection]
enok has joined #u-boot
mripard has joined #u-boot
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
pgreco has quit [Ping timeout: 245 seconds]
blackbox has joined #u-boot
bjoto has quit [Ping timeout: 272 seconds]
enok has quit [Ping timeout: 260 seconds]
enok has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
dsimic has quit [Ping timeout: 268 seconds]
dsimic has joined #u-boot
frieder has quit [Remote host closed the connection]
<f_> TEE doesn't have to be proprietary, marex
<f_> kcxt: how would this work if there's no TEE
mmu_man has quit [Ping timeout: 252 seconds]
vagrantc has joined #u-boot
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 244 seconds]
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
Stalevar has quit [Read error: Connection reset by peer]
enok has quit [Read error: Connection reset by peer]
enok has joined #u-boot
mckoan is now known as mckoan|away
Stalevar has joined #u-boot
matthewcroughan has joined #u-boot
blackbox has joined #u-boot
<matthewcroughan> f_ it seems to me that all the Kconfig options that relate to falcon boot, imply and force on raw mode
<matthewcroughan> All I want to do is have SPL use MMC/FAT to load a Fit image, but that seems like it is not achievable since it always enables various raw options.
<matthewcroughan> The docs at https://docs.u-boot.org/en/stable/usage/spl_boot.html make it seem like what I want is achievable, but I've not been able to achieve it.
monstr has quit [Remote host closed the connection]
blackbox has quit [Ping timeout: 252 seconds]
blackbox has joined #u-boot
blackbox has quit [Ping timeout: 252 seconds]
goliath has quit [Quit: SIGSEGV]
blackbox has joined #u-boot
matthewcroughan has quit [Quit: Client closed]
enok71 has joined #u-boot
enok has quit [Ping timeout: 248 seconds]
enok71 is now known as enok
enok71 has joined #u-boot
enok has quit [Ping timeout: 272 seconds]
enok71 is now known as enok
<f_> matthewcroughan: It should definitely be possible
blackbox has quit [Quit: WeeChat 4.6.2]
Eschik has quit [Remote host closed the connection]
Eschik has joined #u-boot
jfsimon has quit [Quit: Leaving]
jfsimon has joined #u-boot
matthewcroughan has joined #u-boot
<matthewcroughan> f_ you think there's a minimal example of doing it anywhere, or am I in uncharted territory?
enok has quit [Quit: enok]
slobodan has joined #u-boot
<matthewcroughan> f_: yeah I'm in menuconfig now, and it still doesn't allow me to avoid raw values
<matthewcroughan> https://termbin.com/mps0
<matthewcroughan> I just wanted to load a FIT image but it seems incompatible with what is provided in Kconfig despite various docs suggesting you can use a FIT image
<f_> Perhaps leave those empty?
<matthewcroughan> Okay so if I leave those empty, what other Kconfig options should I be looking at?
<matthewcroughan> I.e to tell it what ITB to load, and what partition it is on, etc
<matthewcroughan> Wait, SPL_BOOTSTD is a thing? O.o
<matthewcroughan> yeah no, you are not allowed to leave `SPL_PAYLOAD_ARGS_ADDR` blank
<matthewcroughan> SPL_OS_BOOT ultimately enables all the raw mode options and requires they be set
<matthewcroughan> SPL_BOOTSTD only exists in one Kconfig file and is not referenced anywhere
<matthewcroughan> weird
mmu_man has joined #u-boot
slobodan has quit [Quit: Leaving]
<marex> matthewcroughan: did you look at common/spl/spl.c to see how the OS_BOOT is tied into that ?
<marex> matthewcroughan: the OS_BOOT is basically only a follow up stage to the load stages
goliath has joined #u-boot
matthewcroughan has quit [Ping timeout: 240 seconds]
matthewcroughan has joined #u-boot
matthewcroughan has quit [Quit: Client closed]
matthewcroughan has joined #u-boot
vagrantc has quit [Quit: leaving]