This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: USB Peripheral remote wakeup

Part Number: AM3352

Tool/software:

I am using the USB controller as a peripheral, and I need to be able to signal to the host to remote wake up. According to the TRM (revision P) 16.2.8.1 it says that "Initiating a remote wakeup –If the software wants to initiate a remote wakeup while the controller is in Suspend mode, it should set the POWER[RESUME] bit to 1. The software should leave then this bit set for approximately 10 ms (minimum of 2 ms, a maximum of 15 ms) before resetting it to 0." However, this POWER[RESUME} register and bit combination are unknowable.

Can someone explain the proper procedure to make this type of signalllng happen? For reference I am using TI SDK Linux 4.14.40 with the included linux USB drivers.

Much Appreciated,

Brian

  • Hello,

    The subject matter expert is out of office today. Please expected a delayed response.

  • Any updates on this issue? I attempted to cross-reference the POWER[RESUME] bit through many of the USB-related registers, but was unable to find a register that appeared to be similar.

    Also of note is the same section of the TRM is this statement:

    "If the HSENA bit within the POWER register (bit 5) is set, the controller also tries to negotiate for highspeed operation. Whether high-speed operation is selected is indicated by HSMODE bit of POWER register (bit 4)."

    This bit of the POWER register I was also unable to find, but it would be necessary in order for me to implement our feature of disabling the HS connectivity for compatibility to legacy targets (hosts).

    I would appreciate any insight into this matter.

    Regards, Brian

  • Hi Brain,

    Sorry for my late response.

    Are you trying to let AM335x USB controller to issue remote wakeup signal while AM335x A8/Linux is in suspend state or Linux is still running?

  • Hi Bin,

    We are attempting to issue a wakeup request to the host that our linux-gadget is connected to. The AM3352 linux is fully awake and operational. Our application does not require our linux to suspend or sleep in any way.

  • Hi Brian,

    Then you don't need to worry about the USB controller registers. The only thing you need to do is to set the bit5 (Remote Wakeup) of bmAttributes field in the USB gadget device configuration descriptor.

    Please search for "USB_CONFIG_ATT_WAKEUP" in kernel source drivers/usb/gadget/ to understand how this bit Remote Wakeup bit is set in USB gadget drivers.

  • Bin,

    I did set this bit early in the development process, in conjunction with the "self-power" bit. According to the USB specification, this bit instructs the host to set the "remote wakeup" feature (via the SET_FEATURE command). It is then up to the device to implement the procedure to request the host remote wakeup. According to my USB line analyzer, the SET_FEATURE command is being sent immediately prior to the host entering shut-down, but there is NO host remote wakeup request, regardless of anything I do from the AM3352 platform. Also note that upon wake-up, the host will send the command CLEAR_FEATURE to disable host remote wakeup requests.

    Therefore, I am wondering how this is supposed to work on the AM3352 platform and what else I need to do to get it to work.

    Also, my initial request is concerning the register name and bit field mentioned in the text of the TRM, but I was unable to find the corresponding register in the register lists. This is still an outstanding request.

    Best Regards,

    Brian

  • Hi Brian,

    The SET_FEATURE/CLEAR_FEATURE transactions from the host are expected, it is normal.

    I believe the USB wake-up event should be generated by the USB gadget driver, but I never touched it, since it is irrelevant to processors. I will look into it to see if I can find an example in kernel gadget drivers.

  • Also, my initial request is concerning the register name and bit field mentioned in the text of the TRM, but I was unable to find the corresponding register in the register lists. This is still an outstanding request.

    Again, the USB controller registers should be irrelevant to your USB remote wakeup question.

  • Hi Brian,

    Whenever you USB gadget needs to send remote_wakeup signal to the USB host (after the host has sent SET_FEATURE "remote wakeup" command), your USB gadget function driver should call function usb_gadget_wakeup(), which eventually calls musb_gadget_wakeup() in drivers/musb/musb_gadget.c to send the resume signal to the USB bus.

    For reference, please check function zero_autoresume() in drivers/usb/gadget/legacy/zero.c.

  • I am not using a custom gadget driver; I am using the configfs driver for a composite gadget consisting of some HID class devices, some MSC class devices and optionally an RNDIS class device. Under these conditions, can I get the configfs driver to execute this? If not, what else would you suggest?

  • By reviewing the kernel HID, MSC, and RNDIS gadget drivers, it is not clear to me how these gadget drivers directly use remote wakeup, but Linux sysfs has an entry - /sys/class/udc/*/srp, writing '1' to it should trigger remote wakeup on the USB bus.

  • Thank you very much for this information. I will experiment with this to see if I can resolve my issues. There should be enough material here to come up with a solution, one way or another.

    Regards,