How to add a dedicated line for cd-gpios on usdhc1?

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

How to add a dedicated line for cd-gpios on usdhc1?

Jump to solution
2,571 Views
damienhuang
Contributor IV

Hi,

I would like to add a dedicated line as cd-gpios for usdhc1. The pin I connected was MX6QDL_PAD_GPIO_1, so I added

"MX6QDL_PAD_GPIO_1__SD1_CD_B 0x80000000" to structure imx6q-sabrelite in imx6qdl-sabrelite.dtsi file to config the MX6QDL_PAD_GPIO_1 pin for SD1_CD_B function.

But then how I should describe the cd-gpios pin for the usdhc1 device? I saw it all following the same pattern of "cd-gpios = <&gpiox pin level>"  for other usdhc device, but since in my situation the pin is a dedicated pin, so I can not follow the same pattern. Can someone help?

Alternatively, should I just add a line of "MX6QDL_PAD_GPIO_1__SD1_CD_B 0x17071" into structure usdhc1 in imx6qdl.dtsi file? just under the existing pin descriptions for usdhc1.

Regards

Damien

Labels (2)
0 Kudos
1 Solution
1,531 Views
damienhuang
Contributor IV

Hi Igor,

Please don't worry about my question now, it had been fixed.

Instead of setting MAX6QDL_PAD_GPIO_1 to SD1_CD_B, I set it to GPIO1_IO01 with instruction "MAX6QDL_PAD_GPIO_1__GPIO1_IO01 0x17059" in structure imx6q-sabrelite in file imx6qdl-sabrelite.dtsi. And then I use the below structure to describe it within the same file.

&usdhc1 {

     pinctrl-names = "default";

     pinctrl-0 = <&princtrl_usdhc1_1>;

     cd-gpios = <&gpio1 1 0>;

     no-1-8-v;

     keep-power-in-suspend;

     enable-sdio-wakeup;

     status = "okey";

};

Log messages from console at boot time now is as below:

     "

          sdhci: Secure Digital Host Controller Interface driver

          sdhci: Copyright(c) Pierre Ossman

          sdhci-pltfm: SDHCI platform and OF driver helper

          mmc0: no vqmmc regulator found

          mmc0: no vmmc regulator found

          mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA

     "

Log message from console at the time of SD card insertion is as below:

     "

          mmc0: host does not support reading read-only switch. assuming write-enable.

          mmc0: new high speed SDHC card at address b368

          mmcblk0: mmc0:b368       3.73 GiB

            mmcblk0: p1 p2 p3 < p5 p6 p7 p8 > p4

     "

Thanks for your time, igor. It is much appreciated.

Regards,

Damien

View solution in original post

0 Kudos
3 Replies
1,531 Views
igorpadykov
NXP Employee
NXP Employee

Hi Damien

according to linux/Documentation/devicetree..

linux-2.6-imx.git - Freescale i.MX Linux Tree

should be used:

fsl,cd-controller : Indicate to use controller internal card detection

seems below example ["&esdhc1 "] uses this property

linux-2.6-imx.git - Freescale i.MX Linux Tree

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

1,531 Views
damienhuang
Contributor IV

Thanks igor.

I followed the example you gave to add a structure as below into file imx6qdl-sabrelite.dtsi

&usdhc1 {

     pinctrl-names = "default";

     pinctrl-0 = <&pinctrl_usdhc1_1>;

     fsl,cd-controller;

     vmmc-supply = <&reg_3p3v>;

     status = "okay";

};

but the machine seems still not able to detect the insertion of a SD card to usdhc1.

below is the log from console in regard to usdhc1 (mmc0) at boot time.

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

sdhci-pltfm: SDHCI platform and OF driver helper

sdhci-esdhc-imx 2190000.usdhc: could not get ultra high speed state, work on normal mode

mmc0: no vqmmc regulator found

mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA

and there was nothing output from console when SD card was inserted into slot.

I am wondering how the software knew pin MX6QDL_PAD_GPIO_1__SD1_CD_B was used for card detection but not others. It seems to me there must something missing in this area. do you have more info on this?

Cheers,

0 Kudos
1,532 Views
damienhuang
Contributor IV

Hi Igor,

Please don't worry about my question now, it had been fixed.

Instead of setting MAX6QDL_PAD_GPIO_1 to SD1_CD_B, I set it to GPIO1_IO01 with instruction "MAX6QDL_PAD_GPIO_1__GPIO1_IO01 0x17059" in structure imx6q-sabrelite in file imx6qdl-sabrelite.dtsi. And then I use the below structure to describe it within the same file.

&usdhc1 {

     pinctrl-names = "default";

     pinctrl-0 = <&princtrl_usdhc1_1>;

     cd-gpios = <&gpio1 1 0>;

     no-1-8-v;

     keep-power-in-suspend;

     enable-sdio-wakeup;

     status = "okey";

};

Log messages from console at boot time now is as below:

     "

          sdhci: Secure Digital Host Controller Interface driver

          sdhci: Copyright(c) Pierre Ossman

          sdhci-pltfm: SDHCI platform and OF driver helper

          mmc0: no vqmmc regulator found

          mmc0: no vmmc regulator found

          mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA

     "

Log message from console at the time of SD card insertion is as below:

     "

          mmc0: host does not support reading read-only switch. assuming write-enable.

          mmc0: new high speed SDHC card at address b368

          mmcblk0: mmc0:b368       3.73 GiB

            mmcblk0: p1 p2 p3 < p5 p6 p7 p8 > p4

     "

Thanks for your time, igor. It is much appreciated.

Regards,

Damien

0 Kudos