Hi Simon,

> -----Original Message-----
> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> Sent: 2018年3月7日 1:42
> To: Peng Fan <peng....@nxp.com>
> Cc: Jaehoon Chung <jh80.ch...@samsung.com>; Stefano Babic
> <sba...@denx.de>; U-Boot Mailing List <u-boot@lists.denx.de>; Jean-Jacques
> Hiblot <jjhib...@ti.com>; Kishon Vijay Abraham I <kis...@ti.com>; Bin Meng
> <bmeng...@gmail.com>
> Subject: Re: [PATCH 1/2] mmc: add HS400 support
> 
> Hi Peng,
> 
> On 5 March 2018 at 02:11, Peng Fan <peng....@nxp.com> wrote:
> > Add HS400 support.
> > Selecting HS400 needs first select HS199 according to spec, so use a
> > dedicated function for HS400.
> > Add HS400 related macros.
> > Remove the restriction of only using the low 6 bits of
> > EXT_CSD_CARD_TYPE, using all the 8 bits.
> >
> > Signed-off-by: Peng Fan <peng....@nxp.com>
> > Cc: Jaehoon Chung <jh80.ch...@samsung.com>
> > Cc: Jean-Jacques Hiblot <jjhib...@ti.com>
> > Cc: Stefano Babic <sba...@denx.de>
> > Cc: Simon Glass <s...@chromium.org>
> > Cc: Kishon Vijay Abraham I <kis...@ti.com>
> > Cc: Bin Meng <bmeng...@gmail.com>
> > ---
> >  drivers/mmc/Kconfig |   7 +++
> >  drivers/mmc/mmc.c   | 133
> ++++++++++++++++++++++++++++++++++++++++++----------
> >  include/mmc.h       |  12 +++++
> >  3 files changed, 127 insertions(+), 25 deletions(-)
> >
> > diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index
> > 5f67e336db..e9be18b333 100644
> > --- a/drivers/mmc/Kconfig
> > +++ b/drivers/mmc/Kconfig
> > @@ -104,6 +104,13 @@ config SPL_MMC_UHS_SUPPORT
> >           cards. The IO voltage must be switchable from 3.3v to 1.8v. The
> bus
> >           frequency can go up to 208MHz (SDR104)
> >
> > +config MMC_HS400_SUPPORT
> > +       bool "enable HS400 support"
> > +       select MMC_HS200_SUPPORT
> > +       help
> > +         The HS400 mode is support by some eMMC. The bus frequency is
> up to
> > +         200MHz. This mode requires tuning the IO.
> > +
> >  config MMC_HS200_SUPPORT
> >         bool "enable HS200 support"
> >         help
> > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> > 92ea78b8af..eef229c8b4 100644
> > --- a/drivers/mmc/mmc.c
> > +++ b/drivers/mmc/mmc.c
> > @@ -169,6 +169,7 @@ const char *mmc_mode_name(enum bus_mode
> mode)
> >               [MMC_HS_52]       = "MMC High Speed (52MHz)",
> >               [MMC_DDR_52]      = "MMC DDR52 (52MHz)",
> >               [MMC_HS_200]      = "HS200 (200MHz)",
> > +             [MMC_HS_400]      = "HS400 (200MHz)",
> >         };
> >
> >         if (mode >= MMC_MODES_END)
> > @@ -193,6 +194,7 @@ static uint mmc_mode2freq(struct mmc *mmc, enum
> bus_mode mode)
> >               [UHS_DDR50]       = 50000000,
> >               [UHS_SDR104]      = 208000000,
> >               [MMC_HS_200]      = 200000000,
> > +             [MMC_HS_400]      = 200000000,
> >         };
> >
> >         if (mode == MMC_LEGACY)
> > @@ -790,6 +792,11 @@ static int mmc_set_card_speed(struct mmc *mmc,
> enum bus_mode mode)
> >         case MMC_HS_200:
> >                 speed_bits = EXT_CSD_TIMING_HS200;
> >                 break;
> > +#endif
> > +#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
> > +       case MMC_HS_400:
> > +               speed_bits = EXT_CSD_TIMING_HS400;
> > +               break;
> >  #endif
> >         case MMC_LEGACY:
> >                 speed_bits = EXT_CSD_TIMING_LEGACY; @@ -837,7
> +844,7
> > @@ static int mmc_get_capabilities(struct mmc *mmc)
> >
> >         mmc->card_caps |= MMC_MODE_4BIT | MMC_MODE_8BIT;
> >
> > -       cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0x3f;
> > +       cardtype = ext_csd[EXT_CSD_CARD_TYPE];
> >         mmc->cardtype = cardtype;
> >
> >  #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
> > @@ -845,6 +852,12 @@ static int mmc_get_capabilities(struct mmc *mmc)
> >                         EXT_CSD_CARD_TYPE_HS200_1_8V)) {
> >                 mmc->card_caps |= MMC_MODE_HS200;
> >         }
> > +#endif
> > +#if CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
> 
> Is it possible to use if () instead of #if

Just want to keep the same code style in the file. How about use a dedicated 
patch to
cleanup the file after this patch?
Thanks,
Peng.

> 
> Regards,
> Simon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to