Robotics RB5 UFS storage device doesn't work at gear4 after switching to AOSP

Hi,

The RB5 board has preinstalled Yocto OS (kernel 4.19.125). The UFS storage device works in gear 4 with version (see the attachment #1). After switching to AOSP (the AOSP project is compiled and flashed using device/linaro/dragonboard/installer/rv5/flash-all-aosp.sh), the storage is limited to gear 3 (see the attachment #2).

With UFS protocol analyzer we’d discovered that gear limitation comes from the UFS controller

I’ve recompiled the kernel, but it doesn’t help (and I couldn’t find any UFS controller gear limitations in DTS anyway)

How can I solve this problem?

Thank you

Stanislav


hey! thanks for reporting the issue! Looks like it’s a legit problem… the Yocto build that comes with the device is provided by QCOM/Thundercomm, based on Qualcomm 4.19 product kernel, and has proper support for gear 4.

The AOSP build provided by Android/Linaro is based on a different Linux kernel, e.g. the mainline/upstream kernel. What you’ve identified is a bug (or missing feature) in the upstream UFS qcom driver, which does not support gear 4. we made a quick test to enable gear 4, and it didn’t work out of the box. we will need to investigate a bit more…

Hi,
Are there plans to fix this issue? If not, please, could you provide a link to a git repository with RB5 kernel where UFS device gear 4 is supported.
Thank you.
Stanislav

hey,

I am not aware of any progress…we took note of the problem, but nobody has looked into it yet. What we noticed is that in the upstream kernel, ufshcd_init_pwr_dev_param() specifies G3 to be the max gear for the platform in hs-mode, which is why G3 is used. So definitely support for G4 is missing.

The vendor kernel for 8250/RB5 is the Qualcomm msm-4.19 kernel, and it’s available here

The UFS driver in the vendor kernel is quite different from upstream…

Hi Nicolas,
Thank you for the fast response. Any idea which branch contains the vendor code? I couldn’t find in the list of branches something related to RB5 and the default branch contains code very similar to the 4.19 mainline.
Regards
Stanislav

The link I shared includes points to the proper branch (e.g. it’s branch msm-4.19 in the git tree called msm-4.19).

@Stas I’ve added the UFS Gear4 support in RB5 and pushed the commits to ufs_gear4 branch:
https://git.linaro.org/people/manivannan.sadhasivam/linux.git/log/?h=ufs_gear4

With this branch, I could confirm that the UFS in RB5 operates at HS-G4-B:

[    5.813039] ufshcd-qcom 1d84000.ufshc: ufshcd_print_pwr_info:[RX, TX]: gear=[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0
[    5.890181] ufshcd-qcom 1d84000.ufshc: ufshcd_print_pwr_info:[RX, TX]: gear=[4, 4], lane[2, 2], pwr[FAST MODE, FAST MODE], rate = 2

This branch is on top of linux-next/master as of 2022-08-22 and the patches will be submitted to the mailing list very soon.

Thanks,
Mani

Hi Mani,
The patches work well. Thank you very much.
Regards
Stas