All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 15/22] mmc: add a new mmc parameter to disable mmc clock
Date: Sun, 14 May 2017 21:28:17 -0600	[thread overview]
Message-ID: <CAPnjgZ2oiTGX46Qe5f2ORVkZVme-CgwZ7E7060Nd+1hLSt=HJA@mail.gmail.com> (raw)
In-Reply-To: <1494613000-8156-16-git-send-email-jjhiblot@ti.com>

Hi,

On 12 May 2017 at 12:16, Jean-Jacques Hiblot <jjhiblot@ti.com> wrote:
> mmc clock has to be disabled in certain cases like during
> the voltage switch sequence. Modify mmc_set_clock function
> to take disable as an argument that signifies if the
> clock has to be enabled or disabled.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
>  drivers/mmc/fsl_esdhc.c |  2 +-
>  drivers/mmc/mmc.c       | 11 ++++++-----
>  include/mmc.h           |  3 ++-
>  3 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index f3c6358..b631392 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -658,7 +658,7 @@ static int esdhc_init(struct mmc *mmc)
>  #endif
>
>         /* Set the initial clock speed */
> -       mmc_set_clock(mmc, 400000);
> +       mmc_set_clock(mmc, 400000, false);
>
>         /* Disable the BRR and BWR bits in IRQSTAT */
>         esdhc_clrbits32(&regs->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR);
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 032260b..70b7d19 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1216,7 +1216,7 @@ static int mmc_set_ios(struct mmc *mmc)
>  }
>  #endif
>
> -int mmc_set_clock(struct mmc *mmc, uint clock)
> +int mmc_set_clock(struct mmc *mmc, uint clock, u8 disable)
>  {
>         if (clock > mmc->cfg->f_max)
>                 clock = mmc->cfg->f_max;
> @@ -1225,6 +1225,7 @@ int mmc_set_clock(struct mmc *mmc, uint clock)
>                 clock = mmc->cfg->f_min;
>
>         mmc->clock = clock;
> +       mmc->clk_disable = disable;
>
>         return mmc_set_ios(mmc);
>  }
> @@ -1316,7 +1317,7 @@ static int sd_select_mode_and_width(struct mmc *mmc)
>
>                                 /* configure the bus mode (host) */
>                                 mmc_select_mode(mmc, mwt->mode);
> -                               mmc_set_clock(mmc, mmc->tran_speed);
> +                               mmc_set_clock(mmc, mmc->tran_speed, false);
>
>                                 err = sd_read_ssr(mmc);
>                                 if (!err)
> @@ -1327,7 +1328,7 @@ static int sd_select_mode_and_width(struct mmc *mmc)
>  error:
>                                 /* revert to a safer bus speed */
>                                 mmc_select_mode(mmc, SD_LEGACY);
> -                               mmc_set_clock(mmc, mmc->tran_speed);
> +                               mmc_set_clock(mmc, mmc->tran_speed, false);
>                         }
>                 }
>         }
> @@ -1465,7 +1466,7 @@ static int mmc_select_mode_and_width(struct mmc *mmc)
>
>                         /* configure the bus mode (host) */
>                         mmc_select_mode(mmc, mwt->mode);
> -                       mmc_set_clock(mmc, mmc->tran_speed);
> +                       mmc_set_clock(mmc, mmc->tran_speed, false);
>
>                         /* do a transfer to check the configuration */
>                         err = mmc_read_and_compare_ext_csd(mmc);
> @@ -1928,7 +1929,7 @@ static void mmc_set_initial_state(struct mmc *mmc)
>                 printf("failed to set signal voltage\n");
>
>         mmc_set_bus_width(mmc, 1);
> -       mmc_set_clock(mmc, 1);
> +       mmc_set_clock(mmc, 1, false);
>         mmc_select_mode(mmc, MMC_LEGACY);
>  }
>
> diff --git a/include/mmc.h b/include/mmc.h
> index 43d37a4..097a685 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -466,6 +466,7 @@ struct mmc {
>         void *priv;
>         uint has_init;
>         int high_capacity;
> +       u8 clk_disable;

bool? Also add comment.

>         uint bus_width;
>         uint clock;
>         uint signal_voltage;
> @@ -557,7 +558,7 @@ int mmc_unbind(struct udevice *dev);
>  int mmc_initialize(bd_t *bis);
>  int mmc_init(struct mmc *mmc);
>  int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
> -int mmc_set_clock(struct mmc *mmc, uint clock);
> +int mmc_set_clock(struct mmc *mmc, uint clock, u8 disable);

Function comment

>  struct mmc *find_mmc_device(int dev_num);
>  int mmc_set_dev(int dev_num);
>  void print_mmc_devices(char separator);
> --
> 1.9.1
>

  reply	other threads:[~2017-05-15  3:28 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170512181724epcas5p36ff2843856a4d329a0b106cd063f7286@epcas5p3.samsung.com>
2017-05-12 18:16 ` [U-Boot] [PATCH 00/22] mmc: Add support for HS200 and UHS modes Jean-Jacques Hiblot
2017-05-12 18:16   ` [U-Boot] [PATCH 01/22] mmc: split mmc_startup() Jean-Jacques Hiblot
2017-05-15  3:27     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 02/22] mmc: move the MMC startup for version above v4.0 in a separate function Jean-Jacques Hiblot
2017-05-15  3:27     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 03/22] mmc: make ext_csd part of struct mmc Jean-Jacques Hiblot
2017-05-15  3:27     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 04/22] mmc: add a function to read and test the ext csd (mmc >= 4) Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 05/22] mmc: introduces mmc modes Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-15 10:34       ` Jean-Jacques Hiblot
2017-05-12 18:16   ` [U-Boot] [PATCH 06/22] mmc: Add a fonction to dump the mmc capabilities Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 07/22] mmc: use mmc modes to select the correct bus speed Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 08/22] cmd: mmc: display the mode name and current bus speed in the mmc info Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 09/22] mmc: refactor SD startup to make it easier to support new modes Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-15 10:49       ` Jean-Jacques Hiblot
2017-05-12 18:16   ` [U-Boot] [PATCH 10/22] mmc: refactor MMC " Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-25 12:25     ` Jaehoon Chung
2017-05-25 14:40       ` Jean-Jacques Hiblot
2017-05-26  1:12         ` Jaehoon Chung
2017-05-12 18:16   ` [U-Boot] [PATCH 11/22] mmc: make mmc_set_ios() return status Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 12/22] mmc: Enable signal voltage to be selected from mmc core Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-15 14:18       ` Jean-Jacques Hiblot
2017-05-17  1:38         ` Simon Glass
2017-05-17 10:35       ` Kishon Vijay Abraham I
2017-05-12 18:16   ` [U-Boot] [PATCH 13/22] mmc: Add a new callback function to enable/disable vdd Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 14/22] mmc: add power cyle support in mmc core Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-15 15:50       ` Jean-Jacques Hiblot
2017-05-25 12:35     ` Jaehoon Chung
2017-05-25 14:50       ` Jean-Jacques Hiblot
2017-06-15 16:13       ` Jean-Jacques Hiblot
2017-05-12 18:16   ` [U-Boot] [PATCH 15/22] mmc: add a new mmc parameter to disable mmc clock Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass [this message]
2017-05-12 18:16   ` [U-Boot] [PATCH 16/22] mmc: disable the mmc clock during power off Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 17/22] mmc: Add a execute_tuning() callback to the mmc operations Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-25 12:37     ` Jaehoon Chung
2017-05-25 14:51       ` Jean-Jacques Hiblot
2017-05-12 18:16   ` [U-Boot] [PATCH 18/22] mmc: add HS200 support in MMC core Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-25 12:42     ` Jaehoon Chung
2017-05-12 18:16   ` [U-Boot] [PATCH 19/22] mmc: Add a new callback function to check if the card is busy Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-12 18:16   ` [U-Boot] [PATCH 20/22] mmc: Add support for UHS modes Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-16 14:20     ` Jean-Jacques Hiblot
2017-05-17  1:59       ` Jaehoon Chung
2017-05-25 12:50     ` Jaehoon Chung
2017-05-12 18:16   ` [U-Boot] [PATCH 21/22] mmc: Change mode when switching to a boot partition Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-25 12:53     ` Jaehoon Chung
2017-05-12 18:16   ` [U-Boot] [PATCH 22/22] mmc: Retry some MMC cmds on failure Jean-Jacques Hiblot
2017-05-15  3:28     ` Simon Glass
2017-05-15 15:49       ` Jean-Jacques Hiblot
2017-05-17  1:38         ` Simon Glass
2017-05-17 14:47           ` Jean-Jacques Hiblot
2017-05-15  2:33   ` [U-Boot] [PATCH 00/22] mmc: Add support for HS200 and UHS modes Jaehoon Chung
2017-05-18  4:27   ` Jaehoon Chung
2017-05-23 15:24     ` Jean-Jacques Hiblot
2017-05-25  7:41       ` Jaehoon Chung
2017-05-25 14:42         ` Jean-Jacques Hiblot
2017-06-02 16:46         ` Jean-Jacques Hiblot
2017-06-16 10:00         ` Jean-Jacques Hiblot
2017-06-29  9:59           ` Jaehoon Chung
2017-07-26 11:33             ` Kever Yang
2017-07-28 13:05               ` Jaehoon Chung
2017-08-25  8:16                 ` Ziyuan
2017-08-27 20:10                   ` Simon Glass
2017-08-27 20:17                     ` Tom Rini
2017-08-28  5:53                       ` Jaehoon Chung
2017-09-12 21:31                         ` Marek Vasut
2017-08-28  5:45                     ` Ziyuan
2017-09-15 13:20                 ` Jean-Jacques Hiblot
2017-09-16 17:12                   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPnjgZ2oiTGX46Qe5f2ORVkZVme-CgwZ7E7060Nd+1hLSt=HJA@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.