* [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed
@ 2012-03-27 7:16 Jaehoon Chung
2012-04-02 18:31 ` Jae hoon Chung
0 siblings, 1 reply; 5+ messages in thread
From: Jaehoon Chung @ 2012-03-27 7:16 UTC (permalink / raw)
To: u-boot
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@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed
2012-03-27 7:16 [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed Jaehoon Chung
@ 2012-04-02 18:31 ` Jae hoon Chung
2012-05-07 21:50 ` Andy Fleming
0 siblings, 1 reply; 5+ messages in thread
From: Jae hoon Chung @ 2012-04-02 18:31 UTC (permalink / raw)
To: u-boot
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@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@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed
2012-04-02 18:31 ` Jae hoon Chung
@ 2012-05-07 21:50 ` Andy Fleming
2012-05-08 2:51 ` Jaehoon Chung
0 siblings, 1 reply; 5+ messages in thread
From: Andy Fleming @ 2012-05-07 21:50 UTC (permalink / raw)
To: u-boot
On Mon, Apr 2, 2012 at 1:31 PM, Jae hoon Chung <jh80.chung@gmail.com> wrote:
>> ? ? ? ? ? ? ? ?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;
>> + ? ? ? ? ? ? ? }
Why did you remove the outer else clause, here (the one that set the
speed to 20000000)?
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed
2012-05-07 21:50 ` Andy Fleming
@ 2012-05-08 2:51 ` Jaehoon Chung
2012-05-08 21:39 ` Andy Fleming
0 siblings, 1 reply; 5+ messages in thread
From: Jaehoon Chung @ 2012-05-08 2:51 UTC (permalink / raw)
To: u-boot
Hi Andy.
On 05/08/2012 06:50 AM, Andy Fleming wrote:
> On Mon, Apr 2, 2012 at 1:31 PM, Jae hoon Chung <jh80.chung@gmail.com> wrote:
>
>>> 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;
>>> + }
>
>
> Why did you remove the outer else clause, here (the one that set the
> speed to 20000000)?
>
If card->caps didn't set MMC_MODE_HS, then it's set to mmc->tran_speed.
That value is assigned from freq * mult.
I think that is reasonable..if set to 20000000 here, then why need freq & mult?
Best Regards,
Jaehoon Chung
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed
2012-05-08 2:51 ` Jaehoon Chung
@ 2012-05-08 21:39 ` Andy Fleming
0 siblings, 0 replies; 5+ messages in thread
From: Andy Fleming @ 2012-05-08 21:39 UTC (permalink / raw)
To: u-boot
On Mon, May 7, 2012 at 9:51 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Hi Andy.
>
> On 05/08/2012 06:50 AM, Andy Fleming wrote:
>
>> On Mon, Apr 2, 2012 at 1:31 PM, Jae hoon Chung <jh80.chung@gmail.com> wrote:
>>
>>>> ? ? ? ? ? ? ? ?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;
>>>> + ? ? ? ? ? ? ? }
>>
>>
>> Why did you remove the outer else clause, here (the one that set the
>> speed to 20000000)?
>>
>
> If card->caps didn't set MMC_MODE_HS, then it's set to mmc->tran_speed.
> That value is assigned from freq * mult.
>
> I think that is reasonable..if set to 20000000 here, then why need freq & mult?
Ok, that's probably fine, then.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-08 21:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-27 7:16 [U-Boot] [U-BOOT][PATCH] mmc: remove the hard setting for tran_speed Jaehoon Chung
2012-04-02 18:31 ` Jae hoon Chung
2012-05-07 21:50 ` Andy Fleming
2012-05-08 2:51 ` Jaehoon Chung
2012-05-08 21:39 ` Andy Fleming
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.