summaryrefslogtreecommitdiff
path: root/wiki/EMMC-speed-raw-data/mmc.sh
blob: 0faaa82b13b6bea081393c06a1abcac46679df69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

do_one ()
{
   	echo "# $@"
   	"$@"
}

do_test ()
{
	for i in $(seq 3); do
   		do_one "$@"
		sleep 10
	done
}

echo "# dmesg | grep mmc0"
dmesg | grep mmc0
do_one cat /sys/kernel/debug/mmc0/ios
do_one cat /sys/devices/platform/soc/*/mmc_host/mmc0/mmc0:0001/cid

echo
echo "Read from MMC, direct"
do_test dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct

echo
echo "Read from MMC, no direct"
do_test dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512

echo
echo "Write to MMC, direct"
do_test dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=512 oflag=direct

echo
echo "Write to MMC, no direct"
do_test dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=512

echo