TX2-NX wifi w-disable1

I’m trying to integrate a m.2 USB/UART wifi module on to a tx2 nx with carrier board.

The devicetree I’m using is tegra186-p3636-0001-p3509-0000-a01.dts.

In this device tree there are already gpio’s tied to pins 54 and 56 (w-disable2 and w-disable1) of the m.2 wifi slot.

        gpio@2200000 {
		w-disable1 {
			gpio-hog;
			output-high;
			gpios = <TEGRA_MAIN_GPIO(L, 0) GPIO_ACTIVE_LOW>;
			label = "w-disable1";
			status = "okay";
		};
		w-disable2 {
			gpio-hog;
			output-high;
			gpios = <TEGRA_MAIN_GPIO(L, 2) GPIO_ACTIVE_LOW>;
			label = "w-disable2";
			status = "okay";
		};
        };

These lines are always high, the issue with this is the m.2 wifi modules needs these lines to go low on a soft reboot or possibly hardware issue, usb reload, etc. These signals going low allows the module to do a full reset allowing firmware to be downloaded. If this line never goes low (150-250ms) then the firmware is already loaded on a soft reboot and the driver can not communicate with the module.

Normally on an SDIO interface we use mmc-pwrseq to allow the SDIO slot to trigger these lines to toggle when needed (soft reboot, hardware failure, etc).

On other platforms we’ve used a compatible node with our usb id and a pmu-en-gpios. I personally have not used it, but other colleagues have. Which would look something like:

&usb2 {
    ...
    wifi@2{
        compatible = "usb1286,204e";
        ...
        pmu-en-gpios = <&pioE 5 GPIO_ACTIVE_HIGH>;
    };
};

Which port usb2-X is tied to the m.2 usb? Where can I put this compatibility in the device-tree?

At the minimum would be good to just toggle the w-disableX on a reboot, is this possible?

Desired would be able to tie usb device to the compatibility of the module, this would allow our driver to reset the module when there is loss of communication.

I am able to toggle w-disableX in user space, which is good to know that I can toggle them. Just need to know how I can control these in the device-tree.

Travis

  1. Which port usb2-X is tied to the m.2 usb?

You can refer to the TX2-NX design guide first.

  1. Where can I put this compatibility in the device-tree?

I am not sure what you want to do here. If you just want to control a GPIO, then no need to put it inside the usb device tree. Just similar case as the w-disable1/2 you posted.

In order for the wireless module to work correctly on soft reboots the module needs reset, that is done via the control of this pin (regulator to wifi/bt). As mentioned before on SDIO interface we tie this pin 56 (because our module has pin 54 and 56 tied together, thus resetting wifi and bluetooth together) to mmc pwrseq so when the mmc slot fails or resets on a reboot the wifi module gets reset too.

In this case the TX2 NX does not reset this line and seems to not cut voltage to the whole module allowing a reset.

As for which port it is not clear to me from the design guide which usb physical port maps to the software.

Here you can see it enum on first boot, after this any soft reset it will not work.

laird@ubuntu:~$ dmesg | egrep 'usb 1-3|ieee'
[    1.836285] usb 1-3: new high-speed USB device number 3 using tegra-xusb
[    1.857123] usb 1-3: New USB device found, idVendor=1286, idProduct=2052
[    1.857128] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.857131] usb 1-3: Product: Marvell Wireless Device
[    1.857134] usb 1-3: Manufacturer: Marvell
[    1.857136] usb 1-3: SerialNumber: 0000000000000000
[    5.862148] ieee80211 phy0: priv->pcmd_buf = ffffffc0b541c000
[    5.872188] ieee80211 phy0: lrdmwl: found firmware image <lrdmwl/88W8997_usb.bin>
[    5.872482] ieee80211 phy0: start to download FW...
[    6.358433] ieee80211 phy0: info: FW download over, size 372988 bytes, ret 0
[    6.358440] ieee80211 phy0: Firmware download complete, port will reset with new interface...
[    7.691941] usb 1-3: USB disconnect, device number 3
[    8.100297] usb 1-3: new high-speed USB device number 5 using tegra-xusb
[    8.131381] usb 1-3: New USB device found, idVendor=1286, idProduct=204e
[    8.131386] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    8.131390] usb 1-3: Product: Marvell Wireless Device
[    8.131392] usb 1-3: Manufacturer: Marvell
[    8.131394] usb 1-3: SerialNumber: C0EE4046C020
[    8.134522] ieee80211 phy1: priv->pcmd_buf = ffffffc0b293c000
[    8.134912] ieee80211 phy1: lrdmwl: found firmware image <lrdmwl/88W8997_usb.bin>
[    8.134916] ieee80211 phy1: Skipping FW download, continuing with initialization...
[    8.145477] ieee80211 phy1: OTP data len = 0
[    8.148639] ieee80211 phy1: Adjusting combo 0's number of supported interfaces to 2
[    8.148814] ieee80211 phy1: mwl_reg_notifier set=0 core 00
[    8.149437] ieee80211 phy1: Sending regulatory hint for 00
[    8.149446] ieee80211 phy1: Radio Type ST60 (0x0)
[    8.149449] ieee80211 phy1: Num mac 2 : OTP Version (1)
[    8.149452] ieee80211 phy1: Firmware version: 5.6.46.5
[    8.149455] ieee80211 phy1: Firmware OTP region: ff, country: 00
[    8.149457] ieee80211 phy1: Deep Sleep is disabled
[    8.149459] ieee80211 phy1: 2G enabled, 5G enabled
[    8.149462] ieee80211 phy1: 2 TX antennas, 2 RX antennas. (00000003)/(00000003)
[    8.150216] ieee80211 phy1: mwl_reg_notifier set=1 driver 00
[    8.152512] ieee80211 phy1: Validating lrdmwl/regpwr.db
[    8.152521] ieee80211 phy1: Successfully validated lrdmwl/regpwr.db 7750
[    8.152540] ieee80211 phy1: checking lrdmwl/regpwr.db for region:ff country:00
[    8.218380] ieee80211 phy1: Regulatory Event running...
[    8.223733] ieee80211 phy1: Checking CRDA for Country Code 00.
[    8.223740] ieee80211 phy1: Country Code 00 is valid.
[    8.249981] ieee80211 phy1: WMM Turbo=1

From what I can tell in the devicetree is that it is most likely labeled usb2. In general the usb is a bit confusing to me, so I could be misunderstanding. I have tried adding compatibility to the each of the usb2 with no luck.

I also have looked at seeing how to get pin 56 to just toggle on a soft reboot but I’m had no luck there either. Do you have a suggestion how to toggle this pin at boot with the devicetree?

Thanks -Travis

Maybe I need to set this pin low in uboot?

As for which port it is not clear to me from the design guide which usb physical port maps to the software.

I really don’t understand why does that matter to you since you are just trying to controlling a GPIO. If you want to check pin, then we also have the schematic provided in the download center.

From what I can tell in the devicetree is that it is most likely labeled usb2. In general the usb is a bit confusing to me, so I could be misunderstanding. I have tried adding compatibility to the each of the usb2 with no luck.

Sorry that I still don’t know why these two “gpio” are related to the device tree of usb. Please be aware that the usb in the device tree is only controlling the usb port itself. I mean vbus or id pin, something like that.

If your 'other platform" can accept to take a wifi@2 node with compatible "“usb1286,204e”. it means they are not using same usb controller hardware as jetson. Their driver is different from ours. If you just add “wifi@2” to our usb2 node, our driver will just ignore it.

I also have looked at seeing how to get pin 56 to just toggle on a soft reboot but I’m had no luck there either. Do you have a suggestion how to toggle this pin at boot with the devicetree?

I already suggested in previous comment and you also posted the code snippet by yourself already. What is the exact problem here? You configure the wrong pin? or it didn’t take effect?

This pin 56 needs toggle at soft reboot to reset the wifi module. Our module is USB/UART, so what is happening the device doesn’t pull USB power or toggle the regulator pin on the module thus on a soft reboot the module doesn’t reset. A hard reset will always make this work as this allows the module to reset due to power cut.

The way the tx2 nx is setup is to not pull power on the USB bus and not reset this pin56 on a reboot.

Thus the module becomes unusable after a soft reboot.

As stated in previous post this issue on SDIO bus for pin56 is handled with mmc pwrseq, of which there is nothing like this for USB. Our driver supports this for USB but I’m not sure where to put it in the devicetree.

At the very least, why is pin 56 not toggle on a soft reboot? How can I set this to toggle for a certain time on tx2 nx? Yes I can control this pin via export of gpio, but I think this could be done via devicetree or some other setting to toggle this pin.

This issue isn’t present on the Nano, see pin 56 going low on Nano:

Generally, there should be a vendor/device driver that is responsible for that and you should feed that gpio to the device tree property of that driver.

For example, we only provide the usb driver for jetson. The only thing we can make sure is usb will work fine. How the device that connected on the usb port works is not what we know. It could be a wifi card from Intel. And intel’s driver should handle that. Or maybe another card from Realtek, and their driver shall handle that.

Can you tell me when Jetpack 5.x will support the tx2 nx?

It won’t support.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.