public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: ci_udc: implement dfu_usb_get_reset
@ 2014-08-25 20:02 Stephen Warren
  2014-09-01  7:28 ` Lukasz Majewski
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2014-08-25 20:02 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

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 <swarren@nvidia.com>
---
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(+)

diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
index 4cd19c3afd22..2572b346ebfa 100644
--- a/drivers/usb/gadget/ci_udc.c
+++ b/drivers/usb/gadget/ci_udc.c
@@ -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);
+}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-01  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-25 20:02 [U-Boot] [PATCH] usb: ci_udc: implement dfu_usb_get_reset Stephen Warren
2014-09-01  7:28 ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox