Currently, U-Boot doesn't set the bRefClkFreq attribute before changing power mode of the UFS device. If there is a difference between the UFS device and the host controller, all commands will fail after switching to high speed.
This behavior is rarely observed, because Linux sets the bRefClkFreq attribute on probe, and the bRefClkFreq is a persistent attribute. In other words, once Linux has booted once, the issue will never be seen. If trying to provision and boot from an unprovisioned UFS device, U-Boot will fail. Fix this by adding support for setting the bRefClkFreq attribute. Changes in v2: - drop the dev_ref_clk_freq field from the ufs_hba struct - ufshcd_parse_dev_ref_clk_freq returns a enum ufs_ref_clk_freq instead of setting the field in the ufs_hba struct (and returning void) Jared McArthur (2): ufs: Add support for sending UFS attribute requests ufs: Add bRefClkFreq attribute setting drivers/ufs/ufs.c | 180 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/ufs/ufs.h | 9 +++ 2 files changed, 189 insertions(+) -- 2.34.1

