...
phy0: ethernet-phy@0 { reg = <0>;
Device Tree Examples
Expand | ||
---|---|---|
| ||
|
Linux Drivers
Host:
End Point:
Notes
PCIe was enabled by default in the RZ/G2 BSP. But you need to modify the kernel menuconfig to add support for NVME M.2 SDD.
Example to modify kernel in yocto is:
$ bitbake -c menuconfig virtual/kernel
Once menuconfig appears, enable device driver for nvme support and save the changes.
Then build the kernel with new configuration.
$ bitbake linux-renesas -fc compile
$ bitbake linux-renesas -fc install
$ bitbake linux-renesas -fc deploy
Once the built is done, update your kernel and device tree with newly built.
2. Connect the SSD adapter board to RZ/G2H PCIe slot and check PCIe:
$ root@hihope-rzg2h:~# lspci
00:00.0 PCI bridge: Renesas Technology Corp. Device 0025
01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983
$ root@hihope-rzg2h:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 29.7G 0 disk
`-mmcblk0p1 179:1 0 29.7G 0 part
mmcblk0boot0 179:8 0 31.5M 1 disk
mmcblk0boot1 179:16 0 31.5M 1 disk
mmcblk1 179:24 0 14.9G 0 disk
|-mmcblk1p1 179:25 0 512M 0 part
`-mmcblk1p2 179:26 0 1.8G 0 part /
nvme0n1 259:0 0 238.5G 0 disk # recognized the NVME SSD
3. Create a partition on the nvme to use
$ root@hihope-rzg2h:~# fdisk /dev/nvme0n1
Choose "n" to create a new partition
Choose "P" then "1" to create a new primary partition
Use defaults for the sector numbers
Then "w" to write the data to the disk
After partition, "lsblk" command shows this:
$ root@hihope-rzg2h:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 29.7G 0 disk
`-mmcblk0p1 179:1 0 29.7G 0 part
mmcblk0boot0 179:8 0 31.5M 1 disk
mmcblk0boot1 179:16 0 31.5M 1 disk
mmcblk1 179:24 0 14.9G 0 disk
|-mmcblk1p1 179:25 0 512M 0 part
`-mmcblk1p2 179:26 0 1.8G 0 part /
nvme0n1 259:0 0 238.5G 0 disk
`-nvme0n1p1 259:1 0 238.5G 0 part # new partition
4. Create the filesystem:
$ root@hihope-rzg2h:~# mkfs -t ext4 /dev/nvme0n1p1
5. Create mount point:
$ root@hihope-rzg2h:~# mkdir /mnt/nvme
root@hihope-rzg2h:~# mount /dev/nvme0n1p1 /mnt/nvme
[ 970.462102] EXT4-fs (nvme0n1p1): recovery complete
[ 970.468717] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null)
6. Create file to write/read:
$ root@hihope-rzg2h:~# touch /mnt/nvme/testfile
7. Example for PCIe performance measured on PCIe Slot port of RZ/G2H, and with a Samsung NVMe SSD PM981a:
root@hihope-rzg2h:~# echo 3 > /proc/sys/vm/drop_caches # to drop both page cache and dentries/inodes [ 498.378440] sh (620): drop_caches: 3 root@hihope-rzg2h:~# dd if=/dev/zero of=/mnt/nvme/testfile bs=200M count=50 oflag=direct 50+0 records in 50+0 records out 10485760000 bytes (10 GB, 9.8 GiB) copied, 29.009 s, 361 MB/s root@hihope-rzg2h:~# echo 3 > /proc/sys/vm/drop_caches [ 616.062183] sh (620): drop_caches: 3 root@hihope-rzg2h:~# dd if=/mnt/nvme/testfile of=/dev/null bs=200M count=50 iflag=direct 50+0 records in 50+0 records out 10485760000 bytes (10 GB, 9.8 GiB) copied, 24.6171 s, 426 MB/s
Linux Drivers
...
Notes
Device Tree Examples
...
Notes
...