[U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed

Jae hoon Chung jh80.chung at gmail.com
Mon Apr 2 20:31:38 CEST 2012


Hi Andy.

How do you about this patch?
I want to know your thinking.
In my case, clock is set to 50MHz, but mmcinfo is produced the "25MHz".
Because tran_speed is 25MHz.
But mmc->card_caps is set to MMC_MODE_HS and MMC_MODE_HS_52MHZ.
So we should be see the wrong information with mmcinfo.

Best Regards,
Jaehoon Chung

2012/3/27 Jaehoon Chung <jh80.chung at samsung.com>:
> mmc_set_clock is set to the hard-coding.
> But i think good that use the tran_speed value.
>
> Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
>  drivers/mmc/mmc.c |   13 +++++++------
>  1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index e035012..cba96cf 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1124,9 +1124,9 @@ int mmc_startup(struct mmc *mmc)
>                }
>
>                if (mmc->card_caps & MMC_MODE_HS)
> -                       mmc_set_clock(mmc, 50000000);
> +                       mmc->tran_speed = 50000000;
>                else
> -                       mmc_set_clock(mmc, 25000000);
> +                       mmc->tran_speed = 25000000;
>        } else {
>                for (width = EXT_CSD_BUS_WIDTH_8; width >= 0; width--) {
>                        /* Set the card to use 4 bit*/
> @@ -1161,13 +1161,14 @@ int mmc_startup(struct mmc *mmc)
>
>                if (mmc->card_caps & MMC_MODE_HS) {
>                        if (mmc->card_caps & MMC_MODE_HS_52MHz)
> -                               mmc_set_clock(mmc, 52000000);
> +                               mmc->tran_speed = 52000000;
>                        else
> -                               mmc_set_clock(mmc, 26000000);
> -               } else
> -                       mmc_set_clock(mmc, 20000000);
> +                               mmc->tran_speed = 26000000;
> +               }
>        }
>
> +       mmc_set_clock(mmc, mmc->tran_speed);
> +
>        /* fill in device description */
>        mmc->block_dev.lun = 0;
>        mmc->block_dev.type = 0;
> --
> 1.7.4.1
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list