Your Name 1 year ago
parent
commit
ff4bf57482
6 changed files with 29 additions and 70 deletions
  1. 1 5
      api.c
  2. 9 0
      cgminer.c
  3. 3 22
      configure.ac
  4. 3 0
      miner.h
  5. 12 42
      usbutils.c
  6. 1 1
      usbutils.h

+ 1 - 5
api.c

@@ -32,7 +32,7 @@
 	defined(USE_MINION) || defined(USE_COINTERRA) || defined(USE_BITMINE_A1) || \
 	defined(USE_ANT_S1) || defined(USE_ANT_S2) || defined(USE_ANT_S3) || defined(USE_SP10) || \
 	defined(USE_SP30) || defined(USE_ICARUS) || defined(USE_HASHRATIO) || defined(USE_AVALON_MINER) || \
-	defined(USE_AVALON7) || defined(USE_AVALON8) || defined(USE_AVALON9) || defined(USE_AVALONLC3) || defined(USE_BITMAIN_SOC) || defined(USE_GEKKO) || defined(USE_BITAXE)
+	defined(USE_AVALON7) || defined(USE_AVALON8) || defined(USE_AVALON9) || defined(USE_AVALONLC3) || defined(USE_BITMAIN_SOC) || defined(USE_GEKKO)
 #define HAVE_AN_ASIC 1
 #endif
 
@@ -200,10 +200,6 @@ static const char *DEVICECODE = ""
 #ifdef USE_GEKKO
 			"GSX "
 #endif
-#ifdef USE_BITAXE
-                        "BAX "
-#endif
-
 #ifdef USE_HASHFAST
 			"HFA "
 #endif

+ 9 - 0
cgminer.c

@@ -337,6 +337,7 @@ bool opt_gekko_gsc_detect = 0;
 bool opt_gekko_gsd_detect = 0;
 bool opt_gekko_gse_detect = 0;
 bool opt_gekko_gsh_detect = 0;
+bool opt_gekko_bax_detect = 0;
 bool opt_gekko_gsi_detect = 0;
 bool opt_gekko_gsf_detect = 0;
 bool opt_gekko_r909_detect = 0;
@@ -354,11 +355,13 @@ float opt_gekko_wait_factor = 0.5;
 #endif
 float opt_gekko_step_freq = 6.25;
 int opt_gekko_gsh_freq = 100;
+int opt_gekko_bax_freq = 100;
 int opt_gekko_gsi_freq = 550;
 int opt_gekko_gsf_freq = 200;
 int opt_gekko_r909_freq = 450;
 int opt_gekko_bauddiv = 0;
 int opt_gekko_gsh_vcore = 400;
+int opt_gekko_bax_vcore = 400;
 int opt_gekko_start_freq = 100;
 int opt_gekko_step_delay = 15;
 bool opt_gekko_mine2 = false; // gekko code ignores it
@@ -2270,6 +2273,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--gekko-newpac-detect",
 			 opt_set_bool, &opt_gekko_gsh_detect,
 			 "Detect GekkoScience NewPac BM1387"),
+	OPT_WITHOUT_ARG("--gekko-bitaxe-detect",
+                         opt_set_bool, &opt_gekko_bax_detect,
+                         "Detect GekkoScience NewPac BM1387"),
 	OPT_WITHOUT_ARG("--gekko-r606-detect",
 			 opt_set_bool, &opt_gekko_gsi_detect,
 			 "Detect GekkoScience Terminus BM1387"),
@@ -2309,6 +2315,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITH_ARG("--gekko-newpac-freq",
 		     set_int_0_to_9999, opt_show_intval, &opt_gekko_gsh_freq,
 		     "Set GekkoScience NewPac BM1387 frequency in MHz, range 50-900"),
+	OPT_WITH_ARG("--gekko-bitaxe-freq",
+                     set_int_0_to_9999, opt_show_intval, &opt_gekko_bax_freq,
+                     "Set GekkoScience Bitaxe BM1387 frequency in MHz, range 50-900"),
 	OPT_WITH_ARG("--gekko-r606-freq",
 		     set_int_0_to_9999, opt_show_intval, &opt_gekko_gsi_freq,
 		     "Set GekkoScience Terminus R606 frequency in MHz, range 50-900"),

+ 3 - 22
configure.ac

@@ -464,19 +464,6 @@ if test "x$gekko" = xyes; then
 fi
 AM_CONDITIONAL([HAS_GEKKO], [test x$gekko = xyes])
 
-bitaxe="no"
-
-AC_ARG_ENABLE([bitaxe],
-        [AC_HELP_STRING([--enable-bitaxe],[Compile support for bitaxe (default disabled)])],
-        [bitaxe=$enableval]
-        )
-if test "x$bitaxe" = xyes; then
-        AC_DEFINE([USE_BITAXE], [1], [Defined to 1 if Bitaxe support is wanted])
-        AC_DEFINE([USE_VMASK], [1], [Defined to 1 if version mask rolling is wanted])
-        drivercount=x$drivercount
-fi
-AM_CONDITIONAL([HAS_BITAXE], [test x$bitaxe = xyes])
-
 hashfast="no"
 
 AC_ARG_ENABLE([hashfast],
@@ -635,7 +622,7 @@ fi
 
 
 #Add a new device to this list if it needs libusb, along with a no on the end.
-if test x$avalon$avalon2$avalon4$avalon7$avalon8$avalon9$avalonlc3$avalon_miner$bitforce$bitfury$blockerupter$bitaxe$gekko$modminer$bflsc$icarus$hashfast$hashratio$klondike$drillbit$cointerra$ants1$ants3 != xnonononononononononononononononononononononono; then
+if test x$avalon$avalon2$avalon4$avalon7$avalon8$avalon9$avalonlc3$avalon_miner$bitforce$bitfury$blockerupter$gekko$modminer$bflsc$icarus$hashfast$hashratio$klondike$drillbit$cointerra$ants1$ants3 != xnononononononononononononononononononononono; then
 	want_usbutils=true
 else
 	want_usbutils=false
@@ -647,7 +634,7 @@ else
 	want_libbitfury=false
 fi
 
-if test x$avalon2$avalon4$avalon7$avalon8$avalon9$avalonlc3$avalon_miner$gekko$bitaxe$hashratio != xnonononononononono; then
+if test x$avalon2$avalon4$avalon7$avalon8$avalon9$avalonlc3$avalon_miner$gekko$hashratio != xnononononononono; then
 	want_crc16=true
 else
 	want_crc16=false
@@ -1052,12 +1039,6 @@ else
         echo "  GekkoScience.ASICs...: Disabled"
 fi
 
-if test "x$bitaxe" = xyes; then
-        echo "  BitAxe.ASICs.........: Enabled"
-else
-        echo "  BitAxe.ASICs.........: Disabled"
-fi
-
 if test "x$hashfast" = xyes; then
 	echo "  Hashfast.ASICs.......: Enabled"
 else
@@ -1108,7 +1089,7 @@ fi
 
 
 #Add any new device to this, along with a no on the end of the test
-if test "x$avalon$avalon2$avalon4$avalon7$avalon8$avalon9$avalonlc3$avalon_miner$bab$bflsc$bitforce$bitfury$bitfury16$bitmain_soc$blockerupter$gekko$bitaxe$hashfast$hashratio$icarus$klondike$knc$modminer$drillbit$minion$cointerra$bitmine_A1$ants1$ants2$ants3$sp10$sp30$dragonmint_t1" = xnonononononononononononononononononononononononononononononononono; then
+if test "x$avalon$avalon2$avalon4$avalon7$avalon8$avalon9$avalonlc3$avalon_miner$bab$bflsc$bitforce$bitfury$bitfury16$bitmain_soc$blockerupter$gekko$hashfast$hashratio$icarus$klondike$knc$modminer$drillbit$minion$cointerra$bitmine_A1$ants1$ants2$ants3$sp10$sp30$dragonmint_t1" = xnononononononononononononononononononononononononononononononono; then
 	echo
 	AC_MSG_ERROR([No mining devices configured in])
 	echo

+ 3 - 0
miner.h

@@ -1072,6 +1072,7 @@ extern bool opt_gekko_gsc_detect;
 extern bool opt_gekko_gsd_detect;
 extern bool opt_gekko_gse_detect;
 extern bool opt_gekko_gsh_detect;
+extern bool opt_gekko_bax_detect;
 extern bool opt_gekko_gsi_detect;
 extern bool opt_gekko_gsf_detect;
 extern bool opt_gekko_r909_detect;
@@ -1084,10 +1085,12 @@ extern float opt_gekko_wait_factor;
 extern float opt_gekko_step_freq;
 extern int opt_gekko_bauddiv;
 extern int opt_gekko_gsh_freq;
+extern int opt_gekko_bax_freq;
 extern int opt_gekko_gsi_freq;
 extern int opt_gekko_gsf_freq;
 extern int opt_gekko_r909_freq;
 extern int opt_gekko_gsh_vcore;
+extern int opt_gekko_bax_vcore;
 extern int opt_gekko_start_freq;
 extern int opt_gekko_step_delay;
 extern int opt_gekko_tune2;

+ 12 - 42
usbutils.c

@@ -230,28 +230,6 @@ static struct usb_intinfo gek2_ints[] = {
 
 #endif
 
-#ifdef USE_BITAXE
-// CP210X Devices
-static struct usb_epinfo bax1_epinfos[] = {
-        { LIBUSB_TRANSFER_TYPE_BULK,    64,     EPI(1), 0, 0 },
-        { LIBUSB_TRANSFER_TYPE_BULK,    64,     EPO(1), 0, 0 }
-};
-
-static struct usb_intinfo bax1_ints[] = {
-        USB_EPS(0, bax1_epinfos)
-};
-
-// FTDI Devices
-static struct usb_epinfo bax2_epinfos[] = {
-        { LIBUSB_TRANSFER_TYPE_BULK,    64,     EPI(1), 0, 0 },
-        { LIBUSB_TRANSFER_TYPE_BULK,    64,     EPO(2), 0, 0 }
-};
-static struct usb_intinfo bax2_ints[] = {
-        USB_EPS(0, bax2_epinfos)
-};
-
-#endif
-
 #ifdef USE_DRILLBIT
 // Drillbit Bitfury devices
 static struct usb_epinfo drillbit_int_epinfos[] = {
@@ -1136,6 +1114,18 @@ static struct usb_find_devices find_dev[] = {
 		.timeout = COMPAC_TIMEOUT_MS,
 		.latency = LATENCY_UNUSED,
 		INTINFO(gek2_ints) },
+	{
+                .drv = DRIVER_gekko,
+                .name = "BAX",
+                .ident = IDENT_BAX,
+                .idVendor = 0x0403,
+                .idProduct = 0x6001,
+                .iManufacturer = "FTDI",
+                .iProduct = "FT232R USB UART",
+                .config = 1,
+                .timeout = COMPAC_TIMEOUT_MS,
+                .latency = LATENCY_UNUSED,
+                INTINFO(gek2_ints) },
 	{
 		.drv = DRIVER_gekko,
 		.name = "GSI",
@@ -1172,29 +1162,10 @@ static struct usb_find_devices find_dev[] = {
 		.timeout = COMPAC_TIMEOUT_MS,
 		.latency = LATENCY_UNUSED,
 		INTINFO(gek2_ints) },
-#ifdef USE_BITAXE
-        {
-                .drv = DRIVER_bitaxe,
-                .name = "BAX",
-                .ident = IDENT_BAX,
-                .idVendor = 0x0403,
-                .idProduct = 0x6015,
-                .iManufacturer = "BAX",
-                .iProduct = "BAX",
-                .config = 1,
-                .timeout = COMPAC_TIMEOUT_MS,
-                .latency = LATENCY_UNUSED,
-                INTINFO(bax2_ints) },
-
 #endif
-#endif
-
-
 	{ DRIVER_MAX, NULL, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, NULL }
 };
 
-
-
 #define STRBUFLEN 256
 static const char *BLANK = "";
 static const char *space = " ";
@@ -4053,7 +4024,6 @@ void usb_cleanup(void)
 			case DRIVER_cointerra:
 			case DRIVER_drillbit:
 			case DRIVER_gekko:
-			case DRIVER_bitaxe:
 			case DRIVER_modminer:
 			case DRIVER_icarus:
 			case DRIVER_avalon:

+ 1 - 1
usbutils.h

@@ -198,10 +198,10 @@ enum sub_ident {
 	IDENT_GSD,
 	IDENT_GSE,
 	IDENT_GSH,
+	IDENT_BAX,
 	IDENT_GSI,
 	IDENT_GSF,
 	IDENT_GSFM,
-	IDENT_BAX,
 	IDENT_HFA,
 	IDENT_HRO,
 	IDENT_ICA,