If your power supply to the sdmmc is just a system 3.3v power source and there is no gpio to control it, then that one is a always-on power source and you need to add the always on property to the sdhci@700b0400.
And also need to add something like vmmc-supply = <&max77620_ldo6>;.
The supply here should be a 3v3 power source. You can track your dts and see what does max77620_ldo6 indicate.
This is regulator framework provided in linux kernel, not nvidia rule.
[ 1.425646] sdhci-tegra: probe of sdhci-tegra.2 failed with error -16
Can you try to add some debug print inside kernel/kernel-4.9/drivers/mmc/host/sdhci-tegra.c ->sdhci_tegra_probe and see which one gets the error return?
Since “16” in linux error code is “busy resources”, I can only guess something in your device tree is occupied by other driver. In such case, mostly it is the gpio.
Hi, I added vmmc-supply and I changed the cd-gpio. Now I don’t see that error from sdhci-tegra but the sd still doesn’t work.
I’m going to check the board, see if the voltage is changing to try to detect the micro-sd card and make sure that this is not a hardware issue.
All the changes I’m making for sdhci@700b0400, in which file should I make them, in tegra210-porg-p3448-common.dtsi or in tegra210-p3448-0002-p3449-0000-b00.dts? Because I’m getting confuse with that and maybe I’m making the changes in the wrong file.
There is no 100% correct answer in device tree world for where you should put the file.
The structure is like A.dtsi → B.dtsi → C.dtsi → … → and finally the tegra210-p3448-0002-p3449-0000-b00.dts.
Above means B.dtsi includes A.dtsi, and B is again included by C. And keep going.
You can write anything inside A, for example, you can enable sdhci or add cd-gpios to A. However, they have chance to be overwritten by later dts like B,C,D…
If you want a concrete answer for where to put the property, then tegra210-p3448-0002-p3449-0000-b00.dts will be the one you need. But if you are sure adding to previous dtsi can take effect, then it is ok too.
Actually, I don’t memorize what file should I do the modification. What I do every time is just check what files are included and track down the code. It is a little unrealistic for me to remember every dtsi file since I have to work with every jetson platforms.
For your current issue, you give vmmc-supply the vddio-sdmmc3-ap. Sorry that I think that might be wrong because this one only has 2.8V. Please try with vdd-3v3-sd which is a contant 3v3 regulator.
And assign the regulator to the vmmc-supply. Currently, p3448_vdd_3v3_sys is a fake 3.3v power regulator that we provided in original dts. This fake one is a always-on power. When the system is ON, then it will be always on.
However, some users’ sdcard slot can be working with nvidia,vmmc-always-on even when they use a gpio to control it. Just make sure the VDD IN to sdmmc is really 3.3v.
Thus, we can take (2) as a easy option here first.