FEL mode on the A80 changed the bulk transfer endpoint.
If we use the original binary, it timeouts waiting for
bulk transfer to be received, while the FEL BROM hangs
waiting to send the transfer.

Add a macro and separate build rule for the A80 specific
version of the fel utility.

Signed-off-by: Chen-Yu Tsai <[email protected]>
---
 Makefile | 5 ++++-
 fel.c    | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 922da8f..c650dd1 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ CFLAGS = -g -O0 -Wall -Wextra
 CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L
 CFLAGS += -Iinclude/
 
-TOOLS = fexc bin2fex fex2bin bootinfo fel pio
+TOOLS = fexc bin2fex fex2bin bootinfo fel pio fel_a80
 TOOLS += nand-part
 
 MISC_TOOLS = phoenix_info
@@ -55,6 +55,9 @@ LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)`
 fel: fel.c
        $(CC) $(CFLAGS) $(LIBUSB_CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) 
$(LIBS) $(LIBUSB_LIBS)
 
+fel_a80: fel.c
+       $(CC) $(CFLAGS) -DFEL_A80 $(LIBUSB_CFLAGS) $(LDFLAGS) -o $@ $(filter 
%.c,$^) $(LIBS) $(LIBUSB_LIBS)
+
 nand-part: nand-part-main.c nand-part.c nand-part-a10.h nand-part-a20.h
        $(CC) $(CFLAGS) -c -o nand-part-main.o nand-part-main.c
        $(CC) $(CFLAGS) -c -o nand-part-a10.o nand-part.c -D A10
diff --git a/fel.c b/fel.c
index c34de19..cdcd043 100644
--- a/fel.c
+++ b/fel.c
@@ -45,7 +45,11 @@ static const int AW_USB_READ = 0x11;
 static const int AW_USB_WRITE = 0x12;
 
 static const int AW_USB_FEL_BULK_EP_OUT=0x01;
+#ifdef FEL_A80
+static const int AW_USB_FEL_BULK_EP_IN=0x81;
+#else
 static const int AW_USB_FEL_BULK_EP_IN=0x82;
+#endif
 static int timeout = 60000;
 
 void usb_bulk_send(libusb_device_handle *usb, int ep, const void *data, int 
length)
-- 
2.1.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to