On Wed, Sep 24, 2025 at 11:09:16AM +0200, Yegor Yefremov wrote: > HI all, > > trying to boot using the latest master, I get the following error: > > U-Boot SPL 2025.10-rc4 (Sep 23 2025 - 16:45:07 +0200) > Trying to boot from NAND > Error: -5 > SPL: failed to boot from all boot devices (err=-5) > ### ERROR ### Please RESET the board ### > > It turns out that bl_len will be set to 0 in spl_nand_read(): > > spl_set_bl_len(load, nand_page_size()); > > This sets the aligned image size to 0 in _spl_load(): > > size = ALIGN(spl_image->size + overhead, spl_get_bl_len(info)); > > Looks like FIT images with full FIT support will be also affected: > > read = info->read(info, offset, > ALIGN(size, spl_get_bl_len(info)), > buf); > > If I manually set bl_len to 1, I can boot without an issue. What am I missing?
I wonder if this has always been an underlying problem. Looking at drivers/mtd/nand/raw/am335x_spl_bch.c we've always had nand_page_size() return nand_to_mtd(&nand_chip)->writesize and I assume that should have been being set to CONFIG_SYS_NAND_PAGE_SIZE but I don't see that as the case. If you change nand_page_size to just return CONFIG_SYS_NAND_PAGE_SIZE or nand_init to set writesize to CONFIG_SYS_NAND_PAGE_SIZE does it then work again? -- Tom
signature.asc
Description: PGP signature

