Which device tree file to be used to configure the sd/sdio mmc device

Hi all,

We are working on a custom project that uses the nvidia jetson tx2 development kit as base device. Instead of using the builtin wifi that comes with the kit, we would like to use an ATWILC1000 sdio device and need to configure the device tree and kernel to support it.

Searching on kernel menuconfig, I have found a wilc1000 driver support on the driver/staging menu. I selected it but could not see where the mmc sd/sdio properties on the device tree.

So which device tree file I could include the mmc property, such as, for example:

mmc1: mmc@ {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
non-removable;
vmmc-supply = <&vcc_mmc1_reg>;
vqmmc-supply = <&vcc_3v3_reg>;
status = “okay”;
slot@0 {
reg = <0>;
bus-width = <4>;
cd-gpios = <&pio 3 0>;
};
};

Is this the correct way to activate the wilc1000 sdio support into the jetson tx2 based custom board?

Thanks in advance and best regards,
Ricardo

Please refer “sdhci@xxxx” in your device tree.

I have included, in tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi file the A21 pin configuration code as per:

	gpio_i2c_0_21: gpio@21 {
		compatible = "nxp,pca9555";
		status = "okay";
		reg = <0x21>;
		gpio-controller;
		#gpio-cells = <2>;
		vcc-supply = <&battery_reg>;
	};

	gpio@21 {
		vpp-vmm-rails {
			gpio-hog;
			gpios = <11 0 12 0>;
			output-high;
			label = "vpp-en-rail", "vmm-en-rail";
		};
	};

It is related to a new PCA9555 expansion header we would like to use to enable the WILC1000 wifi pins.

I compiled it and wrote it to our customized board.
My doubt now is about how could I verify if this expansion header is working?
Thanks and best regards.

Here is the i2c log I got from the dmesg command:

[ 0.421751] iommu: Adding device 3160000.i2c to group 3
[ 0.422184] iommu: Adding device c240000.i2c to group 4
[ 0.422524] iommu: Adding device 3180000.i2c to group 5
[ 0.422858] iommu: Adding device 3190000.i2c to group 6
[ 0.423284] iommu: Adding device 31b0000.i2c to group 7
[ 0.423610] iommu: Adding device 31c0000.i2c to group 8
[ 0.423940] iommu: Adding device c250000.i2c to group 9
[ 0.424269] iommu: Adding device 31e0000.i2c to group 10
[ 1.131057] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.241024] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.244939] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.248821] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.252711] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.256602] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.260531] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.264420] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.268305] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.272190] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.276074] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 1.292299] i2c /dev entries driver
[ 1.350525] tegra-ivc ivc-b000000.rtcpu:i2c@480: i2c: ver=0 grp=1 RX[8x128]=0x1900-0x1d80 TX[8x128]=0x1d80-0x2200
[ 1.361771] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50
[ 7.914609] tegra-i2c 31b0000.i2c: no acknowledge from address 0x50

And also the gpio log information:

[ 0.454194] gpiochip_setup_dev: registered GPIOs 320 to 511 on device: gpiochip0 (tegra-gpio)
[ 0.458018] gpiochip_setup_dev: registered GPIOs 256 to 319 on device: gpiochip1 (tegra-gpio-aon)
[ 0.571069] GPIO line 253 (spmic_gpio_input) hogged as input
[ 0.571246] GPIO line 254 (spmic_gpio_input) hogged as input
[ 0.571685] gpiochip_setup_dev: registered GPIOs 248 to 255 on device: gpiochip2 (max77620-gpio)
[ 0.597997] gpio tegra-gpio wake53 for gpio=159(X:7)
[ 0.600084] extcon-gpio-states external-connection:extcon@1: Cable state:1, cable id:1
[ 1.112094] gpio tegra-gpio wake19 for gpio=120(P:0)
[ 1.190943] gpio tegra-gpio-aon wake35 for gpio=16(V:0)
[ 1.377710] gpio tegra-gpio wake71 for gpio=125(P:5)
[ 1.576476] gpio tegra-gpio-aon wake29 for gpio=56(FF:0)
[ 1.576552] gpio tegra-gpio-aon wake67 for gpio=57(FF:1)
[ 1.576618] gpio tegra-gpio-aon wake68 for gpio=58(FF:2)
[ 1.576797] input: gpio-keys as /devices/gpio-keys/input/input2
[ 4.165116] gpio tegra-gpio-aon wake30 for gpio=60(FF:4)
[ 6.371021] gpio tegra-gpio wake18 for gpio=101(M:5)

to try to get the wilc1000 wifi sdio working, we tried to activate the sdmmc1: sdhci$3400000 by changing the “status = “disabled”;” to “status = “okay”;” but it seems that this configuration did not activate the sdio device. The driver seems to be loaded but could not send the bin file to the wilc1000 chipset.

Our doubt is if there is a process to activate the sdio device to get the wifi on sdio working. Coul you please help me with that?

Thanks and best regards,

Bellow you find the file tegra186-soc-sdhci.dtsi lines we modified to try to get the sdio working:

sdmmc1: sdhci@3400000 {
		compatible = "nvidia,tegra186-sdhci";
		reg = <0x0 0x3400000 0x0 0x210>;
		interrupts = < 0 62 0x04>;
		max-clk-limit = <204000000>;
                ddr-clk-limit = <48000000>;
		tap-delay = <11>;
		trim-delay = <5>;
		nvidia,ddr-tap-delay = <11>;
		ddr-trim-delay = <5>;
                mmc-ocr-mask = <3>;
                bus-width = <4>;
		ignore-pm-notify;
		keep-power-in-suspend;
		cap-mmc-highspeed;
		cap-sd-highspeed;
		pwrdet-support;
		pinctrl-names = "sdmmc_e_33v_enable", "sdmmc_e_33v_disable";
		pinctrl-0 = <&sdmmc1_e_33V_enable>;
		pinctrl-1 = <&sdmmc1_e_33V_disable>;
		compad-vref-3v3 = <0x1>;
		compad-vref-1v8 = <0x2>;
		nvidia,min-tap-delay = <84>;
		nvidia,max-tap-delay = <136>;
		pll_source = "pll_p";
		resets = <&tegra_car TEGRA186_RESET_SDMMC1>;
		reset-names = "sdhci";
		clocks = <&tegra_car TEGRA186_CLK_SDMMC1>,
		       <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
		       <&tegra_car TEGRA186_CLK_SDMMC_LEGACY_TM>;
		clock-names = "sdmmc", "pll_p", "sdmmc_legacy_tm";
		iommus = <&smmu TEGRA_SID_SDMMC1A>;
		nvidia,en-periodic-calib;
		/*status = "disabled";*/
		<b>status = "okay";</b>
	 };