mmc0 warning on linux bootup

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

cajjed
Posts: 36
Joined: Thu Aug 25, 2016 3:12 am

mmc0 warning on linux bootup

Sat Jan 05, 2019 2:56 am

I get the following warning on linux bootup of my custom sama5d3 board:

Code: Select all

mmc0: unrecognised SCR structure version 4
mmc0: error -22 whilst initialising SD card

after spewing this about 30 times I get the following and the linux boot completes

Code: Select all

mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new SDHC card at address 0007
mmcblk0: mmc0:0007 SD4GB 3.71 GiB 

I have tried several different SD cards and get the same result, with the only variation being the version number.

I found the following online https://groups.google.com/forum/#!topic ... 4zfNvyMmVI:
SCR is a register defined by MMC/SD standard, and the data should be read by the data bus, instead of the cmd bus as most predefined registers do.
The omap_hsmmc_request function of the TI HSMMC driver tries to read in the SCR data by DMA, and this always returns garbage.
Sometimes the SCR check gets passed, because the garbage data happens to be a valid SCR data

The linux kernel just checks to see if the SCR version is not 0, if so it produces the error.

My dts file for mmc0 is as follows:

Code: Select all

			mmc0: mmc@f0000000 {
				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3>;
				status = "okay";
				slot@0 {
					reg = <0>;
					bus-width = <8>;
				};
			};

Any insight is appreciated...
blue_z
Location: USA
Posts: 1828
Joined: Thu Apr 19, 2007 10:15 pm

Re: mmc0 warning on linux bootup

Tue Jan 08, 2019 2:26 am

cajjed wrote: I get the following warning on linux bootup of my custom sama5d3 board:
What version of the kernel are you using?

cajjed wrote: I found the following online https://groups.google.com/forum/#!topic ... 4zfNvyMmVI:
SCR is a register defined by MMC/SD standard, and the data should be read by the data bus, instead of the cmd bus as most predefined registers do.
You're citing a questionable source.
First, there is no "MMC/SD standard".
There is a MMC standard, and there is a SD specification.
There is no combined/joint standard.

There is no "cmd bus".
There is a command/response line.

The SD specification mentions six registers defined within the SD card interface: OCR, CID, CSD, RCA, DSR and SCR.
According to the command list, only the CID and CSC registers are retrieved over the CMD line.
The SD specification mentions that the SD Status register is sent over the data line(s).


So at least two out of three reports of these error messages involve custom boards.
Linux is a poor tool for checking out a custom board.
What have you done to test the functionality of your custom board?

Have you tried executing the SoftPack example for SDcard?

cajjed wrote: My dts file for mmc0 is as follows:

Code: Select all

				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3>;
                                        ...
					bus-width = <8>;
You have specified only four data pins in the pinctrl attribute, yet specify that the bus-width is eight.
That's inconsistent.

Regards
cajjed
Posts: 36
Joined: Thu Aug 25, 2016 3:12 am

Re: mmc0 warning on linux bootup

Wed Jan 09, 2019 1:35 am

blue_z as always thanks for the reply and insight.

I am currently using kernel 4.18.8

I am not the developer of the custom board but I have seen the SD card boot up fine with other uboot/kernel combinations. Playing more the issue is intermittent, in that sometimes there is no warning during the boot up sequence.

I made the bus-width change but didn't see any difference.
blue_z
Location: USA
Posts: 1828
Joined: Thu Apr 19, 2007 10:15 pm

Re: mmc0 warning on linux bootup

Wed Jan 09, 2019 4:16 am

cajjed wrote: I am currently using kernel 4.18.8
You might want to review the history of the salient files in github.com/linux4sam/linux-at91/blob/master/drivers/mmc/ to see if there are any Linux4SAM patches that you may be missing.
Or perform a diff (e.g. `diff -pruN at91_kernel/drivers/mmc my_kernel/drivers/mmc`) to see how different the drivers are.

cajjed wrote: I am not the developer of the custom board...
That's not information that was asked for, nor does it really answer any question I did ask.
I've received boards that out-of-the-box were not 100% functional. In fact one such example was from Atmel.

cajjed wrote: ... I have seen the SD card boot up fine with other uboot/kernel combinations. Playing more the issue is intermittent, ...
That's salient information that should have been in your initial post.
Intermittent behavior could indicate a HW issue. You haven't provided any information that rules out a HW issue.
(BTW "playing more" is nonsensical. Apparently you mean something like "furthermore" or "on the other hand".)


What is the significance of these error messages?
(Note that these are "error" messages rather than "warning"s, since that is the actual word used in those messages.)
Is the SDcard accessible/functional in spite of these error messages?


Try changing the DT (both pinctrl and bus-width) for a data path of just one line (i.e. DAT0), and see if that makes a difference.

Again, try the SoftPack (version 2.x) to dump the SCR register for a SDcard or two.
Then hack the Linux sd.c to dump its read of the SCR register for the same SDcards.

Regards
cajjed
Posts: 36
Joined: Thu Aug 25, 2016 3:12 am

Re: mmc0 warning on linux bootup

Wed Jan 09, 2019 7:49 pm

Thanks blue_z your responses always make me smile :D. To that end, do you ever do training or online tutorials? I always find your responses full of very helpful information and I really do appreciate you taking the time.

The board I use for development has been functional with other uboot/kernels so thus my response. I think the board is ok; however, saying 100 % with a development board is never a good idea.

Looks like there was a lot of differences to the mmc, so I tried updating to kernel 4.20 and initially the error has gone away. I will have to track for a while and make sure.

I will have to play with your softpack and dts tweaks and see what I discover.

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 1 guest