Enable SDIO in Linux on TX1

Hello,

I’ve been developping a custom board for the Jetson TX1 and I ran into problems to get an SD-card working on the SDIO interface. I get the suspicion that this interface is not enabled in Linux. There is also a SD card connected tot de SDCARD interface and this is perfectly working.

When I look in de sysfs I found there only 3 interfaces available, while the Tegra has four.

ubuntu@tegra-ubuntu:~$ ll /sys/devices/platform/ | grep sdhci
drwxr-xr-x   5 root root    0 Oct 25 09:11 sdhci-tegra.0/
drwxr-xr-x   5 root root    0 Oct 25 09:11 sdhci-tegra.1/
drwxr-xr-x   5 root root    0 Oct 25 09:11 sdhci-tegra.3/

When I inspect the sysfs a bit more I conclude that:
sdhci-tegra.0 is the SDCARD interface
sdhci-tegra.1 is primary WiFi module
sdhci-tegra.3 is the eMMC memory

which corresponds to the OEM product design guide, expect the numbering start at 1 in stead of 0 (SDMMC1 … SDMMC4 )

ubuntu@tegra-ubuntu:~$ tree /sys/bus/mmc/
/sys/bus/mmc/
├── devices
│   ├── mmc0:0001 -> ../../../devices/platform/sdhci-tegra.3/mmc_host/mmc0/mmc0:0001
│   ├── mmc1:0001 -> ../../../devices/platform/sdhci-tegra.1/mmc_host/mmc1/mmc1:0001
│   └── mmc2:59b4 -> ../../../devices/platform/sdhci-tegra.0/mmc_host/mmc2/mmc2:59b4
├── drivers
│   └── mmcblk
│       ├── bind
│       ├── mmc0:0001 -> ../../../../devices/platform/sdhci-tegra.3/mmc_host/mmc0/mmc0:0001
│       ├── mmc2:59b4 -> ../../../../devices/platform/sdhci-tegra.0/mmc_host/mmc2/mmc2:59b4
│       ├── uevent
│       └── unbind
├── drivers_autoprobe
├── drivers_probe
└── uevent
ubuntu@tegra-ubuntu:/sys/bus/mmc/devices/mmc1:0001/mmc1:0001:2/net$ ll
total 0
drwxr-xr-x 3 root root 0 Oct 25 09:11 ./
drwxr-xr-x 9 root root 0 Oct 25 09:11 ../
drwxr-xr-x 6 root root 0 Oct 25 09:11 wlan0/

Is there a way to enable the missing SDMMC interface in Linux? Or can someone point me towards a direction to look for.

Hello,

It turned out that only a minor modification in the device tree was needed. Here’s my solution for anyone who’s facing the same problem in the future:

look for sdhci@700b0400 in the device tree source. I changed the properties to the following:

sdhci@700b0400 {
	compatible = "nvidia,tegra210-sdhci";
	reg = <0x0 0x700b0400 0x0 0x200>;
	interrupts = <0x0 0x13 0x4>;
	iommus = <0x46 0x1b>;
	pwrdet-support;
	pad-controllers = <0x99 0x1d>;
	pad-names = "sdmmc";
	nvidia,runtime-pm-type = <0x1>;
	status = "okay";
	vddio_sdmmc-supply = <0x56>;
	vddio_sd_slot-supply = <0x5b>;
	tap-delay = <0x1>;
	trim-delay = <0x3>;
	max-clk-limit = <0xbebc200>;
	ddr-clk-limit = <0x2dc6c00>;
	bus-width = <0x4>;
	calib-3v3-offsets = <0x7d>;
	calib-1v8-offsets = <0x7b7b>;
	compad-vref-3v3 = <0x7>;
	compad-vref-1v8 = <0x7>;
	pll_source = "pll_p";
	nvidia,en-io-trim-volt;
	nvidia,en-periodic-calib;
	mmc-ocr-mask = <0x0>;
	uhs-mask = <0x60>;
	power-off-rail;
	nvidia,update-pinctrl-settings;
	pinctrl-names = "sdmmc_schmitt_enable", "sdmmc_schmitt_disable", "sdmmc_clk_schmitt_enable", "sdmmc_clk_schmitt_disable", "sdmmc_drv_code", "sdmmc_default_drv_code";
	pinctrl-0 = <0x9a>;
	pinctrl-1 = <0x9b>;
	pinctrl-2 = <0x9c>;
	pinctrl-3 = <0x9d>;
	pinctrl-4 = <0x9e>;
	pinctrl-5 = <0x9f>;
	nvidia,sd-device;
};

Maybe you want modify the tree otherwise for a given situation. The key thing was to change status from ‘disabled’ to ‘okay’

hi,
i want ask you how to modify dts on the newest L4T version R28.2? have u done this?