summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Martin <amartin@nvidia.com>2012-03-26 14:42:18 -0700
committerAllen Martin <amartin@nvidia.com>2012-04-03 09:28:31 -0700
commitd55c0ac2c147c6e88605f576b534e58c81a5ee38 (patch)
tree7261e07b9554d8e2578f6e2c936ca446951c3b09
parent80b43dbd4f50b92db349c14b5833c177ece4a6df (diff)
downloadtegrarcm-d55c0ac2c147c6e88605f576b534e58c81a5ee38.tar.gz
reinitialize USB after miniloader download
After downloading the miniloader there is a USB disconnect/reconnect which may result in a new USB address for the tegra device. Add an explicit USB reenumeration after downloading miniloader to avoid hang in this situation. Change-Id: I217c9b925ddb67f76500ef0b45a143c2c182153f Reviewed-on: http://git-master/r/94265 Reviewed-by: Allen Martin <amartin@nvidia.com> Tested-by: Allen Martin <amartin@nvidia.com>
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a89a7cd..3068ea1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -219,6 +219,12 @@ int main(int argc, char **argv)
error(1, ret, "Error downloading miniloader");
printf("miniloader downloaded successfully\n");
+ // device may have re-enumerated, so reopen USB
+ usb_close(usb);
+ usb = usb_open(USB_VENID_NVIDIA, &devid);
+ if (!usb)
+ error(1, errno, "could not open USB device");
+
// now that miniloader is up, start nv3p protocol
ret = nv3p_open(&h3p, usb);
if (ret)