Commit a7425c6c1bbd17c4800a89dd0b2461872339c7b3

Kano 2013-06-07T01:52:51

Icarus AMU enable the UART

diff --git a/driver-icarus.c b/driver-icarus.c
index 2d18333..df65cfd 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -364,6 +364,16 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
 		case IDENT_AMU:
 			nmsleep(20);
 
+			// Enable the UART
+			transfer(icarus, CP210X_TYPE_OUT, CP210X_REQUEST_IFC_ENABLE,
+				 CP210X_VALUE_UART_ENABLE,
+				 icarus->usbdev->found->interface, C_PURGETX);
+
+			if (icarus->usbinfo.nodev)
+				return;
+
+			nmsleep(20);
+
 			// Set data control
 			transfer(icarus, CP210X_TYPE_OUT, CP210X_REQUEST_DATA, CP210X_VALUE_DATA,
 				 icarus->usbdev->found->interface, C_SETDATA);
diff --git a/usbutils.h b/usbutils.h
index 8cc8922..9b2cf26 100644
--- a/usbutils.h
+++ b/usbutils.h
@@ -68,9 +68,11 @@
 // For 0x10c4:0xea60 USB cp210x chip - AMU
 #define CP210X_TYPE_OUT 0x41
 
+#define CP210X_REQUEST_IFC_ENABLE 0x00
 #define CP210X_REQUEST_DATA 0x07
 #define CP210X_REQUEST_BAUD 0x1e
 
+#define CP210X_VALUE_UART_ENABLE 0x0001
 #define CP210X_VALUE_DATA 0x0303
 #define CP210X_DATA_BAUD 0x0001c200