Change freqency of mmc on imx6dl

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change freqency of mmc on imx6dl

3,940 Views
dongpv
Contributor III

Hi,


I am using IMX6DL and linux kernel 4.1.15 , uboot 2015.04.

I understand that imx6 support eMMC 4.x with HS200 and default speed of mmc is 52Mhz.

I have 2 questions :

- How can I know that eMMC is working with SDR or DDR?

- How can we change speed of mmc for eMMC? which speeds will it support?

Can we set clock of mmc < 26Mhz ? I want to reduce it for EMC product testing.

In Uboot, I tried to change speed to difference value as below :

drivers/mmc/mmc.c

.........

mmc-> tran_speed = 2000000 ;

but after boot, I alway got 52Mhz from command :

cat /sys/kernel/debug/mmc3/clock
52000000

Thanks & Best Regards,

Dong

Labels (4)
6 Replies

2,745 Views
juanalbertogonz
Contributor II

Hi,

did anybody got this working, I'm doing something similar already tried editing .dtsi adding:

clock-frequency = <20000000>;
max-frequency = <20000000>;

 

 

also editing fsl_esdhc.c  on the line 
cfg->cfg.f_max = MIN(gd->arch.sdhc_clk, 20000000);

also drivers/mmc/core/mmc.c 

// if (mmc_card_highspeed(card) && (max_dtr > 52000000))
if (mmc_card_highspeed(card) && (max_dtr > 20000000))
// max_dtr = 52000000;
max_dtr = 20000000;

 

but still get the 50Mhz....

0 Kudos

3,014 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dong

one can look at kernel mmc:

http://comments.gmane.org/gmane.linux.kernel.mmc/16311 

in uboot one can try fsl_esdhc.c, fsl_esdhc_initialize() change cfg->cfg.f_max = min(cfg->sdhc_clk, (u32)52000000);
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/drivers/mmc/fsl_esdhc.c?h=imx_v2016.03_...

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,014 Views
dongpv
Contributor III

Hi igor,

Thanks so much for your reply.

I don't know why I still got 52Mhz after change like your suggestion to many difference values < 52000000 in uboot : min(cfg->sdhc_clk, (u32)52000000)

Don't have any changing after change that code.

Below is image that I captured clock from OSC when I run test eMMC, It alway is 49.x Mhz.

eMMC_clock.png

Best regards,

Dong

0 Kudos

3,014 Views
dongpv
Contributor III

Hi everybody,

Do you have any suggestion for me in this case?

I am looking forward you respond!

Thanks & Best Regards,

Dong

0 Kudos

3,014 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dong

had you changed 52000000 to some other value ?

Best regards
igor

0 Kudos

3,014 Views
dongpv
Contributor III

Hi igor,

Yes, I already changed with many other value ( < 52000000).

Some value I tried to change like : 26000000, 40000000, 46000000,....But nothing change, I still got same clock at above picture , about 49.6Mhz when measuring by OSC or by command like below :

cat /sys/kernel/debug/mmc3/clock
52000000

Best Regards,

Dong

0 Kudos