[RFC PATCH] mmc: zynq_sdhci: Dependable card detect

Soma, Ashok Reddy ashok.reddy.soma at amd.com
Thu May 18 08:20:30 CEST 2023


Hi Stefan,

 We haven't seen any instability issue so far on ZynqMP boards and no one reported any such issue till now.
 We are already taking care of card detection stability issue with below waiting logic.
https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/mmc/zynq_sdhci.c#L1161
 
Could you please answer below questions.
 1. is this observed in SPL only or full u-boot ?
 2. is this observed in dynamic config case only ? because your patch is in dynamic path.
 3. "On our hardware we get a "Sdhci card detect state not stable" error in the SPL if no mmc card is present"
       Are you seeing stability issue when card is not present ? can you please elaborate more about the issue.
 4.  It is not convincing to me that you are trying to select eMMC for some time and then switching back to SD.

Thanks,
Ashok

> -----Original Message-----
> From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Stefan
> Herbrechtsmeier
> Sent: Tuesday, May 16, 2023 7:51 PM
> To: u-boot at lists.denx.de
> Cc: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>;
> Jaehoon Chung <jh80.chung at samsung.com>; Simek, Michal
> <michal.simek at amd.com>; Peng Fan <peng.fan at nxp.com>
> Subject: [RFC PATCH] mmc: zynq_sdhci: Dependable card detect
> 
> CAUTION: This message has originated from an External Source. Please use
> proper judgment and caution when opening attachments, clicking links, or
> responding to this email.
> 
> 
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
> 
> The card detect logic needs a short card present signal to work dependable.
> Without a present card the SDHCI_CARD_STATE_STABLE signal is not set
> dependable after a reset. Use the internal fixed card present signal to initiate
> the card detect logic.
> 
> Signed-off-by: Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier at weidmueller.com>
> 
> ---
> On our hardware we get a "Sdhci card detect state not stable" error in the SPL
> if no mmc card is present. It is unclear if this patch is the correct solution, but
> a short card inserts or a fixed card present signal leads to a
> SDHCI_CARD_STATE_STABLE signal with and without card.
> 
>  drivers/mmc/zynq_sdhci.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index
> e44868aaec..a88feeb367 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -1075,6 +1075,26 @@ static int
> sdhci_zynqmp_set_dynamic_config(struct arasan_sdhci_priv *priv,
>                 return ret;
>         }
> 
> +       /* The card detect logic needs a short card present signal to work
> +        * dependable. Without a present card the SDHCI_CARD_STATE_STABLE
> +        * signal is not set dependable after a reset. Use the internal
> +        * fixed card present signal to initiate the card detect logic.
> +        */
> +       if (!dev_read_bool(dev, "non-removable")) {
> +               ret = zynqmp_pm_set_sd_config(priv->node_id,
> SD_CONFIG_EMMC_SEL,
> +                                             1);
> +               if (ret) {
> +                       dev_err(dev, "SD_CONFIG_EMMC_SEL failed\n");
> +                       return ret;
> +               }
> +               ret = zynqmp_pm_set_sd_config(priv->node_id,
> SD_CONFIG_EMMC_SEL,
> +                                             0);
> +               if (ret) {
> +                       dev_err(dev, "SD_CONFIG_EMMC_SEL failed\n");
> +                       return ret;
> +               }
> +       }
> +
>         return 0;
>  }
>  #endif
> --
> 2.30.2



More information about the U-Boot mailing list