how to configure device tree parameters to get the module atwilc1000 working?

I verified, reading the atwilc1000 datasheet and porting guides, that I need to include the following lines on de tx2 device tree:

sdmmc1: sdhci@3400000 {
		non-removable;
		vmmc-supply = <&vcc_3v3_reg>;
		vqmmc-supply = <&vcc_3v3_reg>;
		status = "okay";

		wilc_sdio@0 {
			compatible = "microchip,wilc1000", "microchip,wilc3000";
			status = "okay";
			reg = <0>;
			bus-width = <4>;
		}
	};
}

I found a dtsi file tegra186-soc-sdhci.dtsi the lines that have the sdmmc1 information:

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";
	 };

Is the tegra186-soc-sdhci.dtsi file the correct one to include the atwilc1000 parameters? If so, how could I include these informations? If not, on which file would I include these informations?

Thanks and best regards,
ricardo

Hi rtakaki,

Please check our OEM design guide to know the original pin for each sdhci controller.

sdhci@3400000 was for the sdcard slot on devkit and sdhci@3440000 is for the on-module wifi/bt chip which is also a SDIO device.

Thus, you could refer to the device tree of sdhci@3440000 and also the document from our kernel source.
kernel/kernel-4.9/Documentation/devicetree/bindings/mmc/sdhci-tegra.txt

I am not sure why you put wilc_sdio under sdhci node. For the on-module wifi chip bcm4354, we put the device tree as node “bcmdhd_wlan” which is not under sdhci.

Hi WayneWWW,

First of all thanks for the hints and help, I really appreciate it.

I tried to follow the same procedure made for the bcm4354 by including the wilc1000 parameters on the dt files which have included the bcm4354 so far.
So I included the following codes on the following files:

  • tegra210-comms.dtsi:
wilc1000_wlan {
		compatible = "microchip,wilc1000", "microchip,wilc3000";
		fw_path = "/vendor/firmware/mchp/wilc1000_wifi_firmware.bin";
		status = "okay";
	};
  • tegra186-quill-p3310-1000-a00-plugin-manager.dtsi:
override@4 {
				target = <&wilc1000>;
				_overlay_ {
					sdhci-host = <&sdmmc1>;
					pwr-retry-cnt = <0>;
				};
			};
  • tegra186-quill-comms.dtsi:
wilc1000: wilc1000_wlan {
		compatible = "microchip,wilc1000", "microchip,wilc3000";
		fw_path = "/vendor/firmware/mchp/wilc1000_wifi_firmware.bin";
		reg = <0>;
		bus-width = <4>;
		sdhci-host = <&sdmmc1>;
		pwr-retry-cnt = <5>;
		status = "okay";

A compiled the dts and loaded it into my custom board. When done the insmod instruction, I saw the wilc_sdio driver but no one using it.

insmod /lib/modules/4.9.140-tegra/kernel/drivers/staging/mchp/wilc-sdio.ko 
root@nvidia-desktop:/dev# lsmod
Module                  Size  Used by
wilc_sdio             241589  0
bnep                   18758  2
fuse                  111883  5
overlay                51726  0
zram                   29313  6
nvgpu                1721886  38
bluedroid_pm           16059  0
ip_tables              21421  0
x_tables               38016  1 ip_tables

In the dmesg I see the mmc1 loaded as shown below:

[    0.000000] Kernel command line: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0x3100000 nvdumper_reserved=0x2772e0000 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@0x275840000 sdhci_tegra.en_boot_part_access=1 quiet
[    0.454507] GPIO line 445 (sdmmc-wake-support-input) hogged as input
[    0.454528] GPIO line 446 (sdmmc-wake-support-output) hogged as output/low
[    0.561681] vddio-sdmmc1: 1800 <--> 3300 mV at 3300 mV 
[    1.348830] mmc0: SDHCI controller on 3460000.sdhci [3460000.sdhci] using ADMA 64-bit with 64 bit addr
[    1.352806] mmc1: SDHCI controller on 3440000.sdhci [3440000.sdhci] using ADMA 64-bit with 64 bit addr
[    1.360970] mmc2: SDHCI controller on 3400000.sdhci [3400000.sdhci] using ADMA 64-bit with 64 bit addr
[    1.394512] mmc0: mmc_decode_ext_csd: CMDQ supported: depth: 31, cmdq_support: 1
[    1.408940] mmc0: periodic cache flush enabled
[    1.408953] mmc0: new HS400 Enhanced strobe MMC card at address 0001
[    1.409424] mmcblk0: mmc0:0001 032G34 29.1 GiB 
[    1.413646] mmcblk0boot0: mmc0:0001 032G34 partition 1 4.00 MiB
[    1.413815] mmcblk0boot1: mmc0:0001 032G34 partition 2 4.00 MiB
[    1.414041] mmcblk0rpmb: mmc0:0001 032G34 partition 3 4.00 MiB
[    1.417618]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p30 p31
[    1.596700] mmc1: Applying tuning correction
[    1.596712] mmc1: Tap value after applying correction 67
[    1.596718] mmc1: hw tuning done ...
[b][    1.600549] mmc1: new ultra high speed SDR104 SDIO card at address 0001
[/b][    1.614845] mmcblk mmc0:0001: Card claimed for testing.
[    3.472505] Root device found: mmcblk0p1
[    3.474842] Found dev node: /dev/mmcblk0p1
[    3.512198] EXT4-fs (mmcblk0p1): 3 orphan inodes deleted
[    3.512204] EXT4-fs (mmcblk0p1): recovery complete
[    3.515722] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    3.517025] Rootfs mounted over mmcblk0p1
[    4.267772] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)

And also the sdhci information as well:

[    0.000000] Kernel command line: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0x3100000 nvdumper_reserved=0x2772e0000 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@0x275840000 sdhci_tegra.en_boot_part_access=1 quiet
[    0.419892] iommu: Adding device 3460000.sdhci to group 0
[    0.420567] iommu: Adding device 3400000.sdhci to group 1
[    1.302669] sdhci: Secure Digital Host Controller Interface driver
[    1.302671] sdhci: Copyright(c) Pierre Ossman
[    1.302673] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.304113] sdhci-tegra 3460000.sdhci: Client registration for eMC Successful
[b][    1.307316] sdhci-tegra 3440000.sdhci: Client registration for eMC Successful
[/b][    1.309829] sdhci-tegra 3400000.sdhci: Got CD GPIO
[    1.312089] sdhci-tegra 3400000.sdhci: Got WP GPIO
[    1.312918] sdhci-tegra 3400000.sdhci: Client registration for eMC Successful
[    1.313756] sdhci-tegra 3400000.sdhci: wakeup init done, cdirq 255
[    1.348830] mmc0: SDHCI controller on 3460000.sdhci [3460000.sdhci] using ADMA 64-bit with 64 bit addr
[b][    1.352806] mmc1: SDHCI controller on 3440000.sdhci [3440000.sdhci] using ADMA 64-bit with 64 bit addr
[/b][    1.360970] mmc2: SDHCI controller on 3400000.sdhci [3400000.sdhci] using ADMA 64-bit with 64 bit addr

Even mmc1 is registered as an sdhci controller on 3440000.sdhci I could not get the driver working so far …

Could you see please if my device trees modifications are correct?

Tomorrow I will see the kernel/kernel-4.9/Documentation/devicetree/bindings/mmc/sdhci-tegra.txt
documentation as you sugested.

Note: I did not find the sdhci controller pin on the newest OEM design guide. I got this document on:

https://developer.nvidia.com/embedded/dlc/jetson-tx2-series-oem-product-design-guide

Thanks and best regards,
Ricardo

  1. For those dts/dtsi files with “t210” or “tegra210”, they are used for TX1. So don’t need to modify them.

  2. To confirm whether your device tree change is successfully put into dtb, please check the node /proc/device-tree/ on your tx2.

  3. We only teach user for the hardware design of sdcard in OEM Design guide. No sdio device.

  4. You may need to find out how to make wilc_sdio driver. For example, there is a “dhd_module_init” for our on-module wifi chip. I don’t know what is your initial point. Please also check with kernel log to see if module init has some failure.