本次操作使用SanDisk品牌、32GByte容量的Micro SD卡来测试评估板Micro SD接口性能。不同的MicroSD卡以及不同的测试方法,对Micro SD接口测试结果将造成一定差异。测试过程会擦除分区内容,请务必做好数据备份。
将评估板上电,从eMMC启动系统。系统启动后再将Micro SD卡插至评估板Micro SD卡槽。进入评估板文件系统,执行如下命令,查看磁盘空间使用情况和Micro SD分区信息。
Target# fdisk -l //查看Micro SD分区信息
Target# df -h //显示磁盘空间使用情况

(1)Micro SD接口写速度测试
进入评估板系统,执行如下命令测试MicroSD接口写速度。
Target# fio -filename=/dev/mmcblk1-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=write -bs=1024K -size=1024M -numjobs=1 -thread -group_reporting -name=write_job -ramp_time=1 -allow_mounted_write=1

此处一共写入1024MByte数据,可看到本次测试的Micro SD卡写速度如上图所示。
(2)Micro SD接口读速度测试
执行如下命令测试MicroSD接口读速度。
Target# fio -filename=/dev/mmcblk1-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=read -bs=1024K -size=1024M -numjobs=1 -thread -group_reporting -name=read_job -ramp_time=1
此处一共读出1024MByte数据,可看到本次测试的Micro SD卡读速度如上图所示。
3.8UFS读写测试
本小节测试UFS的读写性能,测试使用的UFS存储芯片型号为:FEUDME128G-B8A19,容量为128GByte。测试过程会擦除分区内容,请务必做好数据备份。
UFS读写速度受测试方法、测试数据大小影响,测试速率以具体情况为准,如下测试数据仅供参考。
备注:我司核心板默认空贴UFS存储芯片,如需测试UFS功能请实贴UFS存储芯片。
将系统启动卡插入评估板Micro SD卡槽,从Micro SD进入评估板文件系统,执行如下命令,查看UFS容量。
Target# dmesg | grep sd

执行如下命令,查看UFS频率。
Target# cat /sys/kernel/debug/clk/clk_summary | grep ufs

执行如下命令,查看UFS分区信息。
Target# fdisk -l

(1)UFS写速度测试
执行如下命令对UFS设备进行写速度测试。
Target# fio -filename=/dev/sda8-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=write -bs=1024K -size=10G -numjobs=1 -thread -group_reporting -name=write_job -ramp_time=1 -allow_mounted_write=1

此处一共写10GByte测试数据至UFS,可看到本次测试的UFS写速度如上图所示。
(2)UFS读速度测试
执行如下命令对UFS设备进行读速度测试。
Target# fio -filename=/dev/sda8-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=read -bs=1024K -size=10G -numjobs=1 -thread -group_reporting -name=read_job -ramp_time=1

此处从UFS中一共读出10GByte数据,可看到本次测试的UFS读速度如上图所示。
3.9M.2 Key M接口测试
本小节使用NVMe固态硬盘(厂家:西部数据,型号:SN570)测试M.2 Key M接口,NVMe固态硬盘接口类型为M.2、格式为FAT32、容量为500GByte。
评估板断电,请将NVMe固态硬盘插至评估板M.2 Key M(CON13)插槽,硬件连接如下图所示。

本次测试采用fio工具,将会清除NVMe固态硬盘的数据,请注意备份数据。
评估板上电,执行如下命令检测PCIe和NVMe固态硬盘。
Target# lspci -vv



执行如下命令,查看NVMe固态硬盘分区信息。
Target# fdisk -l

(1)M.2 Key M接口写速度测试
进入评估板文件系统,执行如下命令测试M.2 Key M接口写速度。
Target# fio -filename=/dev/nvme0n1-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=write -bs=1024K -size=5G -numjobs=1 -thread -group_reporting -name=write_job -ramp_time=1

此处一共写入5GByte测试数据,可看到本次测试M.2 Key M接口写速度如上图所示。
(2)M.2 Key M接口读速度测试
进入评估板文件系统,执行如下命令测试M.2 Key M接口读速度。
Target# fio -filename=/dev/nvme0n1-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=read -bs=1024K -size=5G -numjobs=1 -thread -group_reporting -name=read_job -ramp_time=1

此处一共读出5GByte测试数据,可看到本次测试M.2 Key M接口读速度如上图所示。
3.10USB3.0 HOST接口读写测试
本章节使用金士顿公司(Kingston)、120GByte容量的固态硬盘对评估板USB接口进行测试。不同品牌、格式或容量的硬盘,测试结果会有所差异。
请将固态硬盘通过USB3.0转SATA转换器(厂家:绿联,型号:CR108)与评估板USB3.0 HOST双层任一接口连接,如下图所示。

从下图可看到当前USB设备挂载名为sda,当评估板挂载多个存储设备时,挂载名可能会变更。

(1)USB 3.0 HOST接口写速度测试
进入评估板文件系统,执行如下命令测试USB 3.0 HOST接口写速度。
Target# fio -filename=/dev/sda-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=write -bs=1024K -size=5G -numjobs=1 -thread -group_reporting -name=write_job -ramp_time=1

此处一共写入5GByte测试数据,可看到本次测试的USB设备写速度如上图所示。
(2)USB 3.0 HOST接口读速度测试
进入评估板文件系统,执行如下命令测试USB 3.0 HOST接口读速度。
Target# fio -filename=/dev/sda-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=read -bs=1024K -size=5G -numjobs=1 -thread -group_reporting -name=read_job -ramp_time=1

此处一共读出5GByte数据,可看到本次测试的USB设备读速度如上图所示。
3.11USB3.0 DRD接口读写测试
3.11.1USB 3.0 DRD接口HOST模式测试
本小节使用金士顿公司(Kingston)、120GByte容量的固态硬盘对评估板USB 3.0 DRD接口进行测试。不同品牌、格式或容量的硬盘,测试结果会有所差异。
请将固态硬盘通过USB3.0转SATA转换器(厂家:绿联,型号:CM321)与评估板USB 3.0 DRD接口连接,硬件连接如下图所示。

评估板上电启动,系统将打印固态硬盘容量、挂载名等信息。
从下图可看到当前USB设备挂载名为sda,当评估板挂载多个存储设备时,挂载名可能会变更。

(1)USB3.0DRD接口写速度测试
进入评估板文件系统,执行如下命令测试USB3.0DRD接口写速度。
Target# fio -filename=/dev/sda-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=write -bs=1024K -size=10G -numjobs=1 -thread -group_reporting -name=write_job -ramp_time=1
备注:USB枚举阶段可能存在不稳定现象,若测试速率偏低,请等待约20s,待链路状态稳定后再进行速率测试。

此处一共写入10GByte测试数据,可看到本次测试的USB设备写速度如上图所示。
(2)USB3.0DRD接口读速度测试
进入评估板文件系统,执行如下命令测试USB3.0DRD接口读速度。
Target# fio -filename=/dev/sda-ioengine=psync -iodepth=1 -iodepth_batch=1 -iodepth_low=1 -iodepth_batch_complete=1 -direct=1 -rw=read -bs=1024K -size=10G -numjobs=1 -thread -group_reporting -name=read_job -ramp_time=1

此处中一共读出10GByte数据,可看到本次测试的USB设备读速度如上图所示。
3.11.2USB 3.0 DRD接口DEVICE模式测试
请通过Type-C线(支持USB 3.0)将PC机USB接口与评估板的USB 3.0DRD接口进行连接。
执行如下命令,使用ums_fat.img镜像虚拟为U盘,PC机将识别该U盘。
Target# echo usb_ums_en > /etc/init.d/.usb_config //创建.usb_config文件,并写入启用标志
Target# echo "ums_block=/tmp/ums_fat.img" >> /etc/init.d/.usb_config //向配置文件追加一行,指定后端存储镜像文件
Target# echo "ums_block_size=32" >> /etc/init.d/.usb_config //指定镜像文件的容量大小为32MByte
Target# echo "ums_block_type=fat" >> /etc/init.d/.usb_config //指定镜像文件的文件系统格式为fat
Target# sync //强制将内存中的缓存数据写入磁盘
Target# reboot //重启


请打开位于产品资料“4-软件资料ToolsWindows”目录下的ATTODiskBenchmark.exe工具,本次使用该工具对虚拟U盘进行读写测试。

双击打开ATTODiskBenchmark.exe,Drive选择对应的存储设备,"I/O Size"选择"512B to 8MB","FileSize"设置测试文件大小为"16MB",勾选"Bypass Write Cache"(绕开缓存机制),点击Start开始测试。

等待5min左右,测得USB 3.0DRD接口DEVICE模式的读写速率如下图所示。

审核编辑 黄宇
