Cold boot consistently fails to load file from SD

Mauro Condarelli mc5686 at mclink.it
Sat Sep 19 15:39:03 CEST 2020


Hi,
I'm facing a new problem for my Mt7628/vocore2 target.

I moved the Linux kernel from a ext4 partition to the "proper" SquashFS partition (I say "proper" because I'm using a dual-system with fallback to avoid updating the currently working rootFS and kernel lies into rootFS).

I am using u-boot v2020.10-rc3 plus the attached patches (one pertains SquashFS).

Problem is a real cold boot (target off for more than one minute) leads to a load failure for the kernel. A warm boot ("reboot" from a running Linux) or a not-so-cold boot (turn target off and power it on again after a few seconds) seems to work as expected.

I tried to insert delays and/or "mmc rescan", but that does not seem to have any effect.
Also error message is not always the same; sometimes I get:

    Error: too many data blocks to be read.
    Failed to load '/boot/uImage'

other times:

    ** fs_devread read error - block
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **


My full environment is:

    BOOT_CURRENT=A
    SYSTEM_R=/dev/mtdblock5
    arch=mips
    baudrate=115200
    board=vocore2
    board_name=vocore2
    boot_a=echo "Loading System A";part=6;run boot_x
    boot_b=echo "Loading System B";part=7;run boot_x
    boot_now=if test "${BOOT_CURRENT}" = A; then run boot_a; elif test "${BOOT_CURRENT}" = B; then run boot_b; fi; if env exists BOOT_A_GOOD; then run boot_a; fi; if env exists BOOT_B_GOOD; then run boot_b; fi; run boot_r
    boot_r=echo "Loading Recovery"; setenv bootargs "${default_bootargs} mtdparts=${mtdparts} root=/dev/mtdblock5"; bootm bc050000
    boot_x=load mmc 0:${part} 85000000 /boot/uImage && setenv bootargs "${default_bootargs} mtdparts=${mtdparts} root=/dev/mmcblk0p${part}" && bootm ${fileaddr}
    bootcmd=run do_boot
    bootcount=1
    bootdelay=2
    cpu=mips32
    default_bootargs=earlyprintk rootwait console=ttyS2,115200
    do_boot=test ${bootcount} -gt 1 && run remove_boot; run boot_now
    fdtcontroladdr=86f6d340
    fileaddr=84000000
    filesize=154
    fupdate=mmc rescan && load mmc 0:1 84000000 uboot.scr && fatrm mmc 0:1 uboot.scr && source 84000000 && echo Flash updated || Flash update FAILED!
    mtdids=nor0=spi0.0
    mtdparts=spi0.0:312k(u-boot),4k(env),4k(factory),2368k(kernel),-(filesystem)
    remove_boot=if env exists BOOT_CURRENT; then setenv BOOT_CURRENT; saveenv; elif env exists BOOT_A_GOOD; then setenv BOOT_A_GOOD; saveenv; elif env exists BOOT_B_GOOD; then setenv BOOT_B_GOOD; saveenv; fi
    soc=mt7628
    stderr=uart2 at e00
    stdin=uart2 at e00
    stdout=uart2 at e00
    vendor=vocore
    ver=U-Boot 2020.10-rc3 (Sep 16 2020 - 19:43:03 +0200)


It was suggested (on IRC) it could be a cache problem. unfortunately trying to enable cache control (CONFIG_CMD_CACHE) raises error in compilation:

      ...
      LD      u-boot
    /home/valeria/MyProject/VoCore/Buildroot-2/recov/per-package/uboot/host/bin/mipsel-linux-ld.bfd: cmd/built-in.o: in function `do_icache':
    cmd/cache.c:(.text.do_icache+0x5c): undefined reference to `icache_disable'
    /home/valeria/MyProject/VoCore/Buildroot-2/recov/per-package/uboot/host/bin/mipsel-linux-ld.bfd: cmd/cache.c:(.text.do_icache+0x6c): undefined reference to `icache_enable'
    /home/valeria/MyProject/VoCore/Buildroot-2/recov/per-package/uboot/host/bin/mipsel-linux-ld.bfd: cmd/cache.c:(.text.do_icache+0x8c): undefined reference to `icache_status'
    Makefile:1753: recipe for target 'u-boot' failed
    make[2]: *** [u-boot] Error 1
    package/pkg-generic.mk:266 <http://pkg-generic.mk:266>: recipe for target '/home/valeria/MyProject/VoCore/Buildroot-2/recov/build/uboot-v2020.10-rc3/.stamp_built' failed
    make[1]: *** [/home/valeria/MyProject/VoCore/Buildroot-2/recov/build/uboot-v2020.10-rc3/.stamp_built] Error 2
    Makefile:23: recipe for target '_all' failed
    make: *** [_all] Error 2

and I have no idea how to fix this.

Any hint would be very welcome as this is a real show-stopper for me.

Thanks in Advance
Mauro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Small-fixes-to-reduce-size-and-ensure-correct-consol.patch
Type: application/x-patch
Size: 1406 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200919/9e453219/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Project-specific-ENV-initialization.patch
Type: application/x-patch
Size: 3165 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200919/9e453219/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fix-missing-__udivdi3-in-SquashFS-implementation.patch
Type: application/x-patch
Size: 6631 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200919/9e453219/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Enlarge-SPL-malloc-area-to-prevent-failure-in-lzma-d.patch
Type: application/x-patch
Size: 834 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200919/9e453219/attachment-0003.bin>


More information about the U-Boot mailing list