How to change the clock frequency of sdhc/sdio in device tree

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to change the clock frequency of sdhc/sdio in device tree

ソリューションへジャンプ
4,082件の閲覧回数
ASTRIHK
Contributor III

The default clock frequency of sdhc2 is 50Mhz, I would like to change it to 40Mhz by adding clock-frequency = <40000000> in device tree; But when I use scope to probe the clock signal, it's still 50Mhz, anyone can help please?

&usdhc2 {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_usdhc2_2>;

    no-1-8-v;

    bus-width = <4>;

    clock-frequency = <40000000>;

    max-frequency = <40000000>;

    keep-power-in-suspend;

    enable-sdio-wakeup;

    status = "okay";

};

ラベル(2)
1 解決策
2,502件の閲覧回数
ASTRIHK
Contributor III

static unsigned mmc_sdio_get_max_clock(struct mmc_card *card)

{

    unsigned max_dtr;

    if (mmc_card_highspeed(card)) {

        /*

        * The SDIO specification doesn't mention how

        * the CIS transfer speed register relates to

        * high-speed, but it seems that 50 MHz is

        * mandatory.

        */

        max_dtr = 40000000;//50000000; <-change this

    } else {

        max_dtr = card->cis.max_dtr;

    }

    if (card->type == MMC_TYPE_SD_COMBO)

        max_dtr = min(max_dtr, mmc_sd_get_max_clock(card));

    return max_dtr;

}

元の投稿で解決策を見る

2 返答(返信)
2,502件の閲覧回数
zhanxiaozhang
Contributor III

this will change all sdio port frequency,we perfer special one

0 件の賞賛
2,503件の閲覧回数
ASTRIHK
Contributor III

static unsigned mmc_sdio_get_max_clock(struct mmc_card *card)

{

    unsigned max_dtr;

    if (mmc_card_highspeed(card)) {

        /*

        * The SDIO specification doesn't mention how

        * the CIS transfer speed register relates to

        * high-speed, but it seems that 50 MHz is

        * mandatory.

        */

        max_dtr = 40000000;//50000000; <-change this

    } else {

        max_dtr = card->cis.max_dtr;

    }

    if (card->type == MMC_TYPE_SD_COMBO)

        max_dtr = min(max_dtr, mmc_sd_get_max_clock(card));

    return max_dtr;

}