Skip to main content

eMMC

The boards have an eMMC flash that can be used for persistent storage. The size of the eMMC can be different for different boards and the device IDs associated with the eMMC can also be different for different boards. The table below lists the device IDs for the different boards.

BoardU-BootLinux
RZ/G3E SOMmmc dev 0/dev/mmcblk0

U-Boot

One of the roles of the U-Boot is to write new bootloader(s), Linux kernel and file systems to eMMC. To accomplish this there are a set of U-Boot commands available:

mmc
mmc - MMC sub system

Usage:
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
- Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
- Change sizes of boot and RPMB partitions of specified device
mmc partconf dev boot_ack boot_partition partition_access
- Change the bits of the PARTITION_CONFIG field of the specified
device
mmc rst-function dev value
- Change the RST_n_FUNCTION field of the specified device
WARNING: This is a write-once field and 0 / 1 / 2 are the only
valid values.
mmc setdsr - set DSR register value
warning

Take care when using the commands as they will potentially corrupt the system!

A couple of safe commands (shown for the iMX6 UltraLite COM board).

Select device

mmc dev 0
mmc0(part 0) is current device

Get information about the device

mmcinfo
Device: mmc@15c00000
Manufacturer ID: 15
OEM: 0
Name: BGUF4R
Bus Speed: 50000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.1 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.1 GiB WRREL
Boot Capacity: 31.9 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected

Show partitions on the device

mmc part
Partition Map for mmc device 0  --   Partition Type: DOS

Part Start Sector Num Sectors UUID Type
1 16 1024000 00000000-01 83
2 1024016 60055536 00000000-02 83

Show available device tree files

ext4ls mmc 0:2 boot
<DIR>       4096 .
<DIR> 4096 ..
<SYM> 34 Image
24918528 Image-6.1.107-cip28-yocto-standard
70701 rzg3e-ea-som-hdmi.dtb
70715 rzg3e-ea-som-lcd.dtb
70415 rzg3e-ea-som-lvds0.dtb
70571 rzg3e-ea-som-lvds01.dtb
70204 rzg3e-ea-som-lvds1.dtb

Linux

If Linux boots from the eMMC it is available when you log in.

Available disk space

df -h
Filesystem        Size      Used Available Use% Mounted on
/dev/root 28.0G 990.1M 25.6G 4% /
devtmpfs 1.6G 0 1.6G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 761.1M 10.3M 750.7M 1% /run
tmpfs 1.9G 0 1.9G 0% /tmp
tmpfs 1.9G 12.0K 1.9G 0% /var/volatile
tmpfs 380.5M 4.0K 380.5M 0% /run/user/996
tmpfs 380.5M 4.0K 380.5M 0% /run/user/0

Create a file

echo Hello > greeting

Show content of a file

cat greeting
Hello

List files

ls -la
drwxr-xr-x   2 root    root      1024 Sep 23 15:25 .
drwxr-xr-x 3 root root 1024 Sep 23 14:52 ..
-rw-r--r-- 1 root root 12 Sep 23 15:25 greeting