ufs: rockchip: Make use of controller resets

Assert Rockchip UFS controller resets during initialization and HCE
enable, as it is done by the Linux driver.

This is required to make some UFS chips, such as Foresee FEUDNN064G-C2G0,
work properly.

Note that the resets were already requested in the probe function, just
not used.

Signed-off-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/20260316-rockchip-ufs-reset-v1-1-808eb017459a@flipper.net
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:
Alexey Charkov
2026-03-16 20:50:45 +04:00
committed by Neil Armstrong
parent 052988aa29
commit c7299ff33e

View File

@@ -19,13 +19,22 @@
#include "unipro.h"
#include "ufs-rockchip.h"
static void ufs_rockchip_controller_reset(struct ufs_rockchip_host *host)
{
reset_assert_bulk(&host->rsts);
udelay(1);
reset_deassert_bulk(&host->rsts);
}
static int ufs_rockchip_hce_enable_notify(struct ufs_hba *hba,
enum ufs_notify_change_status status)
{
int err = 0;
if (status != POST_CHANGE)
if (status != POST_CHANGE) {
ufs_rockchip_controller_reset(dev_get_priv(hba->dev));
return 0;
}
ufshcd_dme_reset(hba);
ufshcd_dme_enable(hba);
@@ -150,6 +159,8 @@ static int ufs_rockchip_common_init(struct ufs_hba *hba)
return err;
}
ufs_rockchip_controller_reset(host);
err = gpio_request_by_name(dev, "reset-gpios", 0, &host->device_reset,
GPIOD_IS_OUT | GPIOD_ACTIVE_LOW);
if (err) {