Chasing Rock64 MMC bug

Howdy I am chasing a bug with FreeBSD on RELEASE >13.0

When booting off the removable eMMC module it now fails at bootup. On 13.0 It was fine.

I have a little clue with kernel backtrace error now.

/usr/src/sys/dev/mmc/host/dwmmc.c:368

So hunting that down I don't see any error. Do you?
Code:
dwmmc_tasklet(struct dwmmc_softc *sc)
{
        struct mmc_command *cmd;

        cmd = sc->curcmd;
        if (cmd == NULL)
                return;

        if (!sc->cmd_done)
                return;

        if (cmd->error != MMC_ERR_NONE || !cmd->data) {
                dwmmc_next_operation(sc);
        } else if (cmd->data && sc->dto_rcvd) {
                if ((cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK ||
                     cmd->opcode == MMC_READ_MULTIPLE_BLOCK) &&
                     sc->use_auto_stop) {
                        if (sc->acd_rcvd)
                                dwmmc_next_operation(sc);
                } else {
                        dwmmc_next_operation(sc);
                }
        }
}

The offending line is this:

if ((cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK ||

I have the nagging suspicion that something is turning off the emmc power on bootup.

mmc0 EXT_CLD not found

Is the last thing on screen before crash. I really believe it is a dtb problem.

Does anybody have any knowledge of what emmc.dtbo does?
I have seen this overlay on some systems but not this one.
It is not a gnu one but FreeBSD overlay I believe like the rpi-spigen.dtbo

extcld seems to have something to do with the emmc5.0 spec.

I am out of my league trying to scratch two sticks together.

What I do know on Hummingboard eMMC need some loader quirks at one point in time.
 
OK My bad totally.

When this issue first cropped up I had tried to do FreeBSD update on the board. On reboot it failed.
Undetermined I flashed the RELEASE-13.1 ROCK64 Image to eMMC as I have good backups.
That failed too. Same place.

Well today I get to looking and the u-boot on the eMMC is June 2021. That can't be right I flashed an image to it.
Anyway u-boot now at Jan 2023 after manually updating and bootup error has changed.
rtsc blah blah blah. rockchip thermal sensor ....crash

So I am marking this solved. Goal line has changed.

Lesson learned. Never assume the u-boot version installed. Always check.
 
OK Well I was wrong. It is the eMMC and it is power issue.
I switched to FreeBSD-CURRENT for testing what works. 13.1-RELEASE Failed even with newer u-boot.
There it was. A regulator shutting down power:
Code:
GEOM: new disk mmcsd0
GEOM: new disk mmcsd0boot0
GEOM: new disk mmcsd0boot1
Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
regulator: shutting down unused regulators
mmcsd0: Error indicated: 4 Failed
regulator: shutting down vcc_sd... busy
mmcsd0: Error indicated: 4 Failed
uhub3: 1 port with 1 removable, self powered
uhub2: 2 ports with 2 removable, self powered
uhub1: 1 port with 1 removable, self powered
uhub0: 1 port with 1 removable, self powered
random: unblocking device.
 
Scraped from Martinfillas wikipage for Asus Tinker Board with RK3288

Code:
Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
GEOM: new disk mmcsd0
regulator: shutting down unused regulators
mmc0: setting bus width to 4 bits high speed timing
regulator: shutting down vcc_sd... GEOM_PART: partition 1 on (mmcsd0, MBR) is not aligned on 4194304 bytes
GEOM_PART: partition 2 on (mmcsd0, MBR) is not aligned on 4194304 bytes
GEOM_PART: partition 1 on (mmcsd0s2, BSD) is not aligned on 4194304 bytes

So shutting down un-needed regulators is normal. It appears my ROCK64 is shutting down the wrong ones.
 
Hello -- I realize this is an old thread, I hope that's okay.

I just tried FreeBSD 14, both RELEASE and STABLE (15-Feb-2024), from an eMMC on my Rock64 and I'm still unable to boot. Booting from SD worked fine.
Before I found your thread, I posted here:
Boot FreeBSD 14 Pine64 Rock64 image from eMMC

Any progress in your investigation? Anything I can do to help investigate with FreeBSD 14?

Thanks.
 
Back
Top