Tests:eMMC-8bit-width

From eLinux.org
Revision as of 12:07, 10 October 2016 by W sang (talk | contribs) (update the upstream branches)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This document describes how to test the on-board eMMC using 8 bit bus width on a R-Car H3 with a Salvator-X board.

Kernel branch

The patches are included in renesas-drivers starting with renesas-drivers-2016-09-20-v4.8-rc7. They landed upstream in v4.9-rc1. The topic branch is at [1].

Preparations

cat, mount, umount, cp, md5sum from busybox are needed for these tests. If the eMMC does not have a partition yet, also fdisk and mkfs.ext2 are needed.

debugfs and ext2 filesystems should be activated in the kernel config.

Check eMMC is detected in the bootlog

You should find messages like this in your bootlog:

mmc0: new high speed MMC card at address 0001
...
 mmcblk0: p1

If the last line (with p1) is missing, you need to create the partition first using fdisk:

# fdisk /dev/mmcblk0

then press "n", "p", "1", "enter", "enter", "w" to create a partition. Finally, to create the filesystem use:

# mkfs.ext2 /dev/mmcblk0p1

Check MMC settings

Read out the current setting for the eMMC:

# cat /sys/kernel/debug/mmc0/ios
clock:		52000000 Hz
vdd:		21 (3.3 ~ 3.4 V)
bus mode:	2 (push-pull)
chip select:	0 (don't care)
power mode:	2 (on)
bus width:	3 (8 bits)
timing spec:	1 (mmc high-speed)
signal voltage:	1 (1.80 V)
driver type:	0 (driver type B)

Check that bus width is 8 bits and signal voltage is 1.8V.

Mount the partition and copy data onto it

# mount /dev/mmcblk0p1 /mnt
# cp /bin/busybox /mnt/
# md5sum /mnt/busybox > /mnt/md5

We store the hashsum of the currently used busybox for later verification.

Remount the partition and verify the copied data

This ensures data was correctly written and can reliably be read again:

# umount /mnt/
# mount /dev/mmcblk0p1 /mnt
# md5sum -c /mnt/md5
/mnt/busybox: OK

You can optionally reboot the machine after the umount command.