I’m trying to replace sdmmc3 which seems to be default for the tk1 with sdmm1 and use the sdmm3 pins for other purpose. It seems though that for some reason the sdhci-tegra.2 and sdhci-tegra.3 (sdmmc3 and eMMC) are somehow embedded in the jetson platform and can’t be changed!
For example, although in the device tree I’ve erased all the nodes regarding sdhci (sdhci@700b0X00) from all the dtsi and dts files, after I compile the kernel and upload the image on the tegra, somehow it still tries to mount the sdhci-tegra.2! It seems like the device tree can’t control the actual devices. They are embedded somehow.
The thing is that when the sdhci_acpi probes for devices it founds sdhci-tegra.2 and sdhci-tegra.3 without being in the device tree. So somehow they have to be declared somewhere.
Also, if I change the clk pin of the sdmmc3 device to something else the kernel stops because it timeouts as it can’t get an interrupt.
With some further investigation I believe the the flash tool probably does the damage. Maybe it’s something in the ODMDATA in the .conf file. Now it is ODMDATA=0x6009C000. And there is a point at the flashing procedure that prints out the following line.
This “setting device: 2 3” I believe that has to do something with this issue, because the numbers much. But this comes from the flash binary so I can’t do anything there.
Does anybody know how can I disable the sdmm3 card, use the pins as gpios and finally enable only sdmm1 and sdmm4?
Hello, dimtass:
(based on R21.4)
sdmm3 in Jetson TK1 is for external SD card. To disable that, you can comment out the platform_device_register(&tegra_sdhci_device2) in arch/arm/mach-tegra/board-ardbeg-sdhci.c
As to GPIO pins, you can add desired GPIO in DTS, or direct call gpio_request.
Thank you for your reply. I did that and the kernel image boots fine. The problem is that now the sdmmc1, which is used for the external SD card it doesn’t recognize the card. I suspect timing or configuration issues. The sdmmc1 interface is recognized during boot but it doesn’t find the SD card.
Anyway, do you know why the device tree is not supported for TK1? I mean, although there are the dsi and dtsi files, many things are seem to be hardcoded in source files. Is there any support list with which things are supported in device tree files and which not?
I’m really sorry for late response.
This is the log regarding the SD controllers. It seems like
[ 4.955352] sdhci: Secure Digital Host Controller Interface driver
[ 4.961540] sdhci: Copyright(c) Pierre Ossman
[ 4.965920] sdhci-pltfm: SDHCI platform and OF driver helper
[ 4.971874] sdhci-tegra sdhci-tegra.3: vddio_sdmmc regulator not found: -517.Assuming vddio_sdmmc is not required.
[ 4.982274] sdhci-tegra sdhci-tegra.3: vddio_sd_slot regulator not found: -517. Assuming vddio_sd_slot is not required.
[ 4.993240] sdhci-tegra sdhci-tegra.3: Speedo value 2238
[ 4.996531] usb 1-1: new high-speed USB device number 2 using tegra-ehci
[ 5.005305] sdhci-tegra sdhci-tegra.3: Tuning constraints: nom_mv 1150, boot_mv 1150, min_or_mv 1100
[ 5.014893] mmc0: no vqmmc regulator found
[ 5.019064] mmc0: no vmmc regulator found
[ 5.023091] mmc0: Invalid maximum block size, assuming 512 bytes
[ 5.029178] sysedp_create_consumer: unable to create sdhci-tegra.3, no consumer_data for sdhci-tegra.3 found[ 5.039239] usb 1-1: New USB device found, idVendor=0424, idProduct=2517
[ 5.045980] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 5.053753] hub 1-1:1.0: USB hub found
[ 5.057731] hub 1-1:1.0: 7 ports detected
[ 5.061801] mmc0: SDHCI controller on sdhci-tegra.3 [sdhci-tegra.3] using ADMA
[ 5.069273] otg state changed: SUSPEND --> PERIPHERAL
[ 5.074731] sdhci-tegra sdhci-tegra.0: vddio_sdmmc regulator not found: -517.Assuming vddio_sdmmc is not required.
[ 5.085155] sdhci-tegra sdhci-tegra.0: vddio_sd_slot regulator not found: -517. Assuming vddio_sd_slot is not required.
[ 5.096109] sdhci-tegra sdhci-tegra.0: Speedo value 2238
[ 5.101441] sdhci-tegra sdhci-tegra.0: Tuning constraints: nom_mv 1150, boot_mv 1150, min_or_mv 1100
[ 5.110942] mmc1: no vqmmc regulator found
[ 5.115063] mmc1: no vmmc regulator found
[ 5.119082] mmc1: Invalid maximum block size, assuming 512 bytes
[ 5.125117] sysedp_create_consumer: unable to create sdhci-tegra.0, no consumer_data for sdhci-tegra.0 found
[ 5.158523] mmc1: SDHCI controller on sdhci-tegra.0 [sdhci-tegra.0] using ADMA
[ 5.167680] mmc0: sectors: 30777344, type: 23
[ 5.172093] mmc0: BKOPS_EN bit is not set
[ 5.178560] usb 2-1: new high-speed USB device number 2 using tegra-ehci
[ 5.185861] tegra-se tegra12-se: tegra_se_probe: complete
[ 5.188281] sdhci-tegra sdhci-tegra.3: Found T2T coeffs data
[ 5.188289] sdhci-tegra sdhci-tegra.3: 200MHz tap hole coeffs found
mmc0 on sdhci-tegra.3 is the eMMC and is present as mmcblk0 in the kernel.
mmc1 on sdhci-tegra.0 should be the SD card but it’s nowhere present as device in the kernel. I’ve tried with ‘blkid’ and ‘fdisk -l’ but only the mmcblk0 is present.
Hello, dimtass:
Let’s start from SD card plug/unplug. that may provide more useful information.
Generally, 2 related interrupts will be generated when SD card plug-in/out. 1 is card-detect, and another is host controller.
I paste log in my side for your reference. And you can check what’s wrong in your side.
cat /proc/interrupts |grep mmc
51: 208 GIC mmc1
63: 19047 GIC mmc0
347: 175 GPIO mmc1
root@tegra-ubuntu:/home/ubuntu# [ 134.824174] init: plymouth-stop pre-start process (2086) terminated with status 1
[ 277.281871] sdhci-tegra sdhci-tegra.2: Found T2T coeffs data
[ 277.295560] sdhci-tegra sdhci-tegra.2: 81MHz tap hole coeffs found
[ 277.865135] **********Auto tuning windows*************
[ 277.870742] WIN_ATTR legend: 0-BOUN_ST, 1-BOUN_END, 2-HOLE
[ 277.876402] win[0]: 0(0) - 49(1)
[ 277.879772] win[1]: 64(0) - 255(1)
[ 277.883380] ***************************************
[ 277.888512] ********tuning windows after inserting holes*****
[ 277.894584] WIN_ATTR legend: 0-BOUN_ST, 1-BOUN_END, 2-HOLE
[ 277.900827] win[0]:-152(0) - 49(1)
[ 277.904367] win[1]:64(0) - 137(2)
[ 277.907860] win[2]:139(2) - 255(1)
[ 277.911372] ***********************************************
[ 277.917062] **********Tuning values*********
[ 277.921668] **estimated values**
[ 277.925009] T2T_Vmax 57, T2T_Vmin 79, 1'st_hole_Vmax 138, UI_Vmax 216
[ 277.931551] **Calculated values**
[ 277.935026] T2T_Vmax 57, 1'st_hole_Vmax 138, UI_Vmax 216
[ 277.940448] T2T_Vmin 90, 1'st_hole_Vmin 83, UI_Vmin 137
[ 277.945978] ***********************************
[ 277.950613] ***********final tuning windows**********
[ 277.955761] win[0]: -85 - 20
[ 277.958783] win[1]: 81 - 73
[ 277.961730] win[2]: 155 - 150
[ 277.964848] ********************************
[ 277.969419] best tap win - (-85-20), best tap value 0 prev_best_tap 19
[ 277.976146] sdhci-tegra sdhci-tegra.2: sdhci_tegra_verify_best_tap: tuning freq 81600000hz, best tap 0
[ 277.991581] mmc1: new ultra high speed SDR50 SDHC card at address aaaa
[ 278.000302] mmcblk mmc1:aaaa: Card claimed for testing.
[ 278.015691] mmcblk1: mmc1:aaaa SL16G 14.8 GiB
[ 278.032805] mmcblk1: p1
[ 278.310848] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@tegra-ubuntu:/home/ubuntu#
root@tegra-ubuntu:/home/ubuntu# cat /proc/interrupts |grep mmc
51: 823 GIC mmc1
63: 19319 GIC mmc0
347: 176 GPIO mmc1
root@tegra-ubuntu:/home/ubuntu# [ 293.641442] mmc1: card aaaa removed
First, please check whether the card insert is detected when SD plug-in.
Well, I haven’t made it work yet. Although, I’ve enable it in the board files, I can’t get it work.
Which is the proper procedure to enable/disable an SD card in Tegra?
I’ve done the following:
Set the proper pin function in tegra-pinmux.dtsi
Call ‘platform_device_register(&tegra_sdhci_device1);’ in __init_ardbeg_sdhci_init() in board-ardberg-sdhci.c
For example if I need to enable also sdmmc2a I need to set the pins in tegra-pinmux.dtsi and then add ‘tegra_sdhci_platform_data tegra_sdhci_platform_data1’ and ‘platform_device tegra_sdhci_device1’ (which by the way is missing in 21.4 & 21.5) in the board-ardberg-sdhci.c and then call ‘platform_device_register(&tegra_sdhci_device1);’ in __init_ardbeg_sdhci_init().
Is that right? Do I need to do anything more than that? Is there any other board file that I need to edit?
Oh, and I also have to say that, all SD interfaces (among other peripherals) have their own external power supply, so I don’t need to enable any regulator in the tegra12-fixed.dtsi. Therefore, that’s not my problem.
Hello,
You can check signals to figure out whether somewhere is mis-configured. Also, check the kernel log may help.
Generally, EMMC host driver should detect the card first, and then send some cmds to probe the card. It’s better to find which step it fails.
you may check the power, clock, pins, bus-width, etc.