Kernel Modification for adding extra SD card at SDMMC3

Hey NVIDIA Admin,

I have custom board that routes the SDMMC pin from jetson nano to an sd card.
After reading some NVIDIA documentation, I saw the SDMMC is connected to SDMMC3 and in the kernel sdhci@700400.
I saw from the dts converted from my kernel dtb shows that the sdhci shows status=“disabled”, when I change it to status=“okay” my image cannot booted up and I need to reflassh the image.
Is there steps that I miss or is there some further documentation I need to follow?
What is the basic steps to use extra sd card(for storage) for the jetson nano?

Best Regards,
Andreas Widy


Please refer to this post.

And cannot boot up probably means kernel crashed during boot up. Sharing the dmesg may provide more info.

Hey @WayneWWW ,

I already follow the guidelines to change the dtsi, compile it and flash it to my jetson nano.
Note my case maybe a little bit different since I actually use Jetson Nano development kit module for my custom board. The SD card that contains my image is in the sdmmc1 the original sd card slot while my extra sd card is connected to sdmmc3.
After I flash the image with modified device tree with sdmmc3 enabled, the jetson nano will not booted up but I can still do dmesg.
It says error because cannot find mmcblk0p1 which is what my image placed normally and what I assume the bootloader referring to.
After I look at the dmesg carefully, I can see that the enabled sdmmc3 takes in mmc0 while the original sdmmc1 takes in mmc1, so the image flaashed is in mmcblk1p1(this is im not sure).
How to solve this problem?
How do I make the sdmmc1 keep at mmc0 while the sdmmc3 can recognize the sd card as mmc1?
I attached my compiled dts here

Best Regards,
Andreas Widytegra210-p3448-0000-p3449-0000-b00.dts (323.8 KB)


since I actually use Jetson Nano development kit module for my custom board.
How to solve this problem?

This is not a legal case.

I replied similar case on NX for another user too.

Please stop using devkit module on custom carrier board.

Hey @WayneWWW ,

Ok got it , did not know about it.
I have the production module as well, let me try the modified dtb in the production module and get back to you.
Previously I thought I will do the development on the devkit first since using sd card has more storage (more than 16GB).

Best Regards,
Andreas Widy

Hi @WayneWWW,

I am trying to add the SD card at sdmmc3 in jetson nano production module now.
I followed the post you shown before, applying the patch 975882.diff and take the dts from the forum.
Using 2 of the mentioned solution I managed to have the sd card working with ultra high-speed and everything is working fine.

However, in my application I need to interface with IMX477 and I use installation file from Releases · ArduCAM/MIPI_Camera · GitHub
It turns out when I unpackaged the debian files, the debian installation of the imx477 driver have its own dtb and it is overwriting the dtb I previously have with working sd card dtb.

I tried to unpack the debian files, change the dtb into dts and modify the dts file so the sdhci@700b400 part is the same as the previous dts.
After I do the modification, the sd card is shown but it always kept at 50MHz clock and in sd high-speed mode.
In addition, everytime I unplug and plug the sd card, the jetson nano rebooted.tegra210-p3448-0000-p3449-0000-b00-imx477.dts (321.3 KB)
Attached here is the dts file I modify according my understanding from the forum.
Basically the dts modification is adding these lines at sdhci@700b0400:
uhs-mask = <0x0>;
Is there any modification needed again to make the UHS working again with 204MHz clock?
I saw in the forum changes in dtsi is needed to remove the clk limit, how does it reflect to the changes in the dtb files?

You need to check the second patch from this link.

Have to remove max-clk-limit

Hi @WayneWWW ,

I have checked that one, but that one is in common.dtsi I am not sure how it can relate to dts files.
In the dts I saw similar one which is :
max-clk-limit = <0x61a80>;
should I just remove this?
But this one also exists in my old dts files and it works fine.

What is your result of below node now?

$cat /sys/kernel/debug/mmc1/clock

clock: 50000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don’t care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)

oh sorry that one is the ios, the clock will be :

Yes, then please remove that line first. Actually, you can just compare what sdhci@700b0400 was like between your original and that one from IMX477 dts.

hi Wayne,

removing the clock limit makes the clock 9.6MHz which is worse.
sudo cat /sys/kernel/debug/mmc1/clock
sudo cat /sys/kernel/debug/mmc1/ios
clock: 9600000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don’t care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)

I tried to just compare the old and new dts, I tried to copy the whole sdhci@700b0400 blocks but it will create error since it has different linux phandle, vqmmc-supply,vmmc-supply, clocks, resets and iommus.
Other than that is all the same.

These are the differences :
IMX one :
iommus = <0x30 0x1b>;
clocks = <0x26 0x45 0x26 0xf3 0x26 0x136 0x26 0xc1>;
resets = <0x26 0x45>;
vqmmc-supply = <0x3b>;
vmmc-supply = <0x4c>;
linux,phandle = <0xbd>;
phandle = <0xbd>;
Old working one :
iommus = <0x2b 0x1b>;
clocks = <0x21 0x45 0x21 0xf3 0x21 0x136 0x21 0xc1>;
resets = <0x21 0x45>;
linux,phandle = <0xbd>;
phandle = <0xbd>;

Could you only flash your dtb again and see if sdcard speed can back to normal?

I asked this because I wonder is their patch only update the dtb but no kernel driver?

Hi Wayne,

If the debian file is installed and I reflash my dtb, it behaves the same.
Even I uninstall it and then reflash the dtb it still the same.
I dont know if it helps but inside the debian file there is extlinux.conf with this content :
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
MENU LABEL primary kernel
LINUX /boot/arducam/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

FDT /boot/arducam/tegra210-p3448-0000-p3449-0000-b00-imx477.dtb

Looks like they install their own kernel.

Maybe some patches are gone due to it.

BTW, their dtb is based on sdcard module. Do not use it on production module…

I already try it and I do not know why it is working on production module.
I can see the IMX477 and control it, I can see the additional sd card, its just slow, and the production module with emmc bootup just fine.
I saw inside the debian file there is another dtb file tegra210-p3448-0002-p3449-0000-b00.dtb which is for the production module, I will try this.
So if it does not work and it change the kernel there is no good solution so far?
Other than the kernel, inside the dtb are you sure the necessary modification are inside sdhci@700b0400 block?
There are no modification from common.dtsi that is reflected in dtb but outside the mentioned block?

My suggestion is if nothing can work, then fallback to the last version that your sdcard was working fine.