/ { vcc12v_dcin: vcc12v-dcin { compatible = "regulator-fixed"; regulator-name = "vcc12v_dcin"; regulator-always-on; regulator-boot-on; regulator-min-microvolt = <12000000>; regulator-max-microvolt = <12000000>; }; vcc5v0_sys: vcc5v0-sys { compatible = "regulator-fixed"; regulator-name = "vcc5v0_sys"; regulator-always-on; regulator-boot-on; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; vin-supply = <&vcc12v_dcin>; }; vcc3v3_pcie2x1l0: vcc3v3-pcie2x1l0 { compatible = "regulator-fixed"; regulator-name = "vcc3v3_pcie2x1l0"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; enable-active-high; regulator-boot-on; regulator-always-on; gpios = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>; startup-delay-us = <50000>; vin-supply = <&vcc5v0_sys>; }; vcc3v3_pcie2x1l2: vcc3v3-pcie2x1l2 { compatible = "regulator-fixed"; regulator-name = "vcc3v3_pcie2x1l2"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; startup-delay-us = <5000>; vin-supply = <&vcc_3v3_s3>; }; vcc3v3_pcie30: vcc3v3-pcie30 { compatible = "regulator-fixed"; regulator-name = "vcc3v3_pcie30"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; enable-active-high; gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>; startup-delay-us = <5000>; vin-supply = <&vcc5v0_sys>; };}&pcie2x1l0 { reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; vpcie3v3-supply = <&vcc3v3_pcie2x1l0>; status = "okay";};&pcie2x1l2 { reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>; vpcie3v3-supply = <&vcc3v3_pcie2x1l2>; status = "okay";};&combphy1_ps { status = "okay";};&pcie30phy { rockchip,pcie30-phymode = <PHY_MODE_PCIE_AGGREGATION>; status = "okay";};&pcie3x4 { reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; vpcie3v3-supply = <&vcc3v3_pcie30>; status = "okay";};
pcie30phy、combphy1_ps:PHY 节点pcie3x4、pcie2x1l0、 pcie2x1l2 :pcie控制器节点reset-gpios:复位引脚属性vcc3v3_pcie2x1l0、vcc3v3_pcie2x1l2、vcc3v3_pcie30:供电引脚节点4. PCIe设备使用方法执行lspci命令会列出所有PCI设备的信息,包括设备的制造商、型号、PCI地址等输出通常以文本形式提供,并按总线地址(BDF:Bus, Device, Function)的顺序排列armsom@armsom:~$ lspci0000:00:00.0 PCI bridge: Rockchip Electronics Co., Ltd Device 3588 (rev 01)0000:01:00.0 Non-Volatile memory controller: Intel Corporation NVMe Optane Memory Series0002:20:00.0 PCI bridge: Rockchip Electronics Co., Ltd Device 3588 (rev 01)0002:21:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)0003:30:00.0 PCI bridge: Rockchip Electronics Co., Ltd Device 3588 (rev 01)0003:31:00.0 Network controller: Broadcom Inc. and subsidiaries Device 449d (rev 02)0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd Device 3588 (rev 01)0004:41:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
pcie接口接高速固态硬盘(SSD)的情景较多,这里以Intel Corporation生产的非易失性内存(NVMe)控制器为例,详解NVMe控制器的使用方法4.1 NVMe控制器使用检查NVMe设备是否被识别:运行以下命令,查看系统是否正确识别了NVMe设备armsom@armsom:/$ lspci | grep NVMe0000:01:00.0 Non-Volatile memory controller: Intel Corporation NVMe Optane Memory Series
如果您看到与Intel Corporation相关的NVMe设备信息,则表示设备已经被识别查找设备节点ls /dev/nvme/dev/nvme0 /dev/nvme0n1
查看设备的分区信息:armsom@armsom:/$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSmmcblk0 179:0 0 58.3G 0 disk├─mmcblk0p1 179:1 0 4M 0 part├─mmcblk0p2 179:2 0 4M 0 part├─mmcblk0p3 179:3 0 64M 0 part├─mmcblk0p4 179:4 0 128M 0 part├─mmcblk0p5 179:5 0 32M 0 part├─mmcblk0p6 179:6 0 14G 0 part├─mmcblk0p7 179:7 0 128M 0 part└─mmcblk0p8 179:8 0 43.9G 0 partmmcblk0boot0 179:32 0 4M 1 diskmmcblk0boot1 179:64 0 4M 1 diskmmcblk1 179:96 0 29.7G 0 disk├─mmcblk1p1 179:97 0 512M 0 part /boot/firmware└─mmcblk1p2 179:98 0 29.2G 0 part /nvme0n1 259:0 0 13.4G 0 disk /mnt
NVMe设备通常以/dev/nvmeXnY的形式表示,其中X是NVMe设备的编号,Y是分区编号此处的NVMe设备名称是nvme0n1格式化为EXT4文件格式 ( 根据个人需求运行格式化操作 )sudo mkfs.ext4 /dev/nvme0n1
挂载设备armsom@armsom:~$ sudo mount /dev/nvme0n1 /mnt
查看挂载路径df -h/dev/nvme0n1 14G 24K 13G 1% /mnt
或者cat /proc/mounts | grep nvme/dev/nvme0n1 /mnt ext4 rw,relatime 0 0
卸载设备umount /mnt
4.2 读写测速使用dd命令进行读写测试:写测试命令:sudo dd if=/dev/zero of=/dev/nvme0n1 bs=1M count=1000
其中if参数是输入文件(通常是/dev/zero,用于写入测试),of参数是输出文件(通常是您的NVMe设备),bs参数是块大小,count参数是要执行的块数读测试命令:sudo dd if=/dev/nvme0n1 of=/dev/null bs=1M count=1000
读写性能可能会受到多种因素的影响,包括设备型号、硬件配置和测试条件等(图片来源网络,侵删)
0 评论