Hi all,
On a custom board with an imx6QP, i want to use usdhc2 port in SDR104 mode, for SD card access. I've a SD card that supports this rate (checked under windows). The linux is Nxp's 4.1.15.
I've read several posts like supporting SDR104 in imx6 board by yocto.
But at the end, it doesn't correctly works.
From hardware side, my board is wired as in MX6 Sabre AI board (27142), but for ushc2 instead of usdhc3. ADG849 switch for 1,8/3,3V is present, and drived by SD2_VSELECT.
Here's the dts:
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc2>;
pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
bus-width = <4>;
cd-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
// wp-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; // Managed by appli
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
};
pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
MX6QDL_PAD_KEY_ROW2__SD2_VSELECT 0x17059
>;
};
pinctrl_usdhc2_100mhz: usdhc2grp100mhz {
fsl,pins = <
MX6QDL_PAD_SD2_CMD__SD2_CMD 0x170B9
MX6QDL_PAD_SD2_CLK__SD2_CLK 0x100B9
MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x170B9
MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x170B9
MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x170B9
MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x170B9
MX6QDL_PAD_KEY_ROW2__SD2_VSELECT 0x170B9
>;
};
pinctrl_usdhc2_200mhz: usdhc2grp200mhz {
fsl,pins = <
MX6QDL_PAD_SD2_CMD__SD2_CMD 0x170F9
MX6QDL_PAD_SD2_CLK__SD2_CLK 0x100F9
MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x170F9
MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x170F9
MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x170F9
MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x170F9
MX6QDL_PAD_KEY_ROW2__SD2_VSELECT 0x170F9
>;
};
And now, the behaviour:
1- When sd card is inserted, it seems correct:
2- Then hdparm gives an expected reading rate value (>70 Mo/s):
3- But when accessed in writing:
4- And after, the reading rate has dropped:
I don't understand what the problem is, but it's the same problem than at the end of supporting SDR104 in imx6 board by yocto.
Actually, i wonder if SDR104 mode is really working with sd port other than uhcsd3 ou 4 ? Can you confirm SDR104 mode is fully operationnal with 4 bits SD cards and not only with MMC ?
BR,
Christophe
Hi Christophe
yes SDR104 is supported on all ports, issue may be
caused by noise/signal integrity and layout of sd signals, so
one can tweak drive strength with IOMUXC_SW_PAD_CTL_PAD_SD2 settings.
From SD side SD3.0 specification describes in sect.6.7.1.4 Driver Strength Selection:
CMD6 Function Group 3 is used to select driver strength.
Layout guide line for uSDHC with SDR104 mode in i.MX6
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Well, these links are interesting, so i checked a lot of relevant points without success.
And, i try to tune drive strength. It appears that current settings are good, since when i move towards higer impedances, SD card is no more detected.
With current settings, i have:
So clock is at 198 MHz (i'm surprised it be not 208 MHz as specified in SDR104 mode), voltage is at 1,8 V and SD card is detected.
But when writing:
This error occurs only one time, but it makes regress the SD speed, since after:
SD card is no more in SDR104 mode. The only way to resume it seems to eject and insert it again.
Do you have some clues ?
BR,
Christophe
Hi Christophe
seems due to layout processor is not able to tune sd signals.
One can try other card or recheck board layout, recommended to perform
simulation.
Best regards
igor
Ok Igor,
So, you suspect a hardware issue.
I'm a bit sceptic, but i will investigate in this way.
Thanks.
Rgds,
Christophe