Jump to content

Cannot boot from EMMC storage on expresso bin


Recommended Posts

Hello,

[short version]

My expresso bin V5 only boots from the micro sd card and I would like it to boot from the EMMC module.

 

[long version]

My old old expresso bin V5 did not came with a pre installed EMMC module, I had a 16gb kingston EMMC module from aliexpress soldered onto it, the EMMC module is correctly detected by armbian bionic as seen from the output of blkid as /dev/mmcblk0p1:

/dev/mmcblk0p1: UUID="dc265376-877d-40a1-9417-7379fb332efe" TYPE="ext4" PARTUUID="36c210f9-01"
/dev/mmcblk1p1: LABEL="root" UUID="621decff-6765-4dbd-ae8c-c7e2d5c0193d" TYPE="ext4" PARTUUID="04b226a1-01"
/dev/mmcblk1p3: LABEL="home" UUID="df5bfbe2-de80-49b4-ac8f-2378fd736e4f" TYPE="ext4" PARTUUID="04b226a1-03"
/dev/zram0: LABEL="log2ram" UUID="1d15f838-3c4d-4acf-a58c-fde890ecdea9" TYPE="ext4"
/dev/mmcblk0: PTUUID="36c210f9" PTTYPE="dos"
/dev/mmcblk1: PTUUID="04b226a1" PTTYPE="dos"
/dev/zram1: UUID="c759b67d-75a8-4452-95a8-fe45f11d1e4c" TYPE="swap"

 

I can mount, read and write on /dev/mmcblk0p1, initially I ran armbian-config to install armbian on the EMMC module and it worked with a weird shortcoming, it would only boot from the EMMC module if a micro SD card was inserted on the board, I could tell right away from the "Usage of /:" field on the amrbian prompt from which storage device I had booted but I also checked the UUID on fstab and boot.cmd to make sure.

uboot threw an error message saying Card did respond to voltage select! whenever I tried to boot without a micro SD card on the expresso bin

 

From here on out what I did made matters much worse, I figured uboot was the problem and decided to update it to a newer version without backing up the on I had on the board from February 2019(stupid of me), so I downloaded and installed the lastest version I could find on  https://xogium.performanceservers.nl/archive/espressobin/u-boot/

 

Ever since I cannot boot from the EMMC module with or without a micro SD card on the expressobin and uboot does not detect it at all, since the following command only prints one device when it used to print 2:

Marvell>> mmc list
sdhci@d0000: 0

 

I'm still able to mount and write stuff to the EMMC storage while on bionic as before, but on uboot it's like it doesen't exist.

The uboot environment is like this:

Marvell>> env print
arch=arm
baudrate=115200
board=mvebu_armada-37xx
board_name=mvebu_armada-37xx
boot_a_script=ext4load ${boot_interface} ${devnum}:1 ${scriptaddr} ${prefix}boot.scr;source ${scriptaddr};
boot_interface=mmc
boot_prefixes=/ /boot/
boot_targets=usb sata mmc1 mmc0
bootargs=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=UUID=dc265376-877d-40a1-9417-7379fb332efe rootfstype=ext4 rootwait loglevel=1 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u mtdparts=spi0.0:1536k(uboot),64k(uboot-environment),-(reserved) 
bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootcmd_mmc0=setenv devnum 0; setenv boot_interface mmc; run scan_dev_for_boot;
bootcmd_mmc1=setenv devnum 1; setenv boot_interface mmc; run scan_dev_for_boot;
bootcmd_sata=setenv devnum 0; scsi scan; scsi dev 0; setenv boot_interface scsi; run scan_dev_for_boot;
bootcmd_usb=setenv devnum 0; usb start;setenv boot_interface usb; run scan_dev_for_boot;
bootdelay=2
console=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000
cpu=armv8
devnum=0
emmc_fix=on
eth1addr=06:8E:A0:24:0F:88
eth2addr=00:50:43:84:25:2f
eth3addr=00:50:43:0d:19:18
ethact=neta@30000
ethaddr=F0:AD:4E:03:64:7F
ethprime=eth0
extra_params=pci=pcie_bus_safe
fdt_addr=0x6000000
fdt_addr_r=0x6f00000
fdt_high=0xffffffffffffffff
fdt_name=fdt.dtb
fdt_name_a=dtb/marvell/armada-3720-community.dtb
fdt_name_b=dtb/marvell/armada-3720-espressobin.dtb
fdtcontroladdr=3f62d490
fileaddr=6d00000
filesize=ea
gatewayip=10.4.50.254
get_images=tftpboot $kernel_addr_r $image_name; tftpboot $fdt_addr_r $fdt_name; run get_ramfs
get_ramfs=if test "${ramfs_name}" != "-"; then setenv ramdisk_addr_r 0x8000000; tftpboot $ramdisk_addr_r $ramfs_name; else setenv ramdisk_addr_r -;fi
hostname=marvell
image_name=Image
initrd_addr=0x1100000
initrd_image=uInitrd
initrd_size=0x2000000
ipaddr=0.0.0.0
kernel_addr=0x7000000
kernel_addr_r=0x7000000
loadaddr=0x8000000
netdev=eth0
netmask=255.255.255.0
ramdisk_addr_r=0x8000000
ramfs_name=-
root=root=/dev/nfs rw
rootdev=UUID=dc265376-877d-40a1-9417-7379fb332efe
rootfstype=ext4
rootpath=/srv/nfs/
scan_dev_for_boot=for prefix in ${boot_prefixes}; do echo ${prefix};run boot_a_script; done
scriptaddr=0x6d00000
serverip=0.0.0.0
set_bootargs=setenv bootargs $console $root ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:none nfsroot=$serverip:$rootpath,tcp,v3 $extra_params $cpuidle
soc=mvebu
stderr=serial@12000
stdin=serial@12000
stdout=serial@12000
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
vendor=Marvell
verbosity=1

Environment size: 2655/65532 bytes

 

While booting, uboot throws these errors:

 

/
** Bad device usb 0 **
## Executing script at 06d00000
Wrong image format for "source" command
/boot/
** Bad device usb 0 **
## Executing script at 06d00000
Wrong image format for "source" command
scanning bus for devices...

Device 0: unknown device
/
** Bad device scsi 0 **
## Executing script at 06d00000
Wrong image format for "source" command
/boot/
** Bad device scsi 0 **
## Executing script at 06d00000
Wrong image format for "source" command
/
** Bad device mmc 1 **
## Executing script at 06d00000
Wrong image format for "source" command
/boot/
** Bad device mmc 1 **
## Executing script at 06d00000
Wrong image format for "source" command
/
** File not found /boot.scr **
## Executing script at 06d00000
Wrong image format for "source" command
/boot/

 

Any help in getting amrbian booting from the recently soldered EMMC module would be greatly appreciated.

Link to comment
Share on other sites

Welcome, and I'm sorry to hear your troubles.  If I were guessing, I would guess it's because the DTS in u-boot says the emmc is disabled, while the DTS in linux says its enabled.

 

I would suggest that you need to get something like the file at linux-mainline/linux-*/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts into u-boot/arch/arm/dts, and then tell u-boot to use it.  The difference appears to be

&sdhci0 {
	status = "okay";
};

instead of status="disabled"

 

But also, if you would like to have the SD card bring up linux from the eMMC, I believe you'd need to change your armbianEnv.txt so that the rootdev is "dc265376-877d-40a1-9417-7379fb332efe".  This ought to be detected by u-boot and passed to the kernel cmdline.

 

Link to comment
Share on other sites

7 hours ago, ManoftheSea said:

But also, if you would like to have the SD card bring up linux from the eMMC, I believe you'd need to change your armbianEnv.txt so that the rootdev is "dc265376-877d-40a1-9417-7379fb332efe".  This ought to be detected by u-boot and passed to the kernel cmdline.

 

 

NO JOY 🙁

 

I also reran the amrbian-config utility to reintall armbian on the emmc, hence the UUID change, but changing amrbianEnv.txt rootdev booted in initramsfs:

 

Begin: Will now check root file system ... fsck from util-linux 2.31.1
Checking all file systems.
done.
mount: mounting 0c7e2e6c-ee84-4ec3-9971-27e6020600cf on /root failed: No such file or directory
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /run on /root/run failed: No such file or directory
run-init: current directory on the same filesystem as the root: error 0
Target filesystem doesn't have requested /sbin/init.
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
No init found. Try passing init= bootarg.


BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)

 

I chrooted, reverted to the previous UUID and rebooted, could this error mean something else is broken?

 

7 hours ago, ManoftheSea said:

Welcome, and I'm sorry to hear your troubles.  If I were guessing, I would guess it's because the DTS in u-boot says the emmc is disabled, while the DTS in linux says its enabled.

 

I would suggest that you need to get something like the file at linux-mainline/linux-*/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts into u-boot/arch/arm/dts, and then tell u-boot to use it.  The difference appears to be

&sdhci0 {
	status = "okay";
};

instead of status="disabled"

 

Pardon my ignorance, but I don't know how to tell uboot to use it 😐

Also I don't know how to edit the dtb file outside of armbian-config.

Link to comment
Share on other sites

You have `rootdev=UUID=0c7e2e6c-ee84-4ec3-9971-27e6020600cf`, right, and not just `rootdev=0c7e2e6c-ee84-4ec3-9971-27e6020600cf`?  Or if the filesystem on emmc has changed, you'll need to write the new UUID.

 

I'm second-guessing my earlier guess.  It looks like recent u-boot have sdhci0 status as "okay", while the default linux dts has it disabled.  Which is the opposite of your problem. 

Link to comment
Share on other sites

On 4/7/2022 at 4:41 PM, ManoftheSea said:

You have `rootdev=UUID=0c7e2e6c-ee84-4ec3-9971-27e6020600cf`, right, and not just `rootdev=0c7e2e6c-ee84-4ec3-9971-27e6020600cf`?  Or if the filesystem on emmc has changed, you'll need to write the new UUID.

 

I'm second-guessing my earlier guess.  It looks like recent u-boot have sdhci0 status as "okay", while the default linux dts has it disabled.  Which is the opposite of your problem. 

 

Thanks alot for the help so far.

 

You were right after all, by mistake I wrote `rootdev=0c7e2e6c-ee84-4ec3-9971-27e6020600cf` on armbianEnv.txt instead of `rootdev=UUID=0c7e2e6c-ee84-4ec3-9971-27e6020600cf`, after changing like you suggested armbian does boot on the EMMC module, as long the microSD is inserted with said line on  armbianEnv.txt.

I'm still at a loss on how to make uboot recognize the emmc storage and boot armbian without the microSD card.

Link to comment
Share on other sites

21 hours ago, Henrique Fernandes said:

I'm still at a loss on how to make uboot recognize the emmc storage and boot armbian without the microSD card.

 

Currently, I'm building and using U-boot 2022.04, though 2022.01 also works.  I'm a new maintainer, so I haven't quite figured out how to claim the board such that recent builds get published and the espressobin returns to first-rate service.  But once we do, I'd expect that updating u-boot to the latest may allow it to detect the eMMC, and therefore load the kernel and early runtime.

 

Beware that your current setup has kernel and early runtime on SD, while your system thinks the packages for such are on eMMC.  If you update your kernel (modules) package, you may break things.

Link to comment
Share on other sites

3 hours ago, ManoftheSea said:

 

Currently, I'm building and using U-boot 2022.04, though 2022.01 also works.  I'm a new maintainer, so I haven't quite figured out how to claim the board such that recent builds get published and the espressobin returns to first-rate service.  But once we do, I'd expect that updating u-boot to the latest may allow it to detect the eMMC, and therefore load the kernel and early runtime.

 

Beware that your current setup has kernel and early runtime on SD, while your system thinks the packages for such are on eMMC.  If you update your kernel (modules) package, you may break things.

I'd help if I could but I don't understand anything about low level coding and building U-boot.

Glad to see your stepping up to become a maintainer of the board, I'm sure you will do great.

Link to comment
Share on other sites

Both things are kind a right.

With the installation of the deb package the boot loader is not automatically rewritten. This has been disabled years ago IIRC.

It just contains the code/files that are needed to flash the bootloader at need.

 

You can use armbian-config -> system -> Install to actually reflash the boot loader if necessary.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines