Hi,
I need to configure ultra high speed sd card on custom board. Hardware for sd card is like sabre automotive sd card. So it has pin for switch 3V3 to 1V8. I tried with following configuration to enable ultra high speed for linux yocto kernel 3.14.28:
&usdhc4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc4_50mhz>;
pinctrl-1 = <&pinctrl_usdhc4_100mhz>;
pinctrl-2 = <&pinctrl_usdhc4_200mhz>;
cd-gpios = GP_USDHC4_CD;
vmmc-supply = <®_3p3v>;
vqmmc-supply = <®_sd_1p8v>;
vqmmc-1-8-v = <1>;
bus-width = <4>;
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
};
reg_sd_1p8v: regulator@4 {
compatible = "regulator-fixed";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_reg_sd_high>;
regulator-name = "sdhci_ultra_speed";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = GP_USDHC4_REG;
regulator-always-on;
};
pinctrl_reg_sd_high: reg-sd-high {
fsl,pins = <
#define GP_USDHC4_REG <&gpio1 17 GPIO_ACTIVE_LOW>
MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x030b0 //0x1b0b0
>;
};
where vqmmc-supply is configured for 1V8 regulator with pin that switch the voltage. I am able to get high speed for sd card but not ultra high speed.
What is the right way to switch to ultra high speed?
Thanks, regards, Ivan.
After mount the SD on the system ,can you write anything into the SD ?
In my way ,it can not be writed .My command :
root@imx6qsabresd:~# mount -t vfat -wr /dev/mmcblk2p1 sd
root@imx6qsabresd:~# cd sd
root@imx6qsabresd:~/sd# mkdir wwww
mkdir: can't create directory 'wwww': Read-only file system
Hi Ivan
could you try this card on Sabre AI board, to verify
if it works.
Best regards
igor
Hi Ivan
according to SD specififcation host issues CMD11 to invoke voltage switch sequence.
By receiving CMD11, the card returns R1 response and start voltage switch sequence.
No response of CMD11 means that S18A (card indicates S18A=0, which means that
voltage switch is not allowed and the host needs to use current signalling level) was 0 and
therefore host should not have sent CMD11.
So that card does not support voltage switch or broken, one can try it once more on
Sabre AI board or use other card.
Best regards
igor
Hi Igor,
we have fixed all problems regarding voltage and pin for power switch.
What happens now is that high speed memory card is recognized OK, but
UHS-I sd card is getting error:
mmc0: error -110 whilst initialising SD card
On protocol analayzer after CMD11 is issued voltage is changed on low
CMD line and DAT0:3. Clock is still active. After 11 ms voltage is
changed on power switch from low to high and back to low for 2 ms.
DAT0:3 line stays low and clock and command are active and CMD55 is
issued and many CMD63 commands. Power switch is set for 3 more times
from low to high for 2 ms in this communication and fifth time is set to
high completely, but clock,cmd, and DAT0:3 line is low.
Clock voltage is 3V3 all the time. It is not switched as it should be to
1V8.
Is negotiation between UHS-I sd card and processor supposed to be done
this way or this is non regular behavior?
The hardware guys are stated that hardware is ok.
So there is problem with software.
We are using driver version from november 2015 on kernel 3.14.28-1.0.0.
Could this driver be problem?
Thanks, regards, Ivan.
Hi Ivan
does card reply with R1 after CMD11?
According to SD specififcation host issues CMD11 to invoke voltage switch sequence.
By receiving CMD11, the card returns R1 response and start voltage switch sequence.
Regarding negotiation details suggest to check SD specifications.
There are no known UHS-I issues with nxp kernel 3.14.28.
Best regards
igor
Hi Igor,
we have found where the problem is but we do not know why is happening.
Protocol analyzer shows that after CMD 11 is issued card responses with
00 R1 and CMD and DAT3:0 are going to low. After 5 ms power switch
should go to high to switch voltage. But what happens is that power
switch is switched when CMD and clock are already high after ~15ms. So
after 2 ms power switch is going to low because driver detects that
failure condition on CMD and clock line. This behavior is repeted for 4
times and then power switch is going to high constantly. All the time
DAT3:0 are low, only cloack and CMD are active after power switch is set
to low.
I can not find description for such behavior in specification for sd card.
Can you help?
Thanks, regards, Ivan.
Hi Igor,
I had wrong gpio for power switch and that is the reason why voltage was
not changed. So we have fix that and now power pin is triggered and card
again is not working doe to following reasons:
Switch for SD card is implemented as sabre automotive switch. The
difference is that 1V8 voltage is connected on pmic output SW4 which is
used for LPDDR2 memory. When we switch on board we see that voltage is
stabilized on 1V8, but when we start boot voltage is become 2V1. Do you
have any idea why is this happening?
Thanks, regards, Ivan.
Hi Ivan
support is already implemented in uboot with ENGR00139221
also board should have such circuit.
One can try that sd card with Sabre AI board to verify
if it is not working due to signal integrity issues on custom board.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
I thing yocto jethro kernel 3.14.28 has implementation of ultra high
speed sd card in drivers, so I do not need to patch it. Problem is to
configure dts files to have ultra high speed sd card recognized and
operable. So what I asked was how to configure power switch from 3V3 to
1V8 and vice verse. I have looked dts file from sabre automotive also
and I see that this power switch has to be configured through regulator
configuration so I need help to configure dts files if possible.
Thanks, regards, Ivan.
Hi Ivan
all necessary codes are implemented for Sabre AI configuration
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/?h=imx_3.14.28_1.0.0_ga
Best regards
igor
Hi Igor,
I have configuration as you described. There was hardware problem with
sd card that is fixed by hardware team, but I still can not get ultra
high speed.
I have following printout in dmesg:
sdhci_ultra_speed: 3300 mV
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: SDHCI controller on 219c000.usdhc
using ADMA
mmc0: error -110 whilst initialising SD card
sdhci_ultra_speed: disabling
I have configured dts file like sabre automotive sd card configuration:
reg_sd_3p3v: regulator@4 {
compatible = "regulator-fixed";
reg = <4>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_reg_sd_high>;
regulator-name = "sdhci_ultra_speed";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = GP_USDHC4_REG;
enable-active-high;
};
&usdhc4 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc4_50mhz>;
pinctrl-1 = <&pinctrl_usdhc4_100mhz>;
pinctrl-2 = <&pinctrl_usdhc4_200mhz>;
cd-gpios = GP_USDHC4_CD;
vmmc-supply = <®_sd_3p3v>;
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
};
I still not sure what to do with code you have sent me in a link for
sabre al. To copy it to kernel-source directory, and compile bit bitbake
I have, or something else? I tried to copy mmc directory to my project
but I have errors compiling.
Thanks, regards, Ivan.
Hi Ivan
these codes are implemented on later kernels.
error: mmc0: error -110 whilst initialising SD card
may mean that card is not even detected (due to wrong
kernel boot parameter root=/dev/mmcblkNp2) .
Also one can check with logic analyzer what
commands sent/answered to/from SD and using
oscilloscope check its tuning waveform (cmd19)
About adjust the timing by CMD19 in SDR104 mode.
Best regards
igor
Hi Igor,
I have connected protocol analyzer and measured commands toward SD card
and verse. Processor executes CMD11 to switch voltage from 3V3 to 1V8
but card does not response with R1 command and voltage is not switched
from 3V3 to 1V8. Clock stays on 3V3 and CMD also. Power switch is
defined as <&gpio1 17 GPIO_ACTIVE_HIGH> and stays always on 0. It should
probably switch to 3V3 but it does not happen. It seems that it is
configuration issue, but I am not able to figure out what. I have copied
configuration from sabre automotive board sd card, but it seems this
configuration fails. Is there example of configuration for sd card for
ultra high speed?
Thanks, regards, Ivan.