Xavier NX can't find mmcblk0p1 on custom carrier board

Ok, so how would I change the order of the two devices in the tree, so that the Jetson’s SD card gets labeled mmcblk0?

How about you try the dtc tool first and then come back to ask your next question…

Ok, I ran dtc -I dtb -O dts for the sdcard build .dtb and the eMMC .dtb.
sdhci@3460000 is listed first (searching from the top). It is disabled in SD DTB, and enabled in eMMC DTB.
Next is sdhci@3440000. It is enabled in both DTBs. This is our custom carrier board SD slot.
Then sdhci@3400000 is enabled in SD card DTB and disabled in eMMC DTB.

So, as you say, the carrier board SDHCI is listed first in the SD card build, but last in eMMC build.
Back to my question how do I change this order?

Can you understand this?

@user58656

It is just like reading a article… See which sdhci is in the first order in your device tree file…

As you said, you saw sdhci@3440000 in dts first and then sdhci@3400000…

So the first thing gets read is mmc0 now… in your case, that is sdhci@3440000.

If you want sdhci@3400000 to be mmc0, just move the whole sdhci@3400000 before the sdhci@3440000…

I understand completely, but my problem remains.
The eMMC on my board will be labeled mmcblk0 because it is at a lower address than the carrier board’s slot.
The SD card on my co-worker’s board will be labeled mmcblk1 because the carrier board sdhci will be labeled mmcblk0.

Is there any way to force the carrier board to always be mmcblk1, so that both the SD card and the eMMC will be mmcblk0?

Alternatively, is there a way to specify to jetson-disk-image-creator.sh to boot from mmblk1?
It is a pain to have to flash the SD card, then mount it, then edit boot/extlinux/extlinux.conf, it would be nice if it generated to boot from mmcblk1.

If you cannot help stramline this process, or lock mmcblk0 to be either eMMC or SD, then it looks like I’ll have to edit the SD image after I create it.

Hi,

The eMMC on my board will be labeled mmcblk0 because it is at a lower address than the carrier board’s slot.
The SD card on my co-worker’s board will be labeled mmcblk1 because the carrier board sdhci will be labeled mmcblk0.

Could you try to use sdhci controller number to tell what is the exact thing you want to say in above comment?
I am really not quite sure what you want to tell here…

Alternatively, is there a way to specify to jetson-disk-image-creator.sh to boot from mmblk1?

As already mentioned, you just modified the rootfs and the create a new sdcard image…
I am not asking you to modify it after boot up… you were just not able to figure it out by yourself…
Do it in your BSP direcotry on your host PC…

Wayne,
I would love to modify the image before creation, could you please tell me how?
“Do it in your BSP direcotry on your host PC…”
Yes, how? There is no directory labeled BSP.
There is an extlinux.conf in rootfs/boot/extlinux/, but it gets its APPEND set by something else, it is not the same file as in the SD card image.

Please help me figure this out! What files do I need to modify to create an SD image that boots from mmcblk1p1, or a numbered SDHCI instance?

BSP means the Linux_for_Tegra directory…

Hi,

just to make sure, have you done this or not?

It’s still labeled as mmcblk1 after you modify the order in device trees?

Ok, what files to I need to modify to have it try and load from mmbclk1 instead of mmcblk0? The only argument to image creator is -d SD

There is a folder called rootfs… this is the filesystem got copied to your sdcard…

I wanted to avoid messing with the include structure of tegra194-p3668-0000*.dts and tegra194-p3668-0001*.dts, which include the carrier/config .dtsi file and then disable either sdhci@3400000 or sdhci@3460000
Interestingly, the file tegra194-p3668-0000*.dts has this:

aliases {
		/delete-property/ mmc0;
	};

but 0001*.dts file does not. I will trace that name through the files and see if I can use something like that to re-name or replace mmcblk0 to be for the SD card.

This is the file you need to work on for the device tree stuff, and nothing else.

As I keep saying the extlinux.conf in rootfs is not the same as the one in the generated image!
Please tell me how to modify/intercept what goes into the line
APPEND ${cbootargs}
That is all that is in the line there, but in the SD card image, it says
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0

How do I control what gets added to the APPEND line when the SD image is generated?

So do you recommend that I decompile my device tree, then move the sdhci instances into the order I want, then re-compile to the .dtb again?
So that when it boots, it’ll read the devices in the same order and assign the same names?

Yes, and that’s what Wayne has been telling you to do in previous comments…

Open your jetson-disk-image-creator.sh, search mmcblk0p1. Replace it to mmcblk1p1.

But I would suggest you try to make the one you want to boot to be mmcblk0p1 first from device tree…

1 Like

@wayneWWW, @DaveYYY
Ok, here is what I understand so far:
Method 1 is:

  • De-compile my .dtb to a .dts file
  • Edit the .dts file, moving the definitions of the sdhci controllers, so that the SD card on Jetson module is the first one.
  • Re-compile the .dts to .dtb and replace the original .dtb file.
    This would make the SD card on Jetson be mmcblk0 instead of mmcblk1
    De-compiling, editing, and re-compiling seems so odd and clunky, but if that is the way to do it, then I understand now.
    Method 2:
    Edit the jetson-disk-image-creator.sh to put root=/dev/mmcblk1p1 into the extlinux.conf as it generates the SD image.

Ok, thank you guys for your patience. If you would have described with a bit more detail, I would have picked it up faster. But thank you for sticking with me until I finally understood.

These two options will allow me to generate an SD image, thank you!

I think the contents of kernel command line only get populated during flashing, but not before flashing.
So please just try this.

You will get stuff like this

	jetson-xavier-nx-devkit)
		case "${rootfs_dev}" in
		"SD" | "sd")
			rootfs_dev="mmcblk0p1"
			;;
		"USB" | "usb")
			rootfs_dev="sda1"
			;;
		*)
			usage "Incorrect root filesystem device - Supported devices - SD, USB"
			;;
		esac
		;;

Change that mmcblk0p1 with mmcblk1p1.

1 Like