[PATCH 3/5] clk: meson: reset mmc clock on probe

Anand Moon linux.amoon at gmail.com
Fri Dec 20 13:06:42 CET 2019


Hi Jerome

On Fri, 20 Dec 2019 at 00:07, Jerome Brunet <jbrunet at baylibre.com> wrote:
>
> On some SoCs, depending on the boot device, the MMC clock block may be
> left in a weird state by the ROM code, in which no decent clock may be
> provided. Reset the related register to make sure a sane MMC clock is
> ready for the controller.
>
> Signed-off-by: Jerome Brunet <jbrunet at baylibre.com>
> ---
>  drivers/clk/meson/axg.c  | 7 +++++++
>  drivers/clk/meson/g12a.c | 7 +++++++
>  drivers/clk/meson/gxbb.c | 7 +++++++
>  3 files changed, 21 insertions(+)
>
> diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c
> index 32cbf752aed8..0ba6c303e122 100644
> --- a/drivers/clk/meson/axg.c
> +++ b/drivers/clk/meson/axg.c
> @@ -290,6 +290,13 @@ static int meson_clk_probe(struct udevice *dev)
>         if (IS_ERR(priv->map))
>                 return PTR_ERR(priv->map);
>
> +       /*
> +        * Depending on the boot src, the state of the MMC clock might
> +        * be different. Reset it to make sure we won't get stuck
> +        */
> +       regmap_write(priv->map, HHI_NAND_CLK_CNTL, 0);
> +       regmap_write(priv->map, HHI_SD_EMMC_CLK_CNTL, 0);
> +
>         debug("meson-clk-axg: probed\n");
>
>         return 0;
> diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c
> index 1b2523bbf1fe..03d885d986b8 100644
> --- a/drivers/clk/meson/g12a.c
> +++ b/drivers/clk/meson/g12a.c
> @@ -976,6 +976,13 @@ static int meson_clk_probe(struct udevice *dev)
>         if (IS_ERR(priv->map))
>                 return PTR_ERR(priv->map);
>
> +       /*
> +        * Depending on the boot src, the state of the MMC clock might
> +        * be different. Reset it to make sure we won't get stuck
> +        */
> +       regmap_write(priv->map, HHI_NAND_CLK_CNTL, 0);
> +       regmap_write(priv->map, HHI_SD_EMMC_CLK_CNTL, 0);
> +
>         debug("meson-clk-g12a: probed\n");
>
>         return 0;
> diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
> index abb5337e7829..aedba991603f 100644
> --- a/drivers/clk/meson/gxbb.c
> +++ b/drivers/clk/meson/gxbb.c
> @@ -886,6 +886,13 @@ static int meson_clk_probe(struct udevice *dev)
>         if (IS_ERR(priv->map))
>                 return PTR_ERR(priv->map);
>
> +       /*
> +        * Depending on the boot src, the state of the MMC clock might
> +        * be different. Reset it to make sure we won't get stuck
> +        */
> +       regmap_write(priv->map, HHI_NAND_CLK_CNTL, 0);
> +       regmap_write(priv->map, HHI_SD_EMMC_CLK_CNTL, 0);
> +
>         debug("meson-clk: probed\n");
>
>         return 0;
> --
> 2.23.0
>

This changes Fix my issue on Odroid N2 eMMC module.

Please add my.
Tested-by: Anand Moon <linux.amoon at gmail.com>

-Anand


More information about the U-Boot mailing list