[PATCH v4 2/3] ufs: rockchip: Add device reset support

Quentin Schulz quentin.schulz at cherry.de
Wed Jan 14 19:23:46 CET 2026


Hi Alexey,

On 1/8/26 6:49 PM, Alexey Charkov wrote:
> Wire up the GPIO line which Rockchip RK3576 UFS controller uses to reset
> the connected UFS device.
> 

It'd be nice to say that reset-gpios is required as per the Device Tree 
binding, c.f. 
https://elixir.bootlin.com/linux/v6.18.5/source/Documentation/devicetree/bindings/ufs/rockchip,rk3576-ufshc.yaml#L70

> This seems necessary at least for some UFS modules and fixes the following
> error while enumerating UFS storage:
> 
> ufshcd-rockchip ufshc at 2a2d0000: ufshcd_link_startup: Device not present
> ufshcd-rockchip ufshc at 2a2d0000: link startup failed -6
> ufshcd-rockchip ufshc at 2a2d0000: ufshcd_pltfrm_init() failed -6
> 
> Fixes: 76465ce21ee4 ("ufs: rockchip: Add initial support")
> Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
> Reviewed-by: Shawn Lin <shawn.lin at rock-chips.com>
> Signed-off-by: Alexey Charkov <alchark at gmail.com>
> ---
>   drivers/ufs/Kconfig        |  1 +
>   drivers/ufs/ufs-rockchip.c | 25 +++++++++++++++++++++++++
>   drivers/ufs/ufs-rockchip.h |  1 +
>   3 files changed, 27 insertions(+)
> 
> diff --git a/drivers/ufs/Kconfig b/drivers/ufs/Kconfig
> index 6c75bb2a0790..30b0c87798e1 100644
> --- a/drivers/ufs/Kconfig
> +++ b/drivers/ufs/Kconfig
> @@ -76,6 +76,7 @@ config UFS_RENESAS_GEN5
>   config UFS_ROCKCHIP
>   	bool "Rockchip specific hooks to UFS controller platform driver"
>   	depends on UFS
> +	select DM_GPIO
>   	help
>   	  This selects the Rockchip specific additions to UFSHCD platform driver.
>   
> diff --git a/drivers/ufs/ufs-rockchip.c b/drivers/ufs/ufs-rockchip.c
> index 0384244387da..48444705fb29 100644
> --- a/drivers/ufs/ufs-rockchip.c
> +++ b/drivers/ufs/ufs-rockchip.c
> @@ -5,6 +5,7 @@
>    * Copyright (C) 2025 Rockchip Electronics Co.Ltd.
>    */
>   
> +#include <asm/gpio.h>
>   #include <asm/io.h>
>   #include <clk.h>
>   #include <dm.h>
> @@ -153,11 +154,34 @@ static int ufs_rockchip_common_init(struct ufs_hba *hba)
>   		return err;
>   	}
>   
> +	err = gpio_request_by_name(dev, "reset-gpios", 0, &host->device_reset,
> +				   GPIOD_IS_OUT | GPIOD_ACTIVE_LOW);
> +	if (err) {
> +		dev_err(dev, "Warning: cannot get reset GPIO\n");

No need for "Warning: " as it is an actual error.

> +	if (!dm_gpio_is_valid(&host->device_reset))

How could it be invalid if we managed to request it in probe?

Cheers,
Quentin


More information about the U-Boot mailing list