[PATCH] mmc: zynq_sdhci: Reset the host controller

Michal Simek michal.simek at amd.com
Wed Jun 25 14:22:32 CEST 2025



On 6/25/25 07:26, Venkatesh Yadav Abbarapu wrote:
> Reset the host controller at the early stage of probe so that the
> configuration will be done properly for reboot cases.
> 
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>
> ---
>   drivers/mmc/zynq_sdhci.c | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index 0e2bdab4e7e..5d797dfd0c4 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -1127,6 +1127,27 @@ static int arasan_sdhci_probe(struct udevice *dev)
>   	if (arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_VERSAL_NET_EMMC))
>   		priv->internal_phy_reg = true;
>   
> +	ret = reset_get_bulk(dev, &priv->resets);
> +	if (ret == -ENOTSUPP || ret == -ENOENT) {
> +		dev_warn(dev, "Reset not found\n");
> +		return 0;
> +	} else if (ret) {
> +		dev_err(dev, "Reset failed\n");
> +		return ret;
> +	}
> +
> +	ret = reset_assert_bulk(&priv->resets);
> +	if (ret) {
> +		dev_err(dev, "Reset assert failed\n");
> +		return ret;
> +	}
> +
> +	ret = reset_deassert_bulk(&priv->resets);
> +	if (ret) {
> +		dev_err(dev, "Reset release failed\n");
> +		return ret;
> +	}

reset can still be optional right?

It means if reset is found you should call assert/deassert.
Not sure if there is any need to keep reset for some time.

If reset is not preset it should pass.
If reset is present but error out because whatever reason you should return error.

M


> +
>   	ret = clk_get_by_index(dev, 0, &clk);
>   	if (ret < 0) {
>   		dev_err(dev, "failed to get clock\n");



More information about the U-Boot mailing list