dts parameter "voltage-ranges" usage in Linux

cancel
Showing results for 
Search instead for 
Did you mean: 

dts parameter "voltage-ranges" usage in Linux

Jump to solution
2,062 Views
ko-hey
Senior Contributor II

Hi all

 

I have a question about dts parameter of "voltage-ranges" is necessary or not.

I got a following error when I don't set a dts usdhc parameter of "voltage-ranges".

 

[    1.677059] /soc/aips-bus@02100000/usdhc@02198000: voltage-ranges unspecified

 

Q1.

According to the kernel code, it seems that it does not refer in particular.

Also there is no example adding "voltage-ranges" even if you look at the descriptions in the imx-based device tree.

 

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

/drivers/mmc/core/mmc.c

int mmc_of_parse_voltage(struct device_node *np, u32 *mask)

              {

                            const u32 *voltage_ranges;

                            int num_ranges, i;

 

                            voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);

                            num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;

                            if (!voltage_ranges || !num_ranges) {

                                          pr_info("%s: voltage-ranges unspecified\n", np->full_name);

                                          return -EINVAL;

                            }

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

 

 

Do I need to set a parameter of "voltage-ranges" ?

 

 

Q2.

If Q1 is yes, which case do I need to set ?

 

 

 

 

Add info:

Here is a dts sample settings.

 

ex)

&usdhc3 {

              pinctrl-names = "default";

              pinctrl-0 = <&pinctrl_usdhc3>;

              non-removable;

              no-1-8-v;

              voltage-ranges = <3200 3400>; // <-

              keep-power-in-suspend;

              status = "okay";

};

 

 

Ko-hey

 

0 Kudos
1 Solution
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

you are right that it is not used in platform driver, however it is used

in linux high level mmc core driver linux/drivers/mmc/core/core.c

linux-imx.git - i.MX Linux Kernel 

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
19 Replies
1,219 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

you are right that it is not used in platform driver, however it is used

in linux high level mmc core driver linux/drivers/mmc/core/core.c

linux-imx.git - i.MX Linux Kernel 

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

0 Kudos
1,218 Views
ko-hey
Senior Contributor II

Hi igorpadykov

Thank you for quick reply.

So we need to set it because it is used in linux high level mmc core driver. Am I correct ?

Ko-hey

0 Kudos
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

yes correct.

Best regards
igor

0 Kudos
1,218 Views
ko-hey
Senior Contributor II

Hi igorpadykov

Regarding the voltage-ranges of the device tree shown below, could you tell us a description example on the SABRE board ?

As far as the i.MX Linux® Reference Manual is concerned, there is no description about voltage-ranges and there is no device tree example.

When we add voltage-ranges parameter, we got following comment.

It seems that we need to set "vmmc-supply", "vqmmc-supply2.

[    1.677079] sdhci-esdhc-imx 2198000.usdhc: No vmmc regulator found

[    1.683276] sdhci-esdhc-imx 2198000.usdhc: No vqmmc regulator found

As we set these items, our original boards are no longer working.

Here is a dtsi sample.

<SABREimx6qdl-sabresd.dtsi>

&usdhc4 {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_usdhc4>;

        bus-width = <8>;

        non-removable;

        no-1-8-v;

        keep-power-in-suspend;

        status = "okay";

};

The background of the question

A phenomenon that eMMC can not be accessed normally is occurring in the i.MX6DL device, and I am investigating with the eMMC manufacturer.

It is a phenomenon which has not occurred in other iMX 6 devices,

The feature of the device of i.MX6DL's equipment is that vccq of eMMC is 3.3 v. (1.8 v for the others, 3.3 v for the sabre board)

I am inquiring as soon as I close the product release by investigating whether the setting of the device tree I am inquiring about this phenomenon is related to the above phenomenon.

If you look at the movement of the kernel, it seems that you are choosing the voltage setting from the information (EXT_CSD) on the eMMC side without setting this device tree.http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/drivers/mmc/core/mmc.c?h=imx_4.1.15_2.0...

static int mmc_select_hs_ddr(struct mmc_card *card)

              ・・・

              err = -EINVAL;

              if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_DDR_1_2V)

                            err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120);

              if (err && (card->mmc_avail_type & EXT_CSD_CARD_TYPE_DDR_1_8V))

                            err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180);

              /* make sure vccq is 3.3v after switching disaster */

              if (err)

                            err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330);

Ko-hey

0 Kudos
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

if, as you said : "It is a phenomenon which has not occurred in other iMX 6 devices"

this is not linux documentation question. Suggest to narrow down issue not using linux,

probably with baremetal tests (baremetal SDK can be found on SMP Enable in IMX6 )

Regarding linux deeper investigation suggest to use Professional Services :
NXP Professional Services|NXP 

Best regards
igor

0 Kudos
1,218 Views
ko-hey
Senior Contributor II

Hi igorpadykov

I don't know that whether the phenomenon which has not occurred in other iMX 6 devices or not.

But I tested with a baremetal tests before and it operated proper.

By the way, it's about "voltage-ranges” parameters.

As you said in this thread, voltage-ranges” parameter is necessary to add in linux code because it use in high level mmc core driver.

In that case, could you tell me why it does not use in imx6qdl-sabresd.dtsi ?

http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/arch/arm/boot/dts/imx6qdl-sabresd.dtsi?...

Also could you tell me how to set it ?

Ko-hey

0 Kudos
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

>In that case, could you tell me why it does not use in imx6qdl-sabresd.dtsi ?

imx6qdl-sabresd.dtsi is included in imx6q-sabresd.dts.

This parameter is not used in i.mx usdhc platform driver (sdhci-esdhc-imx), only in high level linux driver.

Best regards
igor

0 Kudos
1,218 Views
ko-hey
Senior Contributor II

Hi igorpadykov

Although we do not intentionally use core.c by our company.

According to the Makefile, It is targeted for build when MMC configuration is enabled.

http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/drivers/mmc/core/Makefile?h=imx_4.1.15_...

Also, because we build core.c from the build result of Saber board's Yocto environment, I think there are points which are incompatible with the content you responded to.

> http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/Documentat

> ion / devicetree / bindings / mmc / fsl-esdhc.txt? h = imx_4.1.15 _ 2.0.0 _ ga

The content of the description here is the result I tried as a result, I asked the previous question.

Is it not enough with only voltage-ranges ?

I think that I need more settings except voltage-ranges.

Ko-hey

0 Kudos
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

 

NXP provides linux bsps which were verified with NXP Sabre SD reference boards and work fine.
They are documented on link
If you are using custom board&custom linux with different settings and have issues, recommended to use
extended support with Professional Services
If you think that NXP bsps have issues, please provide steps how this could be reproduced on
NXP Sabre SD reference board with Demo Images from i.MX Software|NXP link.
 

Best regards
igor

0 Kudos
1,217 Views
ko-hey
Senior Contributor II

Hi igorpadykov

I got a same message with image which can download from NXP web site.

Please check an attachment around line 250.

Ko-hey

0 Kudos
1,217 Views
igorpadykov
NXP TechSupport
NXP TechSupport

what board used in the case, is it NXP reference board ?

Best regards
igor

0 Kudos
1,217 Views
ko-hey
Senior Contributor II

Hi igorpadykov

Yes, I reproduced it with MCIMX6DL-SDP.

Ko-hey

0 Kudos
1,217 Views
igorpadykov
NXP TechSupport
NXP TechSupport

did you change image, meaning don't set a dts usdhc parameter of "voltage-ranges"?

~igor

0 Kudos
1,217 Views
ko-hey
Senior Contributor II

no, I didn't change image form default which is in MFGTool

Ko-hey

0 Kudos
1,217 Views
igorpadykov
NXP TechSupport
NXP TechSupport

original question was about "parameter of "voltage-ranges" " and seems

it is answered. For new questions please create new thread and provide

detailed description of issue (used demo board, link to software, full log).

Please use, if necessary. Demo Images (not default in MFGTool)

i.MX Software|NXP 

Best regards
igor

0 Kudos
1,217 Views
ko-hey
Senior Contributor II

Hi igorpadykov

Your answer is not fully enough because I think that there is contradiction in your answer.

You said as below.

1. user need to set a parameter of voltage-ranges when it is used in linux high level mmc core driver.

2. SABRE doesn't use a linux high level mmc core driver.

3. This parameter is not used in i.mx usdhc platform driver (sdhci-esdhc-imx), only in high level linux driver.

I believe that If your answer is correct, the following message will not be output when using SABRE.

[   1.677059] /soc/aips-bus@02100000/usdhc@02198000: voltage-ranges unspecified

In this situation, I have two questions about the message and parameter of "voltage-ranges".

1. Why does the message output when I use SABRE ?

2. How to avoid the message ?

  As I mentioned before, I got new message when I add a parameter of "voltage-ranges" as below.

[    1.677079] sdhci-esdhc-imx 2198000.usdhc: No vmmc regulator found

[    1.683276] sdhci-esdhc-imx 2198000.usdhc: No vqmmc regulator found

Ko-hey

0 Kudos
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

sorry, probably you misunderstood me.

Correct answers are:

>SABRE doesn't use a linux high level mmc core driver.

Sabre SD linux image and its emmc/sd driver uses all linux sd/emmc subsystem, including core driver.

>This parameter is not used in i.mx usdhc platform driver (sdhci-esdhc-imx), only in high level linux driver.

right, NXP platrorm driver driver (sdhci-esdhc-imx) does not use parameter  "voltage-ranges".

Since parameter  "voltage-ranges" is not used by NXP platform driver, but high level linux sd/emmc sussystem 

drivers, please post questions for that parameter to linux mail list. Note, linux is not NXP product, it is developed by linux community

Majordomo Lists at VGER.KERNEL.ORG 

Best regards
igor

0 Kudos
1,218 Views
ko-hey
Senior Contributor II

Hi igorpadykov

Sabre SD linux image doesn't use the parameter "voltage-ranges".

Am I correct ?

In the other word, it can ignore the message.

Am I correct ?

Ko-hey

0 Kudos
1,218 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ko-hey

Sabre SD linux image uses common linux driver which consists of many layers, refer to below image

pastedImage_1.jpg

it is used in linux high level Bus Protocol Driver : mmc core driver linux/drivers/mmc/core/core.c

note, this driver is developed by linux community.

It is not used in Host Controller Driver sdhci-esdhc-imx.c (which is developed by NXP)

Best regards
igor

0 Kudos