Agxxavier industrial ufs3.1 speed too slow

Hi,

We are working on agx xavier industrial on our custom board with R35.6.1 and would like to port a non-removed ufs device(KIOXIA THGJFGT1T45BAB8).

Please see the changes below.

diff --git a/sources/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dts b/sources/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dts
index 0f8e25d0d..fa5ab59f9 100644
--- a/sources/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dts
+++ b/sources/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dts
@@ -82,6 +82,13 @@
                        interrupts = <TEGRA194_MAIN_GPIO(Q, 1) IRQ_TYPE_LEVEL_HIGH>, <TEGR
A194_MAIN_GPIO(P, 6) IRQ_TYPE_LEVEL_HIGH>;
                };
        };
+
+       ufshci@2450000 {
+               status = "okay";
+               /delete-property/ nvidia,cd-gpios;
+       };
 };

We have already detected the UFS device as /dev/sda. However, the read/write speeds are much slower than those specified in the documentation (900~1000MB/s).

p@p-desktop:~$ sudo mount /dev/sda /mnt/ufs_test
p@p-desktop:~$ sudo dd if=/dev/zero of=/mnt/ufs_test/testfile.img bs=1G count=1 conv=fdatasync status=progress
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4 s, 277 MB/s
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 25.8974 s, 41.5 MB/s
p@p-desktop:~$ sudo /sbin/sysctl -w vm.drop_caches=3
vm.drop_caches = 3
p@p-desktop:~$ sudo dd if=/mnt/ufs_test/testfile.img of=/dev/null bs=1G count=1 status=progress
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2 s, 558 MB/s
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.93587 s, 555 MB/s

Is there anything I missed?

Please see the the ufs dmesg below.

p@p-desktop:~$ sudo dmesg | grep ufs
[    7.285931] ufs_tegra 2450000.ufshci: freq-table-hz property not specified
[    7.295209] ufs_tegra 2450000.ufshci: ufshcd_populate_vreg: Unable to find vdd-hba-supply regulator, assuming enabled
[    7.522892] scsi host0: ufshcd
[    7.545745] ufs_tegra 2450000.ufshci: ufshcd_print_pwr_info:[RX, TX]: gear=[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0
[    7.546165] ufs_tegra 2450000.ufshci: dme-link-startup Successful
[    7.591417] ufs_tegra 2450000.ufshci: Total device capacity is 255944818688
[    7.591607] ufs_tegra 2450000.ufshci: Physical erase block size is 4194304
[    7.591798] ufs_tegra 2450000.ufshci: Allocation size is 4194304
[    7.591991] ufs_tegra 2450000.ufshci: Max lun size is 61022
[    7.597473] ufs_tegra 2450000.ufshci: default ref_clk_freq = 0
[    7.608743] ufs_tegra 2450000.ufshci: HS Mode RX_Gear:gear_3 TX_Gear:gear_3 RATE_B series
[    7.620205] ufs_tegra 2450000.ufshci: ufs scrambling feature enabled
[    7.626777] ufs_tegra 2450000.ufshci: ufshcd_print_pwr_info:[RX, TX]: gear=[3, 3], lane[1, 1], pwr[FAST MODE, FAST MODE], rate = 2

Thx

Yen

Hi,
Please get UART log for reference. Would like to ensure odm-data UFS_x1_L1 is enabled.

Hi

Please see the uart log below.

dmesg.log (137.0 KB)

How do I enable odm-data for UFS_x1_L1?

Thx

Yen

Hi,

Any updates?

Thx

Yen

Hi

The attached log is for flashing the OS.

flash.log (489.3 KB)

I saw UFS_x1_L1 in the log. Does this mean we have already enabled UFS_x1_L1 ?

Thx

Yen

Hi,
The odmdata looks correct. Please check

  1. Run the command to ensure ufs is enabled:
$ xxd /proc/device-tree/ufshci@2450000/status
  1. Check if adding this is a must-have in your design
		/delete-property/ nvidia,cd-gpios;
  1. The prints are not expected and please set these in device tree correctly:
[    2.542965] ufs_tegra 2450000.ufshci: freq-table-hz property not specified
[    2.549325] ufs_tegra 2450000.ufshci: ufshcd_populate_vreg: Unable to find vdd-hba-supply regulator, assuming enabled
[    2.560107] ufs_tegra 2450000.ufshci: ufshcd_get_vreg: vccq get failed, err=-517
  1. Please check voltage of the pins: Cannot find ufs device in system - #12 by Trumany

Hi,

p@p-desktop:~$ xxd /proc/device-tree/ufshci@2450000/status
00000000: 6f6b 6179 00                             okay.

2.This is necessary.

/delete-property/ nvidia,cd-gpios;

3.After adding freq-table-hz, I got this error messge “ufs_tegra 2450000.ufshci: ufshcd_init_clocks: pllrefe_vcoout clk get failed, -517“ and the OS enters a dead loop, please see the full dmesg for details.

BTW, any freq-table-hz values will show the same error message

dmesg_20251008.txt (258.2 KB)

        ufshci@2450000 {
                status = "okay";
                /delete-property/ nvidia,cd-gpios;
+               freq-table-hz = <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>;
        };
 };

4.voltage of the pins is confirmed.

Any suggestions for setting freq-table-hz?

Thx

Yen

Hi,

Any updates?

Thx

Yen

Hi,
The function is enabled on AGX Xavier developer kit. Would suggest compare the properties in device tree:

$ ls /proc/device-tree/ufshci@2450000/
clock-names               nvidia,configure-uphy-pll3  reg
clocks                    nvidia,enable-hs-mode       reset-names
compatible                nvidia,enable-scramble      resets
dma-coherent              nvidia,enable-x2-config     status
interconnect-names        nvidia,mask-fast-auto-mode  ufs_variant
interconnects             nvidia,max-hs-gear          vcc-max-microamp
interrupts                nvidia,max-pwm-gear         vccq2-max-microamp
iommus                    phandle                     vccq2-supply
name                      pinctrl-0                   vccq-max-microamp
nvidia,cd-gpios           pinctrl-1                   vccq-supply
nvidia,cd-wakeup-capable  pinctrl-names               vcc-supply
// check all the nodes
$ xxd /proc/device-tree/ufshci@2450000/vcc-supply
00000000: 0000 002d                                ...-
$ xxd /proc/device-tree/ufshci@2450000/compatible
00000000: 7465 6772 612c 7566 735f 7661 7269 616e  tegra,ufs_varian
00000010: 7400                                     t.
$ xxd /proc/device-tree/ufshci@2450000/clocks
00000000: 0000 0004 0000 0120 0000 0004 0000 0049  ....... .......I
00000010: 0000 0004 0000 004e 0000 0004 0000 0050  .......N.......P
00000020: 0000 0004 0000 004a 0000 0004 0000 004c  .......J.......L
00000030: 0000 0004 0000 004d 0000 0004 0000 004b  .......M.......K
00000040: 0000 0004 0000 004f 0000 0004 0000 00a4  .......O........
00000050: 0000 0004 0000 00a3 0000 0004 0000 0066  ...............f
00000060: 0000 0004 0000 000e 0000 0004 0000 0097  ................
00000070: 0000 0004 0000 0079                      .......y

$ xxd /proc/device-tree/ufshci@2450000/...

To check if there is any deviation. Also would suggest insert the card to AGX Xavier developer kit and run the benchmark.

Hi DaneLLL,

I’m yen’s colleague and answer some test result below:

1.

base on your reply, I reproduce the same check base on follwoing conditions:

H/W:AGX Xavier Industrial devkit(p2822+p2888)

OS image:comes from original L4T R35.6.1

Other modifications:

(1).convert the /boot/dtb/kernel_tegra194-p2888-0008-p2822-0000.dtb

cd /boot/dtb
dtc -I dtb -O dts -o 1.dts kernel_tegra194-p2888-0008-p2822-0000.dtb

(2).update the status property in block ufshci@2450000 of dts file

(3).re-compile the dts file back to dtb

cp kernel_tegra194-p2888-0008-p2822-0000.dtb kernel_tegra194-p2888-0008-p2822-0000.dtb.bak
dtc -I dts -O dtb -o kernel_tegra194-p2888-0008-p2822-0000.dtb 1.dts

(4).reboot the devkit

(5).check reslated info:

20251016_samsung_ufs_string_descriptor

(6).check the device-tree items you mentioned below:

as you can see, the result is the same as yours.

2.

using the SAMSUNG 128GB UFS card refer to the thread cannot-find-ufs-device-in-system

test the read / write performance:

3. compare to the UFS card’s R/W performance it claimed on the package. it should be Read 500MB/s, Write 200MB/s.

The WRITE TEST looks OK, but the READ TEST result seems just half of the value it claimed. How could I improve the READ performance on the AGX Xavier industrial devkit?

Hi DaneLLL,

Base on your suggestion, we’ve collected related info from the device, any suggestion for the information we provide??

Hi,
The result on AGX Xavier developer kit is supposed to be the maximum throughput. Do you get identical result on your custom board?

Hi,

So, is it correct to say that even though the Samsung 256GB UFS card is rated at 500 MB/s read and 200 MB/s write, when used on the AGX Xavier, the maximum throughput can only reach 250 MB/s read and 180 MB/s write?

Hi,
Yes, this can be the best we can achieve on developer kit. With your custom board, there is error prints in dmesg. You may try to resolve it by adding debug prints in ufs driver. Suppose it can achieve same performance on the custom board.