U-Boot sdhc as microSD Slot cannot work properly on Jetson Nano based custom board

Hi,

We are working on custom carrier board for Jetson Nano module.

The sdhci@700b0400 port cannot work proerly at U-Boot environment.

This port is assigned as microSD Slot.

And this sdhci port have already ported at Linux Kernel and works fine.

Specifically, Card Detect/ VDD Pin assigned as GPIO works normally, but CLK, CMD Pin does not oscillate it at all.

I debugged U-Boot mmc driver [drivers/mmc/tegra_mmc.c] and confirm that it accessed the address range of 0x700b0400.

And In dts, sdhc@700b0400 status is defined as “okay”.

sdhci@0,700b0400 { /* SDMMC3 for SD card */
    status = "okay";
    cd-gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
    power-gpios = <&gpio TEGRA_GPIO(E, 6) GPIO_ACTIVE_LOW>;
    bus-width = <4>;
};

Still, from the result that I probed Pin by the Logic Analyzer, CLK,CMD does not seem to work and always “LOW”.

What kind of thing is considered as the cause that CLK,CMD does not oscillate in U-Boot ?

And has anyone enabled sdhc@700b0400 as SDCard in U-Boot?

Could you give me some advice about this problem? Thanks.

Hi,

Could you interrupt the uboot boot process and see if mmc driver is able to detect extra MC device?

Hi WayneWWW,

Thank you for your response.
I attached uboot console log and logic analyzer image.

In the mmc driver, tegra_mmc_getcd() and mmc_core_init() called in order.
The mmc driver seems detect microSD Card.

I inserted printf() in all writeb()/writew()/writel(),
and confirmed that mmc driver is accessing to register: 0x700b04xx.

Although mmc_change_clock() and mmc_send_cmd() are executed there,
CMD and CLK do not actually oscillate.

Is there any other modification needed to use sdhc@700b0400 as SDCard Port?

20200507_uboot_log.log (3.7 KB)

Hi,

  1. Please check the pinmux of sdmmc3 to make sure it is same as SDMMC1. You could check it in uboot cmd prompt.

  2. Dump SDMMC1 and SDMMC3 CAR registers (CLK_SOURCE, RST_DEV_L, CLK_ENB_L, etc.) and compare.

  3. Make sure the GPIOs are being used for sdmmc3 (check the pinmux too)

  4. Make sure the power-gpio is really toggling 3.3v to the SD-card slot. It could be toggled from U-Boot cmd prompt.

Also, what is your purpose to enable sdmmc3 in uboot? Do you want to put kernel/dtb/rootfs on it and boot?

Hi WayneWWW,

Thank you for your help.

Finally, I figured out the problem.

If we use sdhci@0,700b0400 instead of sdhci@0,700b0000,
we should also change PMIC LDO register setting in pin_mux_mmc().

I added following code in [board/nvidia/p3450-porg/p3450-porg.c] and sdmmc3 works fine.

void pin_mux_mmc(void)
{
...
	/* Enable LDO6 for SDMMC3 */
	val = 0xF2;
	ret = dm_i2c_write(dev, MAX77620_CNFG1_L6_REG, &val, 1);
	if (ret)
		printf("i2c_write 0 0x3c 0x2f failed: %d\n", ret);

=>

U-Boot # mmc dev 1
switch to partitions #0, OK
mmc1 is current device

U-Boot # mmc info
Device: Tegra SD/MMC
Manufacturer ID: 27
OEM: 5048
Name: SD04G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

I enabled/disabled SDMMC3 in the Kernel and checked MAX77620 register differences.

Is there any documentation on these MAX77620 register and SDMMCX correspondences?

Is the Jetson nano module’s schematic available?

Do you want to put kernel/dtb/rootfs on it and boot?

Yes. I already booted kernel/dtb/rootfs from eMMC,
but I want to boot these from removable device for the development purpose.

1 Like

Hi,

We don’t provide max77620 datasheet. Maybe you could contact vendor for this detail.