usb: ci_udc: implement dfu_usb_get_reset
PATCH 1/1 usb: ci_udc: implement dfu_usb_get_reset
From: Stephen Warren <[email protected]>
This allows the USB code to determine whether a USB bus reset was issued, which in turn allows the code to differentiate between a detach (return to shell prompt) and a board reset/reboot request.
---
Note that this patch relies on the following unapplied patch:
[PATCH 1/2] dfu: Provide means to find difference between dfu-util -e and -R
--- drivers/usb/gadget/ci_udc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/gadget/ci_udc.c +7 -0
@@ -919,3 +919,10 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)return 0 ; } + +bool dfu_usb_get_reset (void ) +{ +struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor; + +return !!(readl (&udc->usbsts) &STS_URI ); +}
Signature · 1 line
1.9.1
PATCH 1/1 usb: ci_udc: implement dfu_usb_get_reset
Hi Stephen,
Quoted 19 lines
From: Stephen Warren <[email protected]>
This allows the USB code to determine whether a USB bus reset was issued, which in turn allows the code to differentiate between a detach (return to shell prompt) and a board reset/reboot request.
Signed-off-by Stephen Warren <[email protected]>---
Note that this patch relies on the following unapplied patch:
[PATCH 1/2] dfu: Provide means to find difference between dfu-util -e and -R ---drivers/usb/gadget/ci_udc.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/usb/gadget/ci_udc.c +0
-0
drivers/usb/gadget/ci_udc.c int usb_gadget_unregister_driver(struct · line 928
Quoted 10 lines
drivers/usb/gadget/ci_udc.c +7
-0@@ -919,3 +919,10 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)return 0 ; } + +bool dfu_usb_get_reset (void ) +{ +struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor; + +return !!(readl (&udc->usbsts) &STS_URI ); +}
Applied to u-boot-dfu.
Thanks!
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group