How to change eMMC(usdhc) frequency from uboot ?

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

How to change eMMC(usdhc) frequency from uboot ?

Jump to solution
5,039 Views
rakesh_patel
Senior Contributor I

Hi,

How to changes frequency for usdhc frequency in imx6sx board with kernel version: 4.1.15. 

We have custom board based on imx6sx and we are using eMMC with it.

We have changed value in following but changes are not reflected.

File: board/freescale/mx6sxsabresd/mx6sxsabresd.c

API: board_mmc_init

Code :

usdhc_cfg[2].sdhc_clk = 190000000;
printf("DEBUG: Passing new EMMC value 190000000\n");

Output from Linux:

cat /sys/kernel/debug/mmc3/clock
198000000

Is it possible to change eMMC frequency for kernel(or dts file) ?

Labels (1)
0 Kudos
1 Solution
4,548 Views
igorpadykov
NXP Employee
NXP Employee

Hi Rakesh

one can try to change usdhc frequency in dcd header

imximage.cfg\mx6sxsabresd\freescale\board - uboot-imx - i.MX U-Boot 

use Figure 19-2. Clock Tree i.MX 6SoloX Applications Processor Reference Manual

in linux one can pay attention to "state_100mhz", "state_200mhz" properties

imx6sx-sdb.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

However linux driver sets usdhc frequency automatically based on emmc CSD register

information. May be useful to check :

[PATCH 1/1] mmc: debugfs: Set frequency to maximum possible on higher request 

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

View solution in original post

0 Kudos
2 Replies
4,549 Views
igorpadykov
NXP Employee
NXP Employee

Hi Rakesh

one can try to change usdhc frequency in dcd header

imximage.cfg\mx6sxsabresd\freescale\board - uboot-imx - i.MX U-Boot 

use Figure 19-2. Clock Tree i.MX 6SoloX Applications Processor Reference Manual

in linux one can pay attention to "state_100mhz", "state_200mhz" properties

imx6sx-sdb.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

However linux driver sets usdhc frequency automatically based on emmc CSD register

information. May be useful to check :

[PATCH 1/1] mmc: debugfs: Set frequency to maximum possible on higher request 

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

0 Kudos
4,548 Views
rakesh_patel
Senior Contributor I

Hi igorpadykov‌:

Thanks for sharing this information.

eMMC frequency changes take effect if frequency is < 100Mhz. For 100Mhz to 198Mhz, it always sets 99Mhz.

root@imx6sxsabresd:/sys/kernel/debug/mmc3# echo 100000000 > clock
root@imx6sxsabresd:/sys/kernel/debug/mmc3# cat ios
clock: 100000000 Hz
actual clock: 99000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 3 (8 bits)
timing spec: 9 (mmc HS200)
signal voltage: 0 (1.80 V)
root@imx6sxsabresd:/sys/kernel/debug/mmc3# echo 190000000 > clock
root@imx6sxsabresd:/sys/kernel/debug/mmc3# cat ios
clock: 190000000 Hz
actual clock: 99000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 3 (8 bits)
timing spec: 9 (mmc HS200)
signal voltage: 0 (1.80 V)
root@imx6sxsabresd:/sys/kernel/debug/mmc3# echo 198000000 > clock
root@imx6sxsabresd:/sys/kernel/debug/mmc3# cat ios
clock: 198000000 Hz
actual clock: 198000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 3 (8 bits)
timing spec: 9 (mmc HS200)
signal voltage: 0 (1.80 V)

Is there any divider need to set anywhere ?

0 Kudos