Posts by msubasic

    I hit the same hang with LibreELEC 12.2.1 on a Banana Pi M2 Ultra (R40) and tracked it down with the serial console and FEL. Serial output, then nothing:

    Code
    U-Boot SPL 2025.07 (Nov 01 2025 - 06:09:49 +0000)
    DRAM: 2048 MiB
    Trying to boot from MMC1

    The same image boots fine with the U-Boot 2024.01 from 12.0.2.

    Cause: U-Boot 2025.07 contains commit 358d1cc232c3 ("spl: Align FDT load address"), so the SPL now puts the device tree at the end of U-Boot proper rounded up to 8 bytes. U-Boot proper (OF_SEPARATE) still looks for it exactly at _end, which 2025.07 doesn't align. In the 12.2.1 build for this board U-Boot is 367164 bytes (4 more than a multiple of 8), so U-Boot proper finds no device tree and hangs before its serial console starts. That's why nothing at all is printed after the SPL. 2024.01 isn't affected (its U-Boot is 359920 bytes and its SPL doesn't round). Whether a board is hit depends on its U-Boot size, so other 32-bit Allwinner boards may or may not be affected.

    Verified over FEL: LibreELEC's own 12.2.1 U-Boot boots when the device tree is placed exactly at _end, and hangs with no output when it's placed 4 bytes higher (where the 2025.07 SPL puts it).

    Fix: upstream fixed it in commit 8b0ebe054bb3 ("arm: Update linker scripts to ensure appended device tree is aligned", in U-Boot v2026.04 and later). LibreELEC master already uses U-Boot 2026.10, which works on my board. For 12.2 the backport is two lines in the linker scripts (. = ALIGN(8); before _end). With it, a real SD boot of 12.2.1 works. I've opened a GitHub issue with the patch: https://github.com/LibreELEC/LibreELEC.tv/issues/11966

    Workaround until then: write the 12.2.1 image to the SD card, then replace its bootloader with the one from the 12.0.2 image (both have the first partition at 4 MiB, the bootloader area is 8 KiB to 4 MiB). On Linux, with the card as /dev/sdX (check with lsblk!):

    Code
    gunzip -c LibreELEC-R40.arm-12.0.2-bananapi-m2u.img.gz | dd of=uboot-12.0.2.bin bs=1k skip=8 count=4088
    sudo dd if=uboot-12.0.2.bin of=/dev/sdX bs=1k seek=8 conv=fsync

    That's what my board runs now (12.2.1, from eMMC, with U-Boot 2024.01).

    Hi,

    on my Banana Pi BPI-M2 Ultra, LibreELEC runs fine from SD, but any sustained read from the eMMC fails within half a second:

    Code
    sunxi-mmc 1c11000.mmc: data error, sending stop command
    sunxi-mmc 1c11000.mmc: send stop command failed

    After that the eMMC host hangs (the reading process is stuck in D state). A warm reboot doesn't bring the eMMC back (fatal err update clk timeout, Failed to initialize a non-removable card), only a cold power-off does.

    Cause: the eMMC node (/soc/mmc@1c11000) in sun8i-r40-bananapi-m2-ultra.dtb has no max-frequency, so the card runs 8-bit DDR52 at 50 MHz, which isn't stable on this board.

    Fix: max-frequency = <40000000> on that node (the driver rounds it to 37.5 MHz). 8-bit and DDR52 stay on. I tested the clock live via /sys/kernel/debug/mmcN/clock first, then in the device tree:

    eMMC clockResult
    50 MHz (stock)fails within 0.5 s, reproducible
    37.5 MHz (max-frequency = <40000000>)pass: 33 min soak (6× full 7.3 GB read + 256 MB write/sha256 verify at 8 offsets), 0 errors
    25 MHzpass (full read)

    LibreELEC 12.2.1 now runs from the eMMC with this fix: read ~61 MB/s, write ~25 MB/s (the SD card manages 23 MB/s read), another 15 min soak with 0 errors, and cedrus HW decoding works.

    I apply it as a device-tree overlay, so it survives updates (an update replaces the dtb, but not a custom overlay or extlinux.conf). The overlay:

    Compile it on a PC (device-tree-compiler package), copy it to /flash and load it from extlinux.conf:

    Code
    dtc -@ -I dts -O dtb -o m2u-emmc-40mhz.dtbo m2u-emmc-40mhz.dts
    scp m2u-emmc-40mhz.dtbo root@<board>:/tmp/
    ssh root@<board>
    mount -o remount,rw /flash
    mkdir -p /flash/overlays && cp /tmp/m2u-emmc-40mhz.dtbo /flash/overlays/
    nano /flash/extlinux/extlinux.conf     # add the FDTOVERLAYS line below right after the FDT line
    sync; mount -o remount,ro /flash; reboot
    Code
      FDT /sun8i-r40-bananapi-m2-ultra.dtb
      FDTOVERLAYS /overlays/m2u-emmc-40mhz.dtbo

    Check after the reboot: cat /proc/device-tree/soc/mmc@1c11000/m2u-emmc-fix prints overlay 40MHz, and cat /sys/kernel/debug/mmcN/ios (after mount -t debugfs none /sys/kernel/debug) shows actual clock: 37500000 Hz, bus width: 3 (8 bits), timing spec: 8 (mmc DDR52).

    eMMC chip: Samsung 8WPD3R (manfid 0x15, eMMC 5.0, 08/2016). The same error is reported on Armbian for this board (topic 28215 on forum.armbian.com, a Samsung 8GTF4R there) and on the Banana Pi forum, so it's not just my unit.

    Would you consider adding max-frequency = <40000000>; to the eMMC node for the M2U in LibreELEC (or upstream)? I'm happy to test images.

    Note: the 12.2.x images don't boot on this board at all because of a separate U-Boot 2025.07 bug (hang after "Trying to boot from MMC1"). I found the cause and a fix, see my reply in thread 29908. On my board I use the 12.2.1 image with the U-Boot from 12.0.2 for now.