Hey folks,
Having a bit of trouble booting from the second SD card on the Jetson Tx2i during Uboot and wondering what exactly needs to be updated in the code for it to work correctly. I can successfully boot from the first SD card, but not from the second. Even weirder though, if I boot into the kernel, then reboot, then try to boot from the second SD card, it works. So the kernel is doing something that persisting through a reboot that allows me to boot from the second SD card… I can post the kernel patches I made if required, but ultimately this should be solvable without seeing that I think.
Here’s what I’ve done…
- I have the latest uboot branch from git://nv-tegra.nvidia.com/3rdparty/u-boot.git
- I’ve added sdhci@3440000 to tegra186-p2771-0000.dtsi
+ sdhci2 = "/sdhci@3440000"; /* under aliases */
+ sdhci@3440000 {
+ status = "okay";
+ bus-width = <4>;
+ };
- I’ve add sdhci@3440000 to tegra186.dtsi which was basically a copy of the definition of sdhci@3400000
+ sdhci@3440000 {
+ compatible = "nvidia,tegra186-sdhci";
+ reg = <0x0 0x03440000 0x0 0x200>;
+ resets = <&bpmp TEGRA186_RESET_SDMMC3>;
+ reset-names = "sdhci";
+ clocks = <&bpmp TEGRA186_CLK_SDMMC3>;
+ interrupts = <GIC_SPI 64 0x04>;
+ status = "disabled";
+ };
I’ve finally removed sdchi@3400000 from tegra186-p2771-0000-500.dts so that I can power the card manually.
- sdhci@3400000 {
- cd-gpios = <&gpio_main TEGRA_MAIN_GPIO(P, 5) GPIO_ACTIVE_LOW>;
- power-gpios = <&gpio_main TEGRA_MAIN_GPIO(P, 6) GPIO_ACTIVE_HIGH>;
- };
-
This results in a ‘Card did not respond to voltage select!’ error during uboot as the SPI has a timeout error.
There’s an obvious thing that worries me, which is that there’s no autocal routine defined for the Tegra186 despite being detailed in the TRM (the routine is defined for the Tegra210 and Tegra30 in board2.c though). Does this need to be implemented for the card to respond?
Secondly, there appears to be a dedicated SD power pin for the ‘original’ SD pins (SDCARD_PWR_EN on H16), but no dedicated pin for SDIO. I just used GPIO0_CAM_PWR on G8 for that. Perhaps this is wrong, but the kernel handles it ok.
Additional info. I’ve also added this to uboot environment to allow booting from cards.
set boot_targets 'mmc1 mmc2 mmc0 usb0 pxe dhcp'
set bootcmd_mmc0 'setenv devnum 0; gpio clear p6; gpio clear r0; sleep 1; setenv rootfs /dev/mmcblk0p1; run cbootargs_set; run mmc_boot'
set bootcmd_mmc1 'setenv devnum 1; gpio clear r0; gpio set p6; sleep 1; setenv rootfs /dev/mmcblk2p1; run cbootargs_set; run mmc_boot'
set bootcmd_mmc2 'setenv devnum 2; gpio clear p6; gpio set r0; sleep 1; setenv rootfs /dev/mmcblk1p1; run cbootargs_set; run mmc_boot'
set cbootargs_common ' rootwait rw rootfstype=ext4 console=ttyS2,115200n8 console=tty2 fbcon=map:0 net.ifnames=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0xc280000 nvdumper_reserved=0x2372e0000 gpt usbcore.old_scheme_first=1 tegraid=18.1.2.0.0 maxcpus=6 boot.slot_suffix= boot.ratchetvalues=0.2031647.1 bl_prof_dataptr=0x10000@0x235840000 sdhci_tegra.en_boot_part_access=1'
set cbootargs_set 'set cbootargs root=${rootfs}${cbootargs_common}'