Error initializing sd card on TX2 NX custom carrier (mmc1: error -22)

Hello.

We have a custom carrier for our TX2 NX and we’re currently trying to enable an SD card.

I’ve been looking through related posts but so far I’m getting an error code that I haven’t found any specification on.
Specifically, the error is (Full log bellow in dmesg,txt):

[    2.049333] mmc1: error -22 whilst initialising SD card
[    2.106941] sdhci-tegra 3440000.sdhci: no support for card's volts

Decompiled dts:
tegra186-p3636-0001-p3509-0000-a01.dts (233.2 KB)

Dmesg logs from dmesg | grep -i sd:
dmesg.txt (2.3 KB)

I did not link any of the posts I have got through because there’s a lot them, so feel free to refer me to any of them again for something I may be overlooking or not understanding at all.
I’m not sure if the changed I’m making to the dts’s are being relevant at all because I’m always getting the mmc1: error -22 and I’m not sure why nor what it means.
Also, SD card works fine so it being broken is definitely not the problem.

Can someone try to guide me through what I need to do for our TX2 NX to recognize the SD card?

Edit: I’ve also found something that might be incorrect about our image.
cat /proc/device-tree/sdhci@3400000/status yields disbaled
Which I’m assuming is incorrect.

Thank you,
Francisco

sdhci@3400000 has nothing related to your issue. Each sdhci has a mapping to the hardware.

sdhci@3400000 is sdmmc1 of the soc, but TX2-NX has no pin out for this, so this controller has nothing to do with your issue because you are using sdmmc3.

For TX2-NX, please disable and remove bcmdhd from the device tree because it is using the sdmmc3 controller which you are using now.

BTW, if you want to share dmesg, don’t need to grep anything. Just the full log always provides the completed information.

Hello @WayneWWW.

Apologies, you are correct (obviously), i wasn’t paying proper attention there.

By this, did you mean setting status = "disabled"; like this?
tegra186-p3636-0001-a00-comms.dtsi (1.4 KB)

That makes sense. I will keep that in mind moving forward.
Here’s the full dmesg:
dmesg (1).txt (62.7 KB)

Also, to compile the dts files, I’m just running make ARCH=arm64 O=../kernel_out -j8 dtbs but I’m not sure if it’s taking any effect because i’m always seeing the same error messages in dmesg. Is this correct or do we need to do anything else before before flashing, in order to only change the device trees?

You can check /proc/device-tree and check whether your change is there or not.

This issue is not just “I change one line and it shall work”. I need your schematic to tell the whole picture.

The first thing here is disable that wifi card (bcmdhd) because that is definitely not related to your design.

Hello @WayneWWW.

I was having a problem compiling the dts (which I now figured out what I was doing wrong).

Like you said, I disabled bcmdhd, and now we’re able to detect and write to the SD card, though we’re not able to hotplug it. What could try to do to allow hotpluging?

Here’s how dts file:
tegra186-p3636-0001-p3509-0000-a01.dts (233.6 KB)

If we remove the SD card and add it again, dmesg shows these error messages:
dmesg (2).txt (63.8 KB)

Thank you.

You better sharing the schematic and what you’ve changed to the dts so far.

The purpose of DTS is just to match your hardware. Thus, without hardware design info, I won’t be able to help.

Hi @WayneWWW, I’m a colleague of @FranciscoZacarias and I was responsible for the Hardware Design of the carrier board.

As this is a company board, I would prefer not to share the whole schematic, however, I have annexed 2 photos of the relevant parts


The connections to the SD Card are rather simple, and so far seem to work well. The current problem is the hot plug line which is connected to GPIO 08.

Thank you for the help!

Also, here’s the current full dts file:
tegra186-p3636-0001-p3509-0000-a01.dts (233.6 KB)

Hi,

Could try to configure “nvidia,vqmmc-always-on” and vqmmc-supply? I mean:

case 1. keep vqmmc-supply and also add “nvidia,vqmmc-always-on”

case 2. remove them both.

And see if any of them would work.

Hello.

Following what you said:


case 1:
dts:
tegra186-p3636-0001-p3509-0000-a01.dts (233.6 KB)
dmesg:
dmesg_with_vqmmc (1).txt (63.1 KB)

I can read and write to the sd card.
Hotplug not working.


case 2:
dts:
tegra186-p3636-0001-p3509-0000-a01.dts (233.6 KB)
dmesg:
dmesg_without_vqmmc (1).txt (62.2 KB)

We don’t see the SD card at all in this case.


What else could we try?

Hi,

Before checking your log, I want to know what does that mean “hotplug” not work. Are you able to see the error message coming out when you hotplug the sdcard?

If you can, then it means the hotplug can work, the issue may not something else. Hotplug is not some magic. It is just GPIO to trigger.

We don’t see anything in dmesg when we insert and remove the sd card, if that’s what you’re asking. The only way it’s working right now is if we boot with the sd card already inserted.

Then who triggered this log?

[ 33.873304] vdd-sys-bl: disabling
[ 66.733041] mmcblk1: error -110 sending status command, retrying
[ 66.739178] mmcblk1: error -110 sending status command, retrying
[ 66.745364] mmcblk1: error -110 sending status command, aborting

So we boot up with the sd inserted.
We removed the sd (nothing happens, i.e. looks like as if it’s still inserted)
We re insert sd (nothing happens)
When we tried to read from the card again, that log happened (It did open though)

Are you sure “cd-inverted;” should be there in your device t ree?

No, I’m not sure. I’m not even sure what it does honestly. It’s there from other solutions we tried to find online. Could you clarify, if you don’t mind?

Your hardware guy can answer it…

cd-inverted means “when present, polarity on the CD line is inverted.”

Oh sorry. I find the problem. “non-removable;” → this should not be here.

I’m confirming this with him, but I think it’s correct. I’ll get back to you on that.

Sure I will try it now, I’ll let you know.