usb/ica add more (incomplete) CMR settings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
diff --git a/driver-icarus.c b/driver-icarus.c
index 7730cb6..f1d90e9 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -253,7 +253,8 @@ static void icarus_initialise(struct cgpu_info *icarus, __maybe_unused int baud)
switch (icarus->usbdev->ident) {
case IDENT_BLT:
case IDENT_LLT:
- case IDENT_CMR:
+ case IDENT_CMR1:
+ case IDENT_CMR2:
// Latency
transfer(icarus, FTDI_TYPE_OUT, FTDI_REQUEST_LATENCY, FTDI_VALUE_LATENCY,
icarus->usbdev->found->interface, C_LATENCY);
@@ -275,10 +276,14 @@ static void icarus_initialise(struct cgpu_info *icarus, __maybe_unused int baud)
if (icarus->usbinfo.nodev)
return;
- // Set the baud
- transfer(icarus, FTDI_TYPE_OUT, FTDI_REQUEST_BAUD, FTDI_VALUE_BAUD_BLT,
- (FTDI_INDEX_BAUD_BLT & 0xff00) | icarus->usbdev->found->interface,
- C_SETBAUD);
+ // TODO: Get the baud settings for the 2 CMRs
+ if (icarus->usbdev->ident != IDENT_CMR1 &&
+ icarus->usbdev->ident != IDENT_CMR2) {
+ // Set the baud
+ transfer(icarus, FTDI_TYPE_OUT, FTDI_REQUEST_BAUD, FTDI_VALUE_BAUD_BLT,
+ (FTDI_INDEX_BAUD_BLT & 0xff00) | icarus->usbdev->found->interface,
+ C_SETBAUD);
+ }
if (icarus->usbinfo.nodev)
return;
@@ -484,7 +489,9 @@ static void set_timing_mode(int this_option_offset, struct cgpu_info *icarus)
case IDENT_AMU:
info->Hs = ASICMINERUSB_HASH_TIME;
break;
- case IDENT_CMR:
+ // TODO: ?
+ case IDENT_CMR1:
+ case IDENT_CMR2:
info->Hs = CAIRNSMORE1_HASH_TIME;
break;
default:
@@ -617,7 +624,9 @@ static void get_options(int this_option_offset, struct cgpu_info *icarus, int *b
*work_division = 1;
*fpga_count = 1;
break;
- case IDENT_CMR:
+ // TODO: ?
+ case IDENT_CMR1:
+ case IDENT_CMR2:
*baud = ICARUS_IO_SPEED;
*work_division = 2;
*fpga_count = 2;
diff --git a/usbutils.c b/usbutils.c
index 02faa0b..f2b25f8 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -106,7 +106,24 @@ static struct usb_endpoints llt_eps[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0 }
};
-static struct usb_endpoints cmr_eps[] = {
+static struct usb_endpoints cmr1_eps[] = {
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0 }
+/*
+ Interface 1
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(4), 0 },
+
+ Interface 2
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(5), 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(6), 0 },
+
+ Interface 3
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(7), 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(8), 0 }
+*/
+};
+static struct usb_endpoints cmr2_eps[] = {
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0 },
{ LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0 }
};
@@ -230,7 +247,7 @@ static struct usb_find_devices find_dev[] = {
{
.drv = DRV_ICARUS,
.name = "CMR",
- .ident = IDENT_CMR,
+ .ident = IDENT_CMR1,
.idVendor = IDVENDOR_FTDI,
.idProduct = 0x8350,
.iProduct = "Cairnsmore1",
@@ -238,12 +255,12 @@ static struct usb_find_devices find_dev[] = {
.config = 1,
.interface = 0,
.timeout = ICARUS_TIMEOUT_MS,
- .epcount = ARRAY_SIZE(cmr_eps),
+ .epcount = ARRAY_SIZE(cmr1_eps),
.eps = cmr_eps },
{
.drv = DRV_ICARUS,
.name = "CMR",
- .ident = IDENT_CMR,
+ .ident = IDENT_CMR2,
.idVendor = IDVENDOR_FTDI,
.idProduct = 0x6014,
.iProduct = "Cairnsmore1",
@@ -251,7 +268,7 @@ static struct usb_find_devices find_dev[] = {
.config = 1,
.interface = 0,
.timeout = ICARUS_TIMEOUT_MS,
- .epcount = ARRAY_SIZE(cmr_eps),
+ .epcount = ARRAY_SIZE(cmr2_eps),
.eps = cmr_eps },
#endif
#ifdef USE_ZTEX
diff --git a/usbutils.h b/usbutils.h
index 36688d8..4bc27c6 100644
--- a/usbutils.h
+++ b/usbutils.h
@@ -108,7 +108,8 @@ enum sub_ident {
IDENT_AMU,
IDENT_BLT,
IDENT_LLT,
- IDENT_CMR,
+ IDENT_CMR1,
+ IDENT_CMR2,
IDENT_ZTX
};