[PATCH] USB: dfu: Use barebox product id

Sascha Hauer s.hauer at pengutronix.de
Fri Feb 14 10:33:43 EST 2014


We obtained a USB Product ID from Openmoko for barebox running
in DFU mode. Use it as default for the dfu command. Now we can
make the USB VID/PID arguments optional.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 commands/dfu.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/commands/dfu.c b/commands/dfu.c
index ec1197a..998c868 100644
--- a/commands/dfu.c
+++ b/commands/dfu.c
@@ -125,9 +125,14 @@ static int do_dfu(int argc, char *argv[])
 
 	argstr = argv[optind];
 
-	if (!idProduct || !idVendor) {
-		printf("productid or vendorid not given\n");
-		return 1;
+	if (!idProduct && !idVendor) {
+		idVendor = 0x1d50; /* Openmoko, Inc */
+		idProduct = 0x60a2; /* barebox bootloader USB DFU Mode */
+	}
+
+	if ((idProduct && !idVendor) || (!idProduct && idVendor)) {
+		printf("Only one of vendor id or product id given\n");
+		return -EINVAL;
 	}
 
 	for (n = 0; *argstr; n++) {
-- 
1.8.5.3




More information about the barebox mailing list