Hi,
I'm working on an iMX6 solo X (ref.: MCIMX6X1CVO08AB, version without GPU) and I need a sdcard over SPI, but it doesn't work (All SDIO ports are occupied).
In my DTS file :
DTS file |
---|
&ecspi4{ fsl,spi-num-chipselects = <1>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi4>; status = "okay"; cs-gpios = <&gpio6 10 0>;
mmc-slot@0 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc8323rdb-mmc-slot", "mmc-spi-slot"; reg = <0>; spi-max-frequency = <1000000>; }; }; pinctrl_hog: hoggrp { fsl,pins = < MX6SX_PAD_KEY_COL0__GPIO2_IO_10 0x1b0b0 /*RST FEC1/ENET1*/ MX6SX_PAD_KEY_COL2__GPIO2_IO_12 0x1b0b0 /*RST FEC2/ENET2*/ MX6SX_PAD_SD2_DATA2__GPIO6_IO_10 0x80000000 /*SDcard SS for ecspi4*/ >; }; pinctrl_spi4: spi4grp { fsl,pins = < MX6SX_PAD_SD2_CLK__ECSPI4_SCLK 0x100b1 MX6SX_PAD_SD2_CMD__ECSPI4_MOSI 0x100b1 MX6SX_PAD_SD2_DATA3__ECSPI4_MISO 0x100b1 >; }; |
I also activated SPI supports and MMC/SD/SDIO card support in Kernel. Am I missing something ?
The Device Tree is a data structure for describing hardware.
See the following pages:
http://www.freescale.com/infocenter/index.jsp?topic=%2Fqcs_hwdev_ug%2F4101309.html
http://xillybus.com/tutorials/device-tree-zynq-1
http://www.devicetree.org/Main_Page
https://en.wikipedia.org/wiki/Device_tree
The i.MC6 eSPI and qSPI controllers are not compatible to the MPC8323 SPI. You cannot use the following line:
“compatible = "fsl,mpc8323rdb-mmc-slot", "mmc-spi-slot";” in .dts file.
Look at attached file. This file is documentation from the MPC8313RDB LTIB Linux BSP:
Use this BSP for developing driver for using the i.MC6 eSPI or qSPI for the SD/MMC card.
Have a great day,
Pavel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Pavel,
Thanks for your answer. I corrected my dts file and there was a HW problem too.
Now, i have a new problem :
When booting my kernel prints :
"mmc4: mmc_rescan_try_freq: trying to init card at 400000 Hz" every few seconds (it's always 400000 Hz).
Just before the first time this message appear, there is : "mmc_spi spi3.0: SD/MMC host mmc4, no WP, no poweroff, cd polling"
I read on the web that could be a spi mode problem. How can I change it ?
my new dts file :
---------------------------------------------------------------------------------------------------
&ecspi4{
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi4>;
cs-gpios = <&gpio6 8 0>;
status = "okay";
sdcard: mmc-slot@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "mmc-spi-slot";
reg = <0>;
spi-max-frequency = <5000000>;
voltage-ranges = <3200 3400>;
disable-wp;
disable-cd;
};
};
pinctrl_spi4: spi4grp {
fsl,pins = <
MX6SX_PAD_SD2_CLK__ECSPI4_SCLK 0x17071
MX6SX_PAD_SD2_CMD__ECSPI4_MOSI 0x17071
MX6SX_PAD_SD2_DATA3__ECSPI4_MISO 0x17071
MX6SX_PAD_SD2_DATA0__GPIO6_IO_8 0x80000000
>;
};
---------------------------------------------------------------------------------------------------
Thanks a lot for your help,
did you solve it? Was required to develop a new driver?
Did you solve this?
Up