cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
avcon_lee
Voyager
Voyager
473 Views
Registered: ‎07-17-2014

about the pinctrl setting of sd-card

Jump to solution

hi, everyone

After the program starts from SD card, from the printing information of serial port, there are some problems in SD card.

[    4.456368] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: pin MIO18 already requested by ff020000.i2c; cannot claim for ff160000.mmc
[    4.468535] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: pin-18 (ff160000.mmc) status -22
[    4.477058] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: could not request pin 18 (MIO18) from group sdio0_0_grp  on device zynqmp_pinctrl
[    4.489902] sdhci-arasan ff160000.mmc: Error applying setting, reverse things back
[    4.497477] sdhci-arasan: probe of ff160000.mmc failed with error -22

In fact, SD card does not use MIO18, it is actually used by I2C. As shown in the figure below:

1.PNG

2.PNG

The device tree is shown below:

pinctrl_sdhci0_default: sdhci0-default {
		mux {
			groups = "sdio0_0_grp";
			function = "sdio0";
		};

		conf {
			groups = "sdio0_0_grp";
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
			bias-disable;
		};

		mux-cd {
			groups = "sdio0_cd_0_grp";
			function = "sdio0_cd";
		};

		conf-cd {
			groups = "sdio0_cd_0_grp";
			bias-high-impedance;
			bias-pull-up;
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
		};
	};

&sdhci0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sdhci0_default>;
	bus-width = <4>;
	disable-wp;
};

What I want to ask is how to modify the device tree to get rid of the errors in the printed information?Will the error affect the user program's access to the SD card?

0 Kudos
1 Solution

Accepted Solutions
avcon_lee
Voyager
Voyager
319 Views
Registered: ‎07-17-2014

@kawazome 

thank you for your help,Now SD mount is successful, The final changes are as follows:

1. The "sdio0_0_grp" is still in use, From xlnx,zynq-pinctrl.txt, the valid range is sdio0_0_grp -sdio0_2 grp. 

2. In order to avoid the conflict of MIO18, I deleted some statements about pin_request() in pinmux.c.  I think there are other ways, such as pin free

3. "no-1-8-v" is needed

View solution in original post

0 Kudos
5 Replies
kawazome
Adventurer
Adventurer
441 Views
Registered: ‎04-02-2014

"sdio0_0_grp" is a group for SD 8bit mode.
Please use "sdio0_3_grp" to use SD 4bit mode.

 

pinctrl_sdhci0_default: sdhci0-default {
		mux {
			groups = "sdio0_3_grp"; // change from "sdio0_0_grp"
			function = "sdio0";
		};

		conf {
			groups = "sdio0_3_grp"; // change from "sdio0_0_grp"
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
			bias-disable;
		};

		mux-cd {
			groups = "sdio0_cd_0_grp";
			function = "sdio0_cd";
		};

		conf-cd {
			groups = "sdio0_cd_0_grp";
			bias-high-impedance;
			bias-pull-up;
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
		};
	};

&sdhci0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sdhci0_default>;
	bus-width = <4>;
	disable-wp;
};
0 Kudos
avcon_lee
Voyager
Voyager
424 Views
Registered: ‎07-17-2014

@kawazome 

According to what you said, I tried. The printed information is as follows. It seems that there is a error whilst initialising SD card

[    4.488690] mmc0: SDHCI controller on ff160000.mmc [ff160000.mmc] using ADMA 64-bit
[    4.498506] rtc_zynqmp ffa60000.rtc: setting system clock to 1970-01-01T00:00:07 UTC (7)
[    4.506599] of_cfs_init
[    4.509051] of_cfs_init: OK
[    4.511944] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    4.600871] mmc0: error -110 whilst initialising SD card
[    4.640785] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

Do you have any suggestions?

in addition about "sdio0_0_grp"  is used for 8bit mode, Is there any document or C file to explain?

 

0 Kudos
kawazome
Adventurer
Adventurer
407 Views
Registered: ‎04-02-2014

Do you have any suggestions?

 

I don't know the configuration of the hardware you're trying to run, so I can't tell you the details, but for Ultra96, for example, I'm using a device tree like this

 

 

/* SD0 only supports 3.3V, no level shifter */
&sdhci0 {
	status = "okay";
	no-1-8-v;
	disable-wp;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sdhci0_default>;
	xlnx,mio-bank = <0>;
};

 

 

Maybe you need the "no-1-8-v" property. See also the thread below.

https://forums.xilinx.com/t5/Embedded-Linux/mmc0-error-110-whilst-initialising-SD-card/td-p/929713 

in addition about "sdio0_0_grp"  is used for 8bit mode, Is there any document or C file to explain?

If you can use it in Japanese Language, please refer to the following URL for more detailed articles.

https://qiita.com/ikwzm/items/7b4ea8e031d3564b7535 

0 Kudos
avcon_lee
Voyager
Voyager
320 Views
Registered: ‎07-17-2014

@kawazome 

thank you for your help,Now SD mount is successful, The final changes are as follows:

1. The "sdio0_0_grp" is still in use, From xlnx,zynq-pinctrl.txt, the valid range is sdio0_0_grp -sdio0_2 grp. 

2. In order to avoid the conflict of MIO18, I deleted some statements about pin_request() in pinmux.c.  I think there are other ways, such as pin free

3. "no-1-8-v" is needed

View solution in original post

0 Kudos
kawazome
Adventurer
Adventurer
287 Views
Registered: ‎04-02-2014

1. The "sdio0_0_grp" is still in use, From xlnx,zynq-pinctrl.txt, the valid range is sdio0_0_grp -sdio0_2 grp. 

Thank you for the information. However, in my information, it exists from sdio0_0_grp to sdio0_32_grp.
From sdio0_0_grp to sdio0_2_grp indicate the case of SDIO 8bit mode.
SDIO 4bit mode is from sdio0_3_grp to sdio0_8_grp.
SDIO 1bit mode is from sdio0_9_grp to sdio0_32_grp.

I doubt that the information in xlnx, zynqmp-pinctrl.txt is correct.
We look forward to hearing from official Xilinx support.

0 Kudos